< prev index next >

src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp

Print this page
@@ -66,29 +66,34 @@
  
  int C2HandleAnonOMOwnerStub::max_size() const {
    // Max size of stub has been determined by testing with 0, in which case
    // C2CodeStubList::emit() will throw an assertion and report the actual size that
    // is needed.
-   return 24;
+   return 52;
  }
  
  void C2HandleAnonOMOwnerStub::emit(C2_MacroAssembler& masm) {
    __ bind(entry());
    Register mon = monitor();
    Register t = tmp();
    assert(t != noreg, "need tmp register");
  
    // Fix owner to be the current thread.
-   __ str(rthread, Address(mon, ObjectMonitor::owner_offset()));
- 
-   // Pop owner object from lock-stack.
-   __ ldrw(t, Address(rthread, JavaThread::lock_stack_top_offset()));
-   __ subw(t, t, oopSize);
- #ifdef ASSERT
-   __ str(zr, Address(rthread, t));
- #endif
-   __ strw(t, Address(rthread, JavaThread::lock_stack_top_offset()));
+   __ ldr(t, Address(rthread, JavaThread::lock_id_offset()));
+   __ str(t, Address(mon, ObjectMonitor::owner_offset()));
  
+   if (LockingMode == LM_LIGHTWEIGHT) {
+     // Pop owner object from lock-stack.
+     __ ldrw(t, Address(rthread, JavaThread::lock_stack_top_offset()));
+     __ subw(t, t, oopSize);
+   #ifdef ASSERT
+     __ str(zr, Address(rthread, t));
+   #endif
+     __ strw(t, Address(rthread, JavaThread::lock_stack_top_offset()));
+   } else {
+     __ str(zr, Address(mon, ObjectMonitor::stack_locker_offset()));
+     __ dec_held_monitor_count();
+   }
    __ b(continuation());
  }
  
  #undef __
< prev index next >