src/hotspot/share/c1/c1_Runtime1.cpp
changeset 57893 49fea19f0726
parent 55590 05dac93510c0
child 58545 725244418646
equal deleted inserted replaced
57892:fb6cd98e4dec 57893:49fea19f0726
   703   NOT_PRODUCT(_monitorenter_slowcase_cnt++;)
   703   NOT_PRODUCT(_monitorenter_slowcase_cnt++;)
   704   if (PrintBiasedLockingStatistics) {
   704   if (PrintBiasedLockingStatistics) {
   705     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
   705     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
   706   }
   706   }
   707   Handle h_obj(thread, obj);
   707   Handle h_obj(thread, obj);
   708   if (UseBiasedLocking) {
   708   if (!UseFastLocking) {
   709     // Retry fast entry if bias is revoked to avoid unnecessary inflation
   709     lock->set_obj(obj);
   710     ObjectSynchronizer::fast_enter(h_obj, lock->lock(), true, CHECK);
   710   }
   711   } else {
   711   assert(obj == lock->obj(), "must match");
   712     if (UseFastLocking) {
   712   ObjectSynchronizer::enter(h_obj, lock->lock(), THREAD);
   713       // When using fast locking, the compiled code has already tried the fast case
       
   714       assert(obj == lock->obj(), "must match");
       
   715       ObjectSynchronizer::slow_enter(h_obj, lock->lock(), THREAD);
       
   716     } else {
       
   717       lock->set_obj(obj);
       
   718       ObjectSynchronizer::fast_enter(h_obj, lock->lock(), false, THREAD);
       
   719     }
       
   720   }
       
   721 JRT_END
   713 JRT_END
   722 
   714 
   723 
   715 
   724 JRT_LEAF(void, Runtime1::monitorexit(JavaThread* thread, BasicObjectLock* lock))
   716 JRT_LEAF(void, Runtime1::monitorexit(JavaThread* thread, BasicObjectLock* lock))
   725   NOT_PRODUCT(_monitorexit_slowcase_cnt++;)
   717   NOT_PRODUCT(_monitorexit_slowcase_cnt++;)
   728   // monitorexit is non-blocking (leaf routine) => no exceptions can be thrown
   720   // monitorexit is non-blocking (leaf routine) => no exceptions can be thrown
   729   EXCEPTION_MARK;
   721   EXCEPTION_MARK;
   730 
   722 
   731   oop obj = lock->obj();
   723   oop obj = lock->obj();
   732   assert(oopDesc::is_oop(obj), "must be NULL or an object");
   724   assert(oopDesc::is_oop(obj), "must be NULL or an object");
   733   if (UseFastLocking) {
   725   ObjectSynchronizer::exit(obj, lock->lock(), THREAD);
   734     // When using fast locking, the compiled code has already tried the fast case
       
   735     ObjectSynchronizer::slow_exit(obj, lock->lock(), THREAD);
       
   736   } else {
       
   737     ObjectSynchronizer::fast_exit(obj, lock->lock(), THREAD);
       
   738   }
       
   739 JRT_END
   726 JRT_END
   740 
   727 
   741 // Cf. OptoRuntime::deoptimize_caller_frame
   728 // Cf. OptoRuntime::deoptimize_caller_frame
   742 JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread, jint trap_request))
   729 JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread, jint trap_request))
   743   // Called from within the owner thread, so no need for safepoint
   730   // Called from within the owner thread, so no need for safepoint