< prev index next >

src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp

Print this page
*** 135,16 ***
    // copied into place by code emitted in the IR.
  
    Register OSR_buf = osrBufferPointer()->as_register();
    { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below");
      int monitor_offset = BytesPerWord * method()->max_locals() +
!       (2 * BytesPerWord) * (number_of_locks - 1);
-     // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in
-     // the OSR buffer using 2 word entries: first the lock and then
-     // the oop.
      for (int i = 0; i < number_of_locks; i++) {
!       int slot_offset = monitor_offset - ((i * 2) * BytesPerWord);
  #ifdef ASSERT
        // Verify the interpreter's monitor has a non-null object.
        {
          Label L;
          __ ld(R0, slot_offset + 1*BytesPerWord, OSR_buf);
--- 135,13 ---
    // copied into place by code emitted in the IR.
  
    Register OSR_buf = osrBufferPointer()->as_register();
    { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below");
      int monitor_offset = BytesPerWord * method()->max_locals() +
!       BytesPerWord * (number_of_locks - 1);
      for (int i = 0; i < number_of_locks; i++) {
!       int slot_offset = monitor_offset - (i * BytesPerWord);
  #ifdef ASSERT
        // Verify the interpreter's monitor has a non-null object.
        {
          Label L;
          __ ld(R0, slot_offset + 1*BytesPerWord, OSR_buf);

*** 153,16 ***
          __ stop("locked object is NULL");
          __ bind(L);
        }
  #endif // ASSERT
        // Copy the lock field into the compiled activation.
!       Address ml = frame_map()->address_for_monitor_lock(i),
!               mo = frame_map()->address_for_monitor_object(i);
-       assert(ml.index() == noreg && mo.index() == noreg, "sanity");
        __ ld(R0, slot_offset + 0, OSR_buf);
-       __ std(R0, ml.disp(), ml.base());
-       __ ld(R0, slot_offset + 1*BytesPerWord, OSR_buf);
        __ std(R0, mo.disp(), mo.base());
      }
    }
  }
  
--- 150,13 ---
          __ stop("locked object is NULL");
          __ bind(L);
        }
  #endif // ASSERT
        // Copy the lock field into the compiled activation.
!       Address mo = frame_map()->address_for_monitor_object(i);
!       assert(mo.index() == noreg, "sanity");
        __ ld(R0, slot_offset + 0, OSR_buf);
        __ std(R0, mo.disp(), mo.base());
      }
    }
  }
  

*** 212,12 ***
  
    // Perform needed unlocking
    MonitorExitStub* stub = NULL;
    if (method()->is_synchronized()) {
      monitor_address(0, FrameMap::R4_opr);
!     stub = new MonitorExitStub(FrameMap::R4_opr, true, 0);
!     __ unlock_object(R5, R6, R4, *stub->entry());
      __ bind(*stub->continuation());
    }
  
    if (compilation()->env()->dtrace_method_probes()) {
      Unimplemented();
--- 206,13 ---
  
    // Perform needed unlocking
    MonitorExitStub* stub = NULL;
    if (method()->is_synchronized()) {
      monitor_address(0, FrameMap::R4_opr);
!     __ ld(R4, BasicObjectLock::obj_offset_in_bytes(), R4);
!     stub = new MonitorExitStub(FrameMap::R4_opr);
+     __ b(*stub->entry());
      __ bind(*stub->continuation());
    }
  
    if (compilation()->env()->dtrace_method_probes()) {
      Unimplemented();

*** 2661,11 ***
    Unimplemented();
  }
  
  
  void LIR_Assembler::monitor_address(int monitor_no, LIR_Opr dst_opr) {
!   Address mon_addr = frame_map()->address_for_monitor_lock(monitor_no);
    Register dst = dst_opr->as_register();
    Register reg = mon_addr.base();
    int offset = mon_addr.disp();
    // Compute pointer to BasicLock.
    __ add_const_optimized(dst, reg, offset);
--- 2656,11 ---
    Unimplemented();
  }
  
  
  void LIR_Assembler::monitor_address(int monitor_no, LIR_Opr dst_opr) {
!   Address mon_addr = frame_map()->address_for_monitor_object(monitor_no);
    Register dst = dst_opr->as_register();
    Register reg = mon_addr.base();
    int offset = mon_addr.disp();
    // Compute pointer to BasicLock.
    __ add_const_optimized(dst, reg, offset);

*** 2678,48 ***
    Register lock = op->lock_opr()->as_register();
  
    // Obj may not be an oop.
    if (op->code() == lir_lock) {
      MonitorEnterStub* stub = (MonitorEnterStub*)op->stub();
!     if (!UseHeavyMonitors) {
!       assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header");
!       // Add debug info for NullPointerException only if one is possible.
!       if (op->info() != NULL) {
!         if (!os::zero_page_read_protected() || !ImplicitNullChecks) {
!           explicit_null_check(obj, op->info());
!         } else {
!           add_debug_info_for_null_check_here(op->info());
!         }
-       }
-       __ lock_object(hdr, obj, lock, op->scratch_opr()->as_register(), *op->stub()->entry());
-     } else {
-       // always do slow locking
-       // note: The slow locking code could be inlined here, however if we use
-       //       slow locking, speed doesn't matter anyway and this solution is
-       //       simpler and requires less duplicated code - additionally, the
-       //       slow locking code is the same in either case which simplifies
-       //       debugging.
-       if (op->info() != NULL) {
-         add_debug_info_for_null_check_here(op->info());
-         __ null_check(obj);
-       }
-       __ b(*op->stub()->entry());
      }
    } else {
      assert (op->code() == lir_unlock, "Invalid code, expected lir_unlock");
!     if (!UseHeavyMonitors) {
!       assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header");
!       __ unlock_object(hdr, obj, lock, *op->stub()->entry());
!     } else {
!       // always do slow unlocking
!       // note: The slow unlocking code could be inlined here, however if we use
!       //       slow unlocking, speed doesn't matter anyway and this solution is
-       //       simpler and requires less duplicated code - additionally, the
-       //       slow unlocking code is the same in either case which simplifies
-       //       debugging.
-       __ b(*op->stub()->entry());
-     }
    }
    __ bind(*op->stub()->continuation());
  }
  
  void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) {
--- 2673,30 ---
    Register lock = op->lock_opr()->as_register();
  
    // Obj may not be an oop.
    if (op->code() == lir_lock) {
      MonitorEnterStub* stub = (MonitorEnterStub*)op->stub();
!     // always do slow locking
!     // note: The slow locking code could be inlined here, however if we use
!     //       slow locking, speed doesn't matter anyway and this solution is
!     //       simpler and requires less duplicated code - additionally, the
!     //       slow locking code is the same in either case which simplifies
!     //       debugging.
!     if (op->info() != NULL) {
!       add_debug_info_for_null_check_here(op->info());
!       __ null_check(obj);
      }
+     __ b(*op->stub()->entry());
    } else {
      assert (op->code() == lir_unlock, "Invalid code, expected lir_unlock");
!     // always do slow unlocking
!     // note: The slow unlocking code could be inlined here, however if we use
!     //       slow unlocking, speed doesn't matter anyway and this solution is
!     //       simpler and requires less duplicated code - additionally, the
!     //       slow unlocking code is the same in either case which simplifies
!     //       debugging.
!     __ b(*op->stub()->entry());
    }
    __ bind(*op->stub()->continuation());
  }
  
  void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) {
< prev index next >