src/share/vm/ci/ciEnv.cpp

Print this page
rev 5933 : 8035493: JVMTI PopFrame capability must instruct compilers not to prune locals
Reviewed-by: kvn, sla, coleenp

*** 134,143 **** --- 134,148 ---- _ArrayIndexOutOfBoundsException_instance = NULL; _ArrayStoreException_instance = NULL; _ClassCastException_instance = NULL; _the_null_string = NULL; _the_min_jint_string = NULL; + + _jvmti_can_hotswap_or_post_breakpoint = false; + _jvmti_can_access_local_variables = false; + _jvmti_can_post_on_exceptions = false; + _jvmti_can_pop_frame = false; } ciEnv::ciEnv(Arena* arena) { ASSERT_IN_VM;
*** 184,193 **** --- 189,203 ---- _ArrayIndexOutOfBoundsException_instance = NULL; _ArrayStoreException_instance = NULL; _ClassCastException_instance = NULL; _the_null_string = NULL; _the_min_jint_string = NULL; + + _jvmti_can_hotswap_or_post_breakpoint = false; + _jvmti_can_access_local_variables = false; + _jvmti_can_post_on_exceptions = false; + _jvmti_can_pop_frame = false; } ciEnv::~ciEnv() { CompilerThread* current_thread = CompilerThread::current(); _factory->remove_symbols();
*** 203,212 **** --- 213,247 ---- // Get Jvmti capabilities under lock to get consistant values. MutexLocker mu(JvmtiThreadState_lock); _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint(); _jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables(); _jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions(); + _jvmti_can_pop_frame = JvmtiExport::can_pop_frame(); + } + + bool ciEnv::should_retain_local_variables() const { + return _jvmti_can_access_local_variables || _jvmti_can_pop_frame; + } + + bool ciEnv::jvmti_state_changed() const { + if (!_jvmti_can_access_local_variables && + JvmtiExport::can_access_local_variables()) { + return true; + } + if (!_jvmti_can_hotswap_or_post_breakpoint && + JvmtiExport::can_hotswap_or_post_breakpoint()) { + return true; + } + if (!_jvmti_can_post_on_exceptions && + JvmtiExport::can_post_on_exceptions()) { + return true; + } + if (!_jvmti_can_pop_frame && + JvmtiExport::can_pop_frame()) { + return true; + } + return false; } // ------------------------------------------------------------------ // Cache DTrace flags void ciEnv::cache_dtrace_flags() {
*** 938,954 **** // No safepoints are allowed. Otherwise, class redefinition can occur in between. MutexLocker ml(Compile_lock); No_Safepoint_Verifier nsv; // Change in Jvmti state may invalidate compilation. ! if (!failing() && ! ( (!jvmti_can_hotswap_or_post_breakpoint() && ! JvmtiExport::can_hotswap_or_post_breakpoint()) || ! (!jvmti_can_access_local_variables() && ! JvmtiExport::can_access_local_variables()) || ! (!jvmti_can_post_on_exceptions() && ! JvmtiExport::can_post_on_exceptions()) )) { record_failure("Jvmti state change invalidated dependencies"); } // Change in DTrace flags may invalidate compilation. if (!failing() && --- 973,983 ---- // No safepoints are allowed. Otherwise, class redefinition can occur in between. MutexLocker ml(Compile_lock); No_Safepoint_Verifier nsv; // Change in Jvmti state may invalidate compilation. ! if (!failing() && jvmti_state_changed()) { record_failure("Jvmti state change invalidated dependencies"); } // Change in DTrace flags may invalidate compilation. if (!failing() &&