< prev index next >

src/hotspot/share/c1/c1_Runtime1.cpp

Print this page

        

@@ -292,16 +292,10 @@
 const char* Runtime1::name_for_address(address entry) {
   for (int id = 0; id < number_of_ids; id++) {
     if (entry == entry_for((StubID)id)) return name_for((StubID)id);
   }
 
-  BarrierSetC1* bsc1 = BarrierSet::barrier_set()->barrier_set_c1();
-  const char* name = bsc1->rtcall_name_for_address(entry);
-  if (name != NULL) {
-    return name;
-  }
-
 #define FUNCTION_CASE(a, f) \
   if ((intptr_t)a == CAST_FROM_FN_PTR(intptr_t, f))  return #f
 
   FUNCTION_CASE(entry, os::javaTimeMillis);
   FUNCTION_CASE(entry, os::javaTimeNanos);

@@ -703,15 +697,23 @@
   NOT_PRODUCT(_monitorenter_slowcase_cnt++;)
   if (PrintBiasedLockingStatistics) {
     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
   }
   Handle h_obj(thread, obj);
-  if (!UseFastLocking) {
-    lock->set_obj(obj);
+  if (UseBiasedLocking) {
+    // Retry fast entry if bias is revoked to avoid unnecessary inflation
+    ObjectSynchronizer::fast_enter(h_obj, lock->lock(), true, CHECK);
+  } else {
+    if (UseFastLocking) {
+      // When using fast locking, the compiled code has already tried the fast case
+      assert(obj == lock->obj(), "must match");
+      ObjectSynchronizer::slow_enter(h_obj, lock->lock(), THREAD);
+    } else {
+      lock->set_obj(obj);
+      ObjectSynchronizer::fast_enter(h_obj, lock->lock(), false, THREAD);
+    }
   }
-  assert(obj == lock->obj(), "must match");
-  ObjectSynchronizer::enter(h_obj, lock->lock(), THREAD);
 JRT_END
 
 
 JRT_LEAF(void, Runtime1::monitorexit(JavaThread* thread, BasicObjectLock* lock))
   NOT_PRODUCT(_monitorexit_slowcase_cnt++;)

@@ -720,11 +722,16 @@
   // monitorexit is non-blocking (leaf routine) => no exceptions can be thrown
   EXCEPTION_MARK;
 
   oop obj = lock->obj();
   assert(oopDesc::is_oop(obj), "must be NULL or an object");
-  ObjectSynchronizer::exit(obj, lock->lock(), THREAD);
+  if (UseFastLocking) {
+    // When using fast locking, the compiled code has already tried the fast case
+    ObjectSynchronizer::slow_exit(obj, lock->lock(), THREAD);
+  } else {
+    ObjectSynchronizer::fast_exit(obj, lock->lock(), THREAD);
+  }
 JRT_END
 
 // Cf. OptoRuntime::deoptimize_caller_frame
 JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread, jint trap_request))
   // Called from within the owner thread, so no need for safepoint
< prev index next >