< prev index next >

src/hotspot/share/ci/ciEnv.cpp

Print this page
rev 56101 : 8227745: Enable Escape Analysis for better performance when debugging
Reviewed-by: ???


 218 ciEnv::~ciEnv() {
 219   GUARDED_VM_ENTRY(
 220       CompilerThread* current_thread = CompilerThread::current();
 221       _factory->remove_symbols();
 222       // Need safepoint to clear the env on the thread.  RedefineClasses might
 223       // be reading it.
 224       current_thread->set_env(NULL);
 225   )
 226 }
 227 
 228 // ------------------------------------------------------------------
 229 // Cache Jvmti state
 230 void ciEnv::cache_jvmti_state() {
 231   VM_ENTRY_MARK;
 232   // Get Jvmti capabilities under lock to get consistant values.
 233   MutexLocker mu(JvmtiThreadState_lock);
 234   _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint();
 235   _jvmti_can_access_local_variables     = JvmtiExport::can_access_local_variables();
 236   _jvmti_can_post_on_exceptions         = JvmtiExport::can_post_on_exceptions();
 237   _jvmti_can_pop_frame                  = JvmtiExport::can_pop_frame();


 238 }
 239 
 240 bool ciEnv::jvmti_state_changed() const {
 241   if (!_jvmti_can_access_local_variables &&
 242       JvmtiExport::can_access_local_variables()) {
 243     return true;
 244   }
 245   if (!_jvmti_can_hotswap_or_post_breakpoint &&
 246       JvmtiExport::can_hotswap_or_post_breakpoint()) {
 247     return true;
 248   }
 249   if (!_jvmti_can_post_on_exceptions &&
 250       JvmtiExport::can_post_on_exceptions()) {
 251     return true;
 252   }
 253   if (!_jvmti_can_pop_frame &&
 254       JvmtiExport::can_pop_frame()) {








 255     return true;
 256   }
 257   return false;
 258 }
 259 
 260 // ------------------------------------------------------------------
 261 // Cache DTrace flags
 262 void ciEnv::cache_dtrace_flags() {
 263   // Need lock?
 264   _dtrace_extended_probes = ExtendedDTraceProbes;
 265   if (_dtrace_extended_probes) {
 266     _dtrace_monitor_probes  = true;
 267     _dtrace_method_probes   = true;
 268     _dtrace_alloc_probes    = true;
 269   } else {
 270     _dtrace_monitor_probes  = DTraceMonitorProbes;
 271     _dtrace_method_probes   = DTraceMethodProbes;
 272     _dtrace_alloc_probes    = DTraceAllocProbes;
 273   }
 274 }




 218 ciEnv::~ciEnv() {
 219   GUARDED_VM_ENTRY(
 220       CompilerThread* current_thread = CompilerThread::current();
 221       _factory->remove_symbols();
 222       // Need safepoint to clear the env on the thread.  RedefineClasses might
 223       // be reading it.
 224       current_thread->set_env(NULL);
 225   )
 226 }
 227 
 228 // ------------------------------------------------------------------
 229 // Cache Jvmti state
 230 void ciEnv::cache_jvmti_state() {
 231   VM_ENTRY_MARK;
 232   // Get Jvmti capabilities under lock to get consistant values.
 233   MutexLocker mu(JvmtiThreadState_lock);
 234   _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint();
 235   _jvmti_can_access_local_variables     = JvmtiExport::can_access_local_variables();
 236   _jvmti_can_post_on_exceptions         = JvmtiExport::can_post_on_exceptions();
 237   _jvmti_can_pop_frame                  = JvmtiExport::can_pop_frame();
 238   _jvmti_can_get_owned_monitor_info     = JvmtiExport::can_get_owned_monitor_info();
 239   _jvmti_can_walk_any_space             = JvmtiExport::can_walk_any_space();
 240 }
 241 
 242 bool ciEnv::jvmti_state_changed() const {
 243   if (!_jvmti_can_access_local_variables &&
 244       JvmtiExport::can_access_local_variables()) {
 245     return true;
 246   }
 247   if (!_jvmti_can_hotswap_or_post_breakpoint &&
 248       JvmtiExport::can_hotswap_or_post_breakpoint()) {
 249     return true;
 250   }
 251   if (!_jvmti_can_post_on_exceptions &&
 252       JvmtiExport::can_post_on_exceptions()) {
 253     return true;
 254   }
 255   if (!_jvmti_can_pop_frame &&
 256       JvmtiExport::can_pop_frame()) {
 257     return true;
 258   }
 259   if (!_jvmti_can_get_owned_monitor_info &&
 260       JvmtiExport::can_get_owned_monitor_info()) {
 261     return true;
 262   }
 263   if (!_jvmti_can_walk_any_space &&
 264       JvmtiExport::can_walk_any_space()) {
 265     return true;
 266   }
 267   return false;
 268 }
 269 
 270 // ------------------------------------------------------------------
 271 // Cache DTrace flags
 272 void ciEnv::cache_dtrace_flags() {
 273   // Need lock?
 274   _dtrace_extended_probes = ExtendedDTraceProbes;
 275   if (_dtrace_extended_probes) {
 276     _dtrace_monitor_probes  = true;
 277     _dtrace_method_probes   = true;
 278     _dtrace_alloc_probes    = true;
 279   } else {
 280     _dtrace_monitor_probes  = DTraceMonitorProbes;
 281     _dtrace_method_probes   = DTraceMethodProbes;
 282     _dtrace_alloc_probes    = DTraceAllocProbes;
 283   }
 284 }


< prev index next >