< prev index next >

src/hotspot/cpu/aarch64/aarch64.ad

Print this page
rev 51633 : imported patch 8210381

@@ -3376,30 +3376,22 @@
     assert_different_registers(oop, box, tmp, disp_hdr);
 
     // Load markOop from object into displaced_header.
     __ ldr(disp_hdr, Address(oop, oopDesc::mark_offset_in_bytes()));
 
-    // Always do locking in runtime.
-    if (EmitSync & 0x01) {
-      __ cmp(oop, zr);
-      return;
-    }
-
     if (UseBiasedLocking && !UseOptoBiasInlining) {
       __ biased_locking_enter(box, oop, disp_hdr, tmp, true, cont);
     }
 
     // Handle existing monitor
-    if ((EmitSync & 0x02) == 0) {
       // we can use AArch64's bit test and branch here but
       // markoopDesc does not define a bit index just the bit value
       // so assert in case the bit pos changes
 #     define __monitor_value_log2 1
       assert(markOopDesc::monitor_value == (1 << __monitor_value_log2), "incorrect bit position");
       __ tbnz(disp_hdr, __monitor_value_log2, object_has_monitor);
 #     undef __monitor_value_log2
-    }
 
     // Set displaced_header to be (markOop of object | UNLOCK_VALUE).
     __ orr(disp_hdr, disp_hdr, markOopDesc::unlocked_value);
 
     // Load Compare Value application register.

@@ -3453,11 +3445,10 @@
     // displaced header in the box, which indicates that it is a recursive lock.
     __ ands(tmp/*==0?*/, disp_hdr, tmp);
     __ str(tmp/*==0, perhaps*/, Address(box, BasicLock::displaced_header_offset_in_bytes()));
 
     // Handle existing monitor.
-    if ((EmitSync & 0x02) == 0) {
       __ b(cont);
 
       __ bind(object_has_monitor);
       // The object's monitor m is unlocked iff m->owner == NULL,
       // otherwise m->owner may contain a thread or a stack address.

@@ -3470,12 +3461,13 @@
         __ mov(rscratch1, disp_hdr);
         __ casal(Assembler::xword, rscratch1, rthread, tmp);
         __ cmp(rscratch1, disp_hdr);
       } else {
         Label retry_load, fail;
-        if ((VM_Version::features() & VM_Version::CPU_STXR_PREFETCH))
+      if ((VM_Version::features() & VM_Version::CPU_STXR_PREFETCH)) {
           __ prfm(Address(tmp), PSTL1STRM);
+      }
         __ bind(retry_load);
         __ ldaxr(rscratch1, tmp);
         __ cmp(disp_hdr, rscratch1);
         __ br(Assembler::NE, fail);
         // use stlxr to ensure update is immediately visible

@@ -3508,11 +3500,10 @@
       // Invariant 2: OwnerIsThread shouldn't be 0.
       // assert(ObjectMonitor::OwnerIsThread_size_in_bytes() == 4, "unexpected size");
       //assert_mem4_isnot_zero(ObjectMonitor::OwnerIsThread_offset_in_bytes(), tmp,
       //                           "monitor->OwnerIsThread shouldn't be 0", -1);
       // #endif
-    }
 
     __ bind(cont);
     // flag == EQ indicates success
     // flag == NE indicates failure
 

@@ -3531,16 +3522,10 @@
     Label object_has_monitor;
     Label cas_failed;
 
     assert_different_registers(oop, box, tmp, disp_hdr);
 
-    // Always do locking in runtime.
-    if (EmitSync & 0x01) {
-      __ cmp(oop, zr); // Oop can't be 0 here => always false.
-      return;
-    }
-
     if (UseBiasedLocking && !UseOptoBiasInlining) {
       __ biased_locking_exit(oop, tmp, cont);
     }
 
     // Find the lock address and load the displaced header from the stack.

@@ -3550,14 +3535,12 @@
     __ cmp(disp_hdr, zr);
     __ br(Assembler::EQ, cont);
 
 
     // Handle existing monitor.
-    if ((EmitSync & 0x02) == 0) {
       __ ldr(tmp, Address(oop, oopDesc::mark_offset_in_bytes()));
       __ tbnz(disp_hdr, exact_log2(markOopDesc::monitor_value), object_has_monitor);
-    }
 
     // Check if it is still a light weight lock, this is is true if we
     // see the stack address of the basicLock in the markOop of the
     // object.
 

@@ -3588,11 +3571,10 @@
     assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0");
 
     __ bind(cas_failed);
 
     // Handle existing monitor.
-    if ((EmitSync & 0x02) == 0) {
       __ b(cont);
 
       __ bind(object_has_monitor);
       __ add(tmp, tmp, -markOopDesc::monitor_value); // monitor
       __ ldr(rscratch1, Address(tmp, ObjectMonitor::owner_offset_in_bytes()));

@@ -3608,11 +3590,10 @@
       __ cmp(rscratch1, zr);
       __ cbnz(rscratch1, cont);
       // need a release store here
       __ lea(tmp, Address(tmp, ObjectMonitor::owner_offset_in_bytes()));
       __ stlr(rscratch1, tmp); // rscratch1 is zero
-    }
 
     __ bind(cont);
     // flag == EQ indicates success
     // flag == NE indicates failure
   %}
< prev index next >