< prev index next >

src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp

Print this page
*** 90,107 ***
  void C1_MacroAssembler::verified_entry(bool breakAtEntry) {
    if (breakAtEntry) illtrap();
    // build frame
  }
  
- 
- void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox, Register Rscratch, Label& slow_case) {
-   assert_different_registers(Rmark, Roop, Rbox, Rscratch);
- 
-   Label done, cas_failed, slow_int;
- 
-   // The following move must be the first instruction of emitted since debug
-   // information may be generated for it.
-   // Load object header.
-   ld(Rmark, oopDesc::mark_offset_in_bytes(), Roop);
- 
-   verify_oop(Roop, FILE_AND_LINE);
- 
-   // Save object being locked into the BasicObjectLock...
-   std(Roop, BasicObjectLock::obj_offset_in_bytes(), Rbox);
- 
-   if (DiagnoseSyncOnValueBasedClasses != 0) {
-     load_klass(Rscratch, Roop);
-     lwz(Rscratch, in_bytes(Klass::access_flags_offset()), Rscratch);
-     testbitdi(CCR0, R0, Rscratch, exact_log2(JVM_ACC_IS_VALUE_BASED_CLASS));
-     bne(CCR0, slow_int);
-   }
- 
-   // ... and mark it unlocked.
-   ori(Rmark, Rmark, markWord::unlocked_value);
- 
-   // Save unlocked object header into the displaced header location on the stack.
-   std(Rmark, BasicLock::displaced_header_offset_in_bytes(), Rbox);
- 
-   // Compare object markWord with Rmark and if equal exchange Rscratch with object markWord.
-   assert(oopDesc::mark_offset_in_bytes() == 0, "cas must take a zero displacement");
-   cmpxchgd(/*flag=*/CCR0,
-            /*current_value=*/Rscratch,
-            /*compare_value=*/Rmark,
-            /*exchange_value=*/Rbox,
-            /*where=*/Roop/*+0==mark_offset_in_bytes*/,
-            MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq,
-            MacroAssembler::cmpxchgx_hint_acquire_lock(),
-            noreg,
-            &cas_failed,
-            /*check without membar and ldarx first*/true);
-   // If compare/exchange succeeded we found an unlocked object and we now have locked it
-   // hence we are done.
-   b(done);
- 
-   bind(slow_int);
-   b(slow_case); // far
- 
-   bind(cas_failed);
-   // We did not find an unlocked object so see if this is a recursive case.
-   sub(Rscratch, Rscratch, R1_SP);
-   load_const_optimized(R0, (~(os::vm_page_size()-1) | markWord::lock_mask_in_place));
-   and_(R0/*==0?*/, Rscratch, R0);
-   std(R0/*==0, perhaps*/, BasicLock::displaced_header_offset_in_bytes(), Rbox);
-   bne(CCR0, slow_int);
- 
-   bind(done);
- }
- 
- 
- void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rbox, Label& slow_case) {
-   assert_different_registers(Rmark, Roop, Rbox);
- 
-   Label slow_int, done;
- 
-   Address mark_addr(Roop, oopDesc::mark_offset_in_bytes());
-   assert(mark_addr.disp() == 0, "cas must take a zero displacement");
- 
-   // Test first it it is a fast recursive unlock.
-   ld(Rmark, BasicLock::displaced_header_offset_in_bytes(), Rbox);
-   cmpdi(CCR0, Rmark, 0);
-   beq(CCR0, done);
- 
-   // Load object.
-   ld(Roop, BasicObjectLock::obj_offset_in_bytes(), Rbox);
-   verify_oop(Roop, FILE_AND_LINE);
- 
-   // Check if it is still a light weight lock, this is is true if we see
-   // the stack address of the basicLock in the markWord of the object.
-   cmpxchgd(/*flag=*/CCR0,
-            /*current_value=*/R0,
-            /*compare_value=*/Rbox,
-            /*exchange_value=*/Rmark,
-            /*where=*/Roop,
-            MacroAssembler::MemBarRel,
-            MacroAssembler::cmpxchgx_hint_release_lock(),
-            noreg,
-            &slow_int);
-   b(done);
-   bind(slow_int);
-   b(slow_case); // far
- 
-   // 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
--- 90,10 ---
< prev index next >