src/hotspot/share/interpreter/interpreterRuntime.cpp
changeset 57893 49fea19f0726
parent 57745 789e967c2731
child 58015 dd84de796f2c
equal deleted inserted replaced
57892:fb6cd98e4dec 57893:49fea19f0726
   769     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
   769     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
   770   }
   770   }
   771   Handle h_obj(thread, elem->obj());
   771   Handle h_obj(thread, elem->obj());
   772   assert(Universe::heap()->is_in_reserved_or_null(h_obj()),
   772   assert(Universe::heap()->is_in_reserved_or_null(h_obj()),
   773          "must be NULL or an object");
   773          "must be NULL or an object");
   774   if (UseBiasedLocking) {
   774   ObjectSynchronizer::enter(h_obj, elem->lock(), CHECK);
   775     // Retry fast entry if bias is revoked to avoid unnecessary inflation
       
   776     ObjectSynchronizer::fast_enter(h_obj, elem->lock(), true, CHECK);
       
   777   } else {
       
   778     ObjectSynchronizer::slow_enter(h_obj, elem->lock(), CHECK);
       
   779   }
       
   780   assert(Universe::heap()->is_in_reserved_or_null(elem->obj()),
   775   assert(Universe::heap()->is_in_reserved_or_null(elem->obj()),
   781          "must be NULL or an object");
   776          "must be NULL or an object");
   782 #ifdef ASSERT
   777 #ifdef ASSERT
   783   thread->last_frame().interpreter_frame_verify_monitor(elem);
   778   thread->last_frame().interpreter_frame_verify_monitor(elem);
   784 #endif
   779 #endif
   794   assert(Universe::heap()->is_in_reserved_or_null(h_obj()),
   789   assert(Universe::heap()->is_in_reserved_or_null(h_obj()),
   795          "must be NULL or an object");
   790          "must be NULL or an object");
   796   if (elem == NULL || h_obj()->is_unlocked()) {
   791   if (elem == NULL || h_obj()->is_unlocked()) {
   797     THROW(vmSymbols::java_lang_IllegalMonitorStateException());
   792     THROW(vmSymbols::java_lang_IllegalMonitorStateException());
   798   }
   793   }
   799   ObjectSynchronizer::slow_exit(h_obj(), elem->lock(), thread);
   794   ObjectSynchronizer::exit(h_obj(), elem->lock(), thread);
   800   // Free entry. This must be done here, since a pending exception might be installed on
   795   // Free entry. This must be done here, since a pending exception might be installed on
   801   // exit. If it is not cleared, the exception handling code will try to unlock the monitor again.
   796   // exit. If it is not cleared, the exception handling code will try to unlock the monitor again.
   802   elem->set_obj(NULL);
   797   elem->set_obj(NULL);
   803 #ifdef ASSERT
   798 #ifdef ASSERT
   804   thread->last_frame().interpreter_frame_verify_monitor(elem);
   799   thread->last_frame().interpreter_frame_verify_monitor(elem);