Skip to content

Commit

Permalink
ICData move to t1, removed dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
robehn committed Oct 15, 2024
1 parent 4beb12d commit 5cc487a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm

const Register receiver = j_rarg0;
const Register data = t0;
const Register tmp = t2; // A call-clobbered register not used for arg passing

// -------------------------------------------------------------------------
// Generate a C2I adapter. On entry we know xmethod holds the Method* during calls
Expand Down
13 changes: 10 additions & 3 deletions src/hotspot/cpu/riscv/vtableStubs_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
MacroAssembler* masm = new MacroAssembler(&cb);
assert_cond(masm != nullptr);

// Real entry arguments:
// t0: CompiledICData
// j_rarg0: Receiver
// Make sure the move of CompiledICData from t0 to t1 is the frist thing that happens.
// Otherwise we risk clobber t0 as it is used as scratch.
__ mv(t1, t0);

#if (!defined(PRODUCT) && defined(COMPILER2))
if (CountCompiledCalls) {
__ la(x18, ExternalAddress((address) SharedRuntime::nof_megamorphic_calls_addr()));
Expand All @@ -170,8 +177,8 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
// get receiver (need to skip return address on top of stack)
assert(VtableStub::receiver_location() == j_rarg0->as_VMReg(), "receiver expected in j_rarg0");

// Entry arguments:
// t0: CompiledICData
// Arguments from this point:
// t1 (moved from t0): CompiledICData
// j_rarg0: Receiver

// This stub is called from compiled code which has no callee-saved registers,
Expand All @@ -181,7 +188,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
const Register resolved_klass_reg = x30; // resolved interface klass (REFC)
const Register temp_reg = x28;
const Register temp_reg2 = x29;
const Register icdata_reg = t0;
const Register icdata_reg = t1;

Label L_no_such_interface;

Expand Down

0 comments on commit 5cc487a

Please sign in to comment.