src/hotspot/share/ci/ciEnv.cpp
changeset 53469 1d953ae4d39f
parent 53345 91ab128a65a3
child 53582 881c5fbeb849
equal deleted inserted replaced
53468:d927fc999582 53469:1d953ae4d39f
   913 // ciEnv::is_in_vm
   913 // ciEnv::is_in_vm
   914 bool ciEnv::is_in_vm() {
   914 bool ciEnv::is_in_vm() {
   915   return JavaThread::current()->thread_state() == _thread_in_vm;
   915   return JavaThread::current()->thread_state() == _thread_in_vm;
   916 }
   916 }
   917 
   917 
       
   918 bool ciEnv::system_dictionary_modification_counter_changed_locked() {
       
   919   assert_locked_or_safepoint(Compile_lock);
       
   920   return _system_dictionary_modification_counter != SystemDictionary::number_of_modifications();
       
   921 }
       
   922 
   918 bool ciEnv::system_dictionary_modification_counter_changed() {
   923 bool ciEnv::system_dictionary_modification_counter_changed() {
   919   return _system_dictionary_modification_counter != SystemDictionary::number_of_modifications();
   924   VM_ENTRY_MARK;
       
   925   MutexLocker ml(Compile_lock, THREAD); // lock with safepoint check
       
   926   return system_dictionary_modification_counter_changed_locked();
   920 }
   927 }
   921 
   928 
   922 // ------------------------------------------------------------------
   929 // ------------------------------------------------------------------
   923 // ciEnv::validate_compile_task_dependencies
   930 // ciEnv::validate_compile_task_dependencies
   924 //
   931 //
   925 // Check for changes during compilation (e.g. class loads, evolution,
   932 // Check for changes during compilation (e.g. class loads, evolution,
   926 // breakpoints, call site invalidation).
   933 // breakpoints, call site invalidation).
   927 void ciEnv::validate_compile_task_dependencies(ciMethod* target) {
   934 void ciEnv::validate_compile_task_dependencies(ciMethod* target) {
   928   if (failing())  return;  // no need for further checks
   935   if (failing())  return;  // no need for further checks
   929 
   936 
   930   bool counter_changed = system_dictionary_modification_counter_changed();
   937   bool counter_changed = system_dictionary_modification_counter_changed_locked();
   931   Dependencies::DepType result = dependencies()->validate_dependencies(_task, counter_changed);
   938   Dependencies::DepType result = dependencies()->validate_dependencies(_task, counter_changed);
   932   if (result != Dependencies::end_marker) {
   939   if (result != Dependencies::end_marker) {
   933     if (result == Dependencies::call_site_target_value) {
   940     if (result == Dependencies::call_site_target_value) {
   934       _inc_decompile_count_on_failure = false;
   941       _inc_decompile_count_on_failure = false;
   935       record_failure("call site target change");
   942       record_failure("call site target change");