hotspot/src/share/vm/jvmci/jvmciEnv.cpp
changeset 35592 5814f874d736
parent 34317 e93b85bf4cc2
child 36078 954c49c0ba57
equal deleted inserted replaced
35591:35ab7c6816e9 35592:5814f874d736
    46 #include "runtime/sharedRuntime.hpp"
    46 #include "runtime/sharedRuntime.hpp"
    47 #include "utilities/dtrace.hpp"
    47 #include "utilities/dtrace.hpp"
    48 #include "jvmci/jvmciRuntime.hpp"
    48 #include "jvmci/jvmciRuntime.hpp"
    49 #include "jvmci/jvmciJavaClasses.hpp"
    49 #include "jvmci/jvmciJavaClasses.hpp"
    50 
    50 
    51 JVMCIEnv::JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter) {
    51 JVMCIEnv::JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter):
    52   _task = task;
    52   _task(task),
    53   _system_dictionary_modification_counter = system_dictionary_modification_counter;
    53   _system_dictionary_modification_counter(system_dictionary_modification_counter),
    54   {
    54   _failure_reason(NULL),
    55     // Get Jvmti capabilities under lock to get consistent values.
    55   _retryable(true)
    56     MutexLocker mu(JvmtiThreadState_lock);
    56 {
    57     _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint();
    57   // Get Jvmti capabilities under lock to get consistent values.
    58     _jvmti_can_access_local_variables     = JvmtiExport::can_access_local_variables();
    58   MutexLocker mu(JvmtiThreadState_lock);
    59     _jvmti_can_post_on_exceptions         = JvmtiExport::can_post_on_exceptions();
    59   _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint();
    60   }
    60   _jvmti_can_access_local_variables     = JvmtiExport::can_access_local_variables();
       
    61   _jvmti_can_post_on_exceptions         = JvmtiExport::can_post_on_exceptions();
    61 }
    62 }
    62 
    63 
    63 // ------------------------------------------------------------------
    64 // ------------------------------------------------------------------
    64 // Note: the logic of this method should mirror the logic of
    65 // Note: the logic of this method should mirror the logic of
    65 // constantPoolOopDesc::verify_constant_pool_resolve.
    66 // constantPoolOopDesc::verify_constant_pool_resolve.
   532         nm->set_has_wide_vectors(has_wide_vector);
   533         nm->set_has_wide_vectors(has_wide_vector);
   533 
   534 
   534         // Record successful registration.
   535         // Record successful registration.
   535         // (Put nm into the task handle *before* publishing to the Java heap.)
   536         // (Put nm into the task handle *before* publishing to the Java heap.)
   536         CompileTask* task = env == NULL ? NULL : env->task();
   537         CompileTask* task = env == NULL ? NULL : env->task();
   537         if (task != NULL)  task->set_code(nm);
   538         if (task != NULL) {
       
   539           task->set_code(nm);
       
   540         }
   538 
   541 
   539         if (installed_code->is_a(HotSpotNmethod::klass()) && HotSpotNmethod::isDefault(installed_code())) {
   542         if (installed_code->is_a(HotSpotNmethod::klass()) && HotSpotNmethod::isDefault(installed_code())) {
   540           if (entry_bci == InvocationEntryBci) {
   543           if (entry_bci == InvocationEntryBci) {
   541             if (TieredCompilation) {
   544             if (TieredCompilation) {
   542               // If there is an old version we're done with it
   545               // If there is an old version we're done with it