< prev index next >

src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp

Print this page
@@ -155,14 +155,13 @@
    initialize_object(obj, obj_end, klass, len, tmp2, tmp3, instanceOopDesc::header_size() * HeapWordSize, object_size_in_bytes, /* is_tlab_allocated */ UseTLAB);
  }
  
  void C1_MacroAssembler::allocate_array(Register obj, Register len,
                                         Register tmp1, Register tmp2, Register tmp3,
-                                        int header_size, int element_size,
+                                        int header_size_in_bytes, int element_size,
                                         Register klass, Label& slow_case) {
    assert_different_registers(obj, len, tmp1, tmp2, tmp3, klass, Rtemp);
-   const int header_size_in_bytes = header_size * BytesPerWord;
    const int scale_shift = exact_log2(element_size);
    const Register obj_size = Rtemp; // Rtemp should be free at c1 LIR level
  
    cmp_32(len, max_array_allocation_length);
    b(slow_case, hs);

@@ -180,98 +179,10 @@
  
    try_allocate(obj, tmp1, tmp2, tmp3, obj_size, slow_case);
    initialize_object(obj, tmp1, klass, len, tmp2, tmp3, header_size_in_bytes, -1, /* is_tlab_allocated */ UseTLAB);
  }
  
- int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Label& slow_case) {
-   Label done, fast_lock, fast_lock_done;
-   int null_check_offset = 0;
- 
-   const Register tmp2 = Rtemp; // Rtemp should be free at c1 LIR level
-   assert_different_registers(hdr, obj, disp_hdr, tmp2);
- 
-   assert(BasicObjectLock::lock_offset_in_bytes() == 0, "adjust this code");
-   const int obj_offset = BasicObjectLock::obj_offset_in_bytes();
-   const int mark_offset = BasicLock::displaced_header_offset_in_bytes();
- 
-   str(obj, Address(disp_hdr, obj_offset));
- 
-   null_check_offset = offset();
- 
-   if (DiagnoseSyncOnValueBasedClasses != 0) {
-     load_klass(tmp2, obj);
-     ldr_u32(tmp2, Address(tmp2, Klass::access_flags_offset()));
-     tst(tmp2, JVM_ACC_IS_VALUE_BASED_CLASS);
-     b(slow_case, ne);
-   }
- 
-   assert(oopDesc::mark_offset_in_bytes() == 0, "Required by atomic instructions");
- 
-   // On MP platforms the next load could return a 'stale' value if the memory location has been modified by another thread.
-   // That would be acceptable as ether CAS or slow case path is taken in that case.
- 
-   // Must be the first instruction here, because implicit null check relies on it
-   ldr(hdr, Address(obj, oopDesc::mark_offset_in_bytes()));
- 
-   tst(hdr, markWord::unlocked_value);
-   b(fast_lock, ne);
- 
-   // Check for recursive locking
-   // See comments in InterpreterMacroAssembler::lock_object for
-   // explanations on the fast recursive locking check.
-   // -1- test low 2 bits
-   movs(tmp2, AsmOperand(hdr, lsl, 30));
-   // -2- test (hdr - SP) if the low two bits are 0
-   sub(tmp2, hdr, SP, eq);
-   movs(tmp2, AsmOperand(tmp2, lsr, exact_log2(os::vm_page_size())), eq);
-   // If still 'eq' then recursive locking OK
-   // set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8267042)
-   str(tmp2, Address(disp_hdr, mark_offset));
-   b(fast_lock_done, eq);
-   // else need slow case
-   b(slow_case);
- 
- 
-   bind(fast_lock);
-   // Save previous object header in BasicLock structure and update the header
-   str(hdr, Address(disp_hdr, mark_offset));
- 
-   cas_for_lock_acquire(hdr, disp_hdr, obj, tmp2, slow_case);
- 
-   bind(fast_lock_done);
-   bind(done);
- 
-   return null_check_offset;
- }
- 
- void C1_MacroAssembler::unlock_object(Register hdr, Register obj, Register disp_hdr, Label& slow_case) {
-   assert_different_registers(hdr, obj, disp_hdr, Rtemp);
-   Register tmp2 = Rtemp;
- 
-   assert(BasicObjectLock::lock_offset_in_bytes() == 0, "adjust this code");
-   const int obj_offset = BasicObjectLock::obj_offset_in_bytes();
-   const int mark_offset = BasicLock::displaced_header_offset_in_bytes();
- 
-   Label done;
- 
-   assert(oopDesc::mark_offset_in_bytes() == 0, "Required by atomic instructions");
- 
-   // Load displaced header and object from the lock
-   ldr(hdr, Address(disp_hdr, mark_offset));
-   // If hdr is NULL, we've got recursive locking and there's nothing more to do
-   cbz(hdr, done);
- 
-   // load object
-   ldr(obj, Address(disp_hdr, obj_offset));
- 
-   // Restore the object header
-   cas_for_lock_release(disp_hdr, hdr, obj, tmp2, slow_case);
- 
-   bind(done);
- }
- 
- 
  #ifndef PRODUCT
  
  void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
    if (!VerifyOops) return;
    verify_oop_addr(Address(SP, stack_offset));
< prev index next >