< prev index next >

src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp

Print this page
@@ -76,89 +76,10 @@
  
  void C1_MacroAssembler::verified_entry(bool breakAtEntry) {
    if (breakAtEntry) z_illtrap(0xC1);
  }
  
- void C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Label& slow_case) {
-   const int hdr_offset = oopDesc::mark_offset_in_bytes();
-   assert_different_registers(hdr, obj, disp_hdr);
-   NearLabel done;
- 
-   verify_oop(obj, FILE_AND_LINE);
- 
-   // Load object header.
-   z_lg(hdr, Address(obj, hdr_offset));
- 
-   // Save object being locked into the BasicObjectLock...
-   z_stg(obj, Address(disp_hdr, BasicObjectLock::obj_offset_in_bytes()));
- 
-   if (DiagnoseSyncOnValueBasedClasses != 0) {
-     load_klass(Z_R1_scratch, obj);
-     testbit(Address(Z_R1_scratch, Klass::access_flags_offset()), exact_log2(JVM_ACC_IS_VALUE_BASED_CLASS));
-     z_btrue(slow_case);
-   }
- 
-   // and mark it as unlocked.
-   z_oill(hdr, markWord::unlocked_value);
-   // Save unlocked object header into the displaced header location on the stack.
-   z_stg(hdr, Address(disp_hdr, (intptr_t)0));
-   // Test if object header is still the same (i.e. unlocked), and if so, store the
-   // displaced header address in the object header. If it is not the same, get the
-   // object header instead.
-   z_csg(hdr, disp_hdr, hdr_offset, obj);
-   // If the object header was the same, we're done.
-   branch_optimized(Assembler::bcondEqual, done);
-   // If the object header was not the same, it is now in the hdr register.
-   // => Test if it is a stack pointer into the same stack (recursive locking), i.e.:
-   //
-   // 1) (hdr & markWord::lock_mask_in_place) == 0
-   // 2) rsp <= hdr
-   // 3) hdr <= rsp + page_size
-   //
-   // These 3 tests can be done by evaluating the following expression:
-   //
-   // (hdr - Z_SP) & (~(page_size-1) | markWord::lock_mask_in_place)
-   //
-   // assuming both the stack pointer and page_size have their least
-   // significant 2 bits cleared and page_size is a power of 2
-   z_sgr(hdr, Z_SP);
- 
-   load_const_optimized(Z_R0_scratch, (~(os::vm_page_size()-1) | markWord::lock_mask_in_place));
-   z_ngr(hdr, Z_R0_scratch); // AND sets CC (result eq/ne 0).
-   // For recursive locking, the result is zero. => Save it in the displaced header
-   // location (NULL in the displaced hdr location indicates recursive locking).
-   z_stg(hdr, Address(disp_hdr, (intptr_t)0));
-   // Otherwise we don't care about the result and handle locking via runtime call.
-   branch_optimized(Assembler::bcondNotZero, slow_case);
-   // done
-   bind(done);
- }
- 
- void C1_MacroAssembler::unlock_object(Register hdr, Register obj, Register disp_hdr, Label& slow_case) {
-   const int aligned_mask = BytesPerWord -1;
-   const int hdr_offset = oopDesc::mark_offset_in_bytes();
-   assert_different_registers(hdr, obj, disp_hdr);
-   NearLabel done;
- 
-   // Load displaced header.
-   z_ltg(hdr, Address(disp_hdr, (intptr_t)0));
-   // If the loaded hdr is NULL we had recursive locking, and we are done.
-   z_bre(done);
-   // Load object.
-   z_lg(obj, Address(disp_hdr, BasicObjectLock::obj_offset_in_bytes()));
-   verify_oop(obj, FILE_AND_LINE);
-   // Test if object header is pointing to the displaced header, and if so, restore
-   // the displaced header in the object. If the object header is not pointing to
-   // the displaced header, get the object header instead.
-   z_csg(disp_hdr, hdr, hdr_offset, obj);
-   // If the object header was not pointing to the displaced header,
-   // we do unlocking via runtime call.
-   branch_optimized(Assembler::bcondNotEqual, slow_case);
-   // done
-   bind(done);
- }
- 
  void C1_MacroAssembler::try_allocate(
    Register obj,                        // result: Pointer to object after successful allocation.
    Register var_size_in_bytes,          // Object size in bytes if unknown at compile time; invalid otherwise.
    int      con_size_in_bytes,          // Object size in bytes if   known at compile time.
    Register t1,                         // Temp register: Must be global register for incr_allocated_bytes.
< prev index next >