< prev index next >

src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp

Print this page
@@ -237,29 +237,27 @@
  
    Register OSR_buf = osrBufferPointer()->as_pointer_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);
+       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);
+       int slot_offset = monitor_offset - (i * BytesPerWord);
  #ifdef ASSERT
        // verify the interpreter's monitor has a non-null object
        {
          Label L;
-         __ ld(t0, Address(OSR_buf, slot_offset + 1 * BytesPerWord));
+         __ ld(t0, Address(OSR_buf, slot_offset));
          __ bnez(t0, L);
          __ stop("locked object is NULL");
          __ bind(L);
        }
  #endif // ASSERT
-       __ ld(x9, Address(OSR_buf, slot_offset + 0));
-       __ sd(x9, frame_map()->address_for_monitor_lock(i));
-       __ ld(x9, Address(OSR_buf, slot_offset + 1 * BytesPerWord));
+       __ ld(x9, Address(OSR_buf, slot_offset));
        __ sd(x9, frame_map()->address_for_monitor_object(i));
      }
    }
  }
  

@@ -357,11 +355,12 @@
  
    // Perform needed unlocking
    MonitorExitStub* stub = NULL;
    if (method()->is_synchronized()) {
      monitor_address(0, FrameMap::r10_opr);
-     stub = new MonitorExitStub(FrameMap::r10_opr, true, 0);
+     __ ld(x14, Address(x10, BasicObjectLock::obj_offset_in_bytes()));
+     stub = new MonitorExitStub(FrameMap::r14_opr);
      if (UseHeavyMonitors) {
        __ j(*stub->entry());
      } else {
        __ unlock_object(x15, x14, x10, *stub->entry());
      }

@@ -1500,18 +1499,16 @@
        add_debug_info_for_null_check_here(op->info());
        __ null_check(obj);
      }
      __ j(*op->stub()->entry());
    } else if (op->code() == lir_lock) {
-     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
      int null_check_offset = __ lock_object(hdr, obj, lock, *op->stub()->entry());
      if (op->info() != NULL) {
        add_debug_info_for_null_check(null_check_offset, op->info());
      }
    } else if (op->code() == lir_unlock) {
-     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 {
      Unimplemented();
    }
    __ bind(*op->stub()->continuation());

@@ -1604,11 +1601,11 @@
  }
  
  void LIR_Assembler::emit_delay(LIR_OpDelay*) { Unimplemented(); }
  
  void LIR_Assembler::monitor_address(int monitor_no, LIR_Opr dst) {
-   __ la(dst->as_register(), frame_map()->address_for_monitor_lock(monitor_no));
+   __ la(dst->as_register(), frame_map()->address_for_monitor_object(monitor_no));
  }
  
  void LIR_Assembler::emit_updatecrc32(LIR_OpUpdateCRC32* op) { Unimplemented(); }
  
  void LIR_Assembler::check_conflict(ciKlass* exact_klass, intptr_t current_klass,
< prev index next >