src/hotspot/share/ci/ciEnv.cpp
changeset 58358 d658f4379c63
parent 58226 408c445d04e8
child 58512 5185bc8dcbb1
equal deleted inserted replaced
58356:feff88c68082 58358:d658f4379c63
   152   _ArrayStoreException_instance = NULL;
   152   _ArrayStoreException_instance = NULL;
   153   _ClassCastException_instance = NULL;
   153   _ClassCastException_instance = NULL;
   154   _the_null_string = NULL;
   154   _the_null_string = NULL;
   155   _the_min_jint_string = NULL;
   155   _the_min_jint_string = NULL;
   156 
   156 
       
   157   _jvmti_redefinition_count = 0;
   157   _jvmti_can_hotswap_or_post_breakpoint = false;
   158   _jvmti_can_hotswap_or_post_breakpoint = false;
   158   _jvmti_can_access_local_variables = false;
   159   _jvmti_can_access_local_variables = false;
   159   _jvmti_can_post_on_exceptions = false;
   160   _jvmti_can_post_on_exceptions = false;
   160   _jvmti_can_pop_frame = false;
   161   _jvmti_can_pop_frame = false;
   161 }
   162 }
   207   _ArrayStoreException_instance = NULL;
   208   _ArrayStoreException_instance = NULL;
   208   _ClassCastException_instance = NULL;
   209   _ClassCastException_instance = NULL;
   209   _the_null_string = NULL;
   210   _the_null_string = NULL;
   210   _the_min_jint_string = NULL;
   211   _the_min_jint_string = NULL;
   211 
   212 
       
   213   _jvmti_redefinition_count = 0;
   212   _jvmti_can_hotswap_or_post_breakpoint = false;
   214   _jvmti_can_hotswap_or_post_breakpoint = false;
   213   _jvmti_can_access_local_variables = false;
   215   _jvmti_can_access_local_variables = false;
   214   _jvmti_can_post_on_exceptions = false;
   216   _jvmti_can_post_on_exceptions = false;
   215   _jvmti_can_pop_frame = false;
   217   _jvmti_can_pop_frame = false;
   216 }
   218 }
   229 // Cache Jvmti state
   231 // Cache Jvmti state
   230 void ciEnv::cache_jvmti_state() {
   232 void ciEnv::cache_jvmti_state() {
   231   VM_ENTRY_MARK;
   233   VM_ENTRY_MARK;
   232   // Get Jvmti capabilities under lock to get consistant values.
   234   // Get Jvmti capabilities under lock to get consistant values.
   233   MutexLocker mu(JvmtiThreadState_lock);
   235   MutexLocker mu(JvmtiThreadState_lock);
       
   236   _jvmti_redefinition_count             = JvmtiExport::redefinition_count();
   234   _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint();
   237   _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint();
   235   _jvmti_can_access_local_variables     = JvmtiExport::can_access_local_variables();
   238   _jvmti_can_access_local_variables     = JvmtiExport::can_access_local_variables();
   236   _jvmti_can_post_on_exceptions         = JvmtiExport::can_post_on_exceptions();
   239   _jvmti_can_post_on_exceptions         = JvmtiExport::can_post_on_exceptions();
   237   _jvmti_can_pop_frame                  = JvmtiExport::can_pop_frame();
   240   _jvmti_can_pop_frame                  = JvmtiExport::can_pop_frame();
   238 }
   241 }
   239 
   242 
   240 bool ciEnv::jvmti_state_changed() const {
   243 bool ciEnv::jvmti_state_changed() const {
       
   244   // Some classes were redefined
       
   245   if (_jvmti_redefinition_count != JvmtiExport::redefinition_count()) {
       
   246     return true;
       
   247   }
       
   248 
   241   if (!_jvmti_can_access_local_variables &&
   249   if (!_jvmti_can_access_local_variables &&
   242       JvmtiExport::can_access_local_variables()) {
   250       JvmtiExport::can_access_local_variables()) {
   243     return true;
   251     return true;
   244   }
   252   }
   245   if (!_jvmti_can_hotswap_or_post_breakpoint &&
   253   if (!_jvmti_can_hotswap_or_post_breakpoint &&
   252   }
   260   }
   253   if (!_jvmti_can_pop_frame &&
   261   if (!_jvmti_can_pop_frame &&
   254       JvmtiExport::can_pop_frame()) {
   262       JvmtiExport::can_pop_frame()) {
   255     return true;
   263     return true;
   256   }
   264   }
       
   265 
   257   return false;
   266   return false;
   258 }
   267 }
   259 
   268 
   260 // ------------------------------------------------------------------
   269 // ------------------------------------------------------------------
   261 // Cache DTrace flags
   270 // Cache DTrace flags