Skip to content

Commit

Permalink
Default t1
Browse files Browse the repository at this point in the history
  • Loading branch information
robehn committed Sep 25, 2024
1 parent 274266c commit dbcc4ad
Show file tree
Hide file tree
Showing 19 changed files with 93 additions and 88 deletions.
26 changes: 13 additions & 13 deletions src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void C1SafepointPollStub::emit_code(LIR_Assembler* ce) {
"polling page return stub not created yet");
address stub = SharedRuntime::polling_page_return_handler_blob()->entry_point();

__ far_jump(RuntimeAddress(stub), t1);
__ far_jump(RuntimeAddress(stub));
}

void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
Expand All @@ -62,7 +62,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
__ mov_metadata(t0, m);
ce->store_parameter(t0, 1);
ce->store_parameter(_bci, 0);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::counter_overflow_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::counter_overflow_id)));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
__ j(_continuation);
Expand All @@ -72,7 +72,7 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
if (_info->deoptimize_on_exception()) {
address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
__ far_call(RuntimeAddress(a), t1);
__ far_call(RuntimeAddress(a));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
debug_only(__ should_not_reach_here());
Expand Down Expand Up @@ -107,7 +107,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
__ far_call(RuntimeAddress(a), t1);
__ far_call(RuntimeAddress(a));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
debug_only(__ should_not_reach_here());
Expand All @@ -118,7 +118,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) {
ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
}
__ bind(_entry);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::throw_div0_exception_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::throw_div0_exception_id)));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
#ifdef ASSERT
Expand All @@ -143,7 +143,7 @@ void NewInstanceStub::emit_code(LIR_Assembler* ce) {
assert(__ rsp_offset() == 0, "frame size should be fixed");
__ bind(_entry);
__ mv(x13, _klass_reg->as_register());
__ far_call(RuntimeAddress(Runtime1::entry_for(_stub_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(_stub_id)));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
assert(_result->as_register() == x10, "result must in x10");
Expand All @@ -163,7 +163,7 @@ void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
assert(_length->as_register() == x9, "length must in x9");
assert(_klass_reg->as_register() == x13, "klass_reg must in x13");
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_type_array_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_type_array_id)));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
assert(_result->as_register() == x10, "result must in x10");
Expand All @@ -183,7 +183,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
assert(_length->as_register() == x9, "length must in x9");
assert(_klass_reg->as_register() == x13, "klass_reg must in x13");
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_object_array_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_object_array_id)));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
assert(_result->as_register() == x10, "result must in x10");
Expand All @@ -201,7 +201,7 @@ void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
} else {
enter_id = C1StubId::monitorenter_nofpu_id;
}
__ far_call(RuntimeAddress(Runtime1::entry_for(enter_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(enter_id)));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
__ j(_continuation);
Expand All @@ -222,7 +222,7 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) {
exit_id = C1StubId::monitorexit_nofpu_id;
}
__ la(ra, _continuation);
__ far_jump(RuntimeAddress(Runtime1::entry_for(exit_id)), t1);
__ far_jump(RuntimeAddress(Runtime1::entry_for(exit_id)));
}

// Implementation of patching:
Expand All @@ -244,7 +244,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
ce->store_parameter(_trap_request, 0);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::deoptimize_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::deoptimize_id)));
ce->add_call_info_here(_info);
DEBUG_ONLY(__ should_not_reach_here());
}
Expand All @@ -260,7 +260,7 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) {

ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
__ bind(_entry);
__ far_call(RuntimeAddress(a), t1);
__ far_call(RuntimeAddress(a));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
debug_only(__ should_not_reach_here());
Expand All @@ -275,7 +275,7 @@ void SimpleExceptionStub::emit_code(LIR_Assembler* ce) {
if (_obj->is_cpu_register()) {
__ mv(t0, _obj->as_register());
}
__ far_call(RuntimeAddress(Runtime1::entry_for(_stub)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(_stub)));
ce->add_call_info_here(_info);
debug_only(__ should_not_reach_here());
}
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void LIR_Assembler::generic_arraycopy(Register src, Register src_pos, Register l
__ incrementw(ExternalAddress((address)&Runtime1::_generic_arraycopystub_cnt));
}
#endif
__ far_call(RuntimeAddress(copyfunc_addr), t1);
__ far_call(RuntimeAddress(copyfunc_addr));
__ beqz(x10, *stub->continuation());
// Reload values from the stack so they are where the stub
// expects them.
Expand Down Expand Up @@ -157,7 +157,7 @@ void LIR_Assembler::arraycopy_checkcast(Register src, Register src_pos, Register
// easier to restore just those that we care about.
arraycopy_store_args(src, src_pos, length, dst, dst_pos);
arraycopy_checkcast_prepare_params(src, src_pos, length, dst, dst_pos, basic_type);
__ far_call(RuntimeAddress(copyfunc_addr), t1);
__ far_call(RuntimeAddress(copyfunc_addr));

#ifndef PRODUCT
if (PrintC1Statistics) {
Expand Down Expand Up @@ -223,7 +223,7 @@ void LIR_Assembler::arraycopy_type_check(Register src, Register src_pos, Registe
__ check_klass_subtype_fast_path(src, dst, tmp, &cont, &slow, nullptr);

PUSH(src, dst);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
POP(src, dst);
__ bnez(dst, cont);

Expand Down Expand Up @@ -335,7 +335,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {

CodeBlob *cb = CodeCache::find_blob(entry);
if (cb != nullptr) {
__ far_call(RuntimeAddress(entry), t1);
__ far_call(RuntimeAddress(entry));
} else {
const int args_num = 3;
__ call_VM_leaf(entry, args_num);
Expand Down
24 changes: 12 additions & 12 deletions src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ void LIR_Assembler::clinit_barrier(ciMethod* method) {

Label L_skip_barrier;

__ mov_metadata(t0, method->holder()->constant_encoding());
__ clinit_barrier(t0, t1, &L_skip_barrier /* L_fast_path */);
__ far_jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub()), t1);
__ mov_metadata(t1, method->holder()->constant_encoding());
__ clinit_barrier(t1, t0, &L_skip_barrier /* L_fast_path */);
__ far_jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub()));
__ bind(L_skip_barrier);
}

Expand Down Expand Up @@ -305,7 +305,7 @@ int LIR_Assembler::emit_exception_handler() {
__ verify_not_null_oop(x10);

// search an exception handler (x10: exception oop, x13: throwing pc)
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::handle_exception_from_callee_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::handle_exception_from_callee_id)));
__ should_not_reach_here();
guarantee(code_offset() - offset <= exception_handler_size(), "overflow");
__ end_a_stub();
Expand Down Expand Up @@ -361,7 +361,7 @@ int LIR_Assembler::emit_unwind_handler() {
// remove the activation and dispatch to the unwind handler
__ block_comment("remove_frame and dispatch to the unwind handler");
__ remove_frame(initial_frame_size_in_bytes());
__ far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::unwind_exception_id)), t1);
__ far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::unwind_exception_id)));

// Emit the slow path assembly
if (stub != nullptr) {
Expand All @@ -383,7 +383,7 @@ int LIR_Assembler::emit_deopt_handler() {
int offset = code_offset();

__ auipc(ra, 0);
__ far_jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack()), t1);
__ far_jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack()));
guarantee(code_offset() - offset <= deopt_handler_size(), "overflow");
__ end_a_stub();

Expand Down Expand Up @@ -1088,7 +1088,7 @@ void LIR_Assembler::typecheck_helper_slowcheck(ciKlass *k, Register obj, Registe
__ addi(sp, sp, -2 * wordSize); // 2: store k_RInfo and klass_RInfo
__ sd(k_RInfo, Address(sp, 0)); // sub klass
__ sd(klass_RInfo, Address(sp, wordSize)); // super klass
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
// load result to k_RInfo
__ ld(k_RInfo, Address(sp, 0));
__ addi(sp, sp, 2 * wordSize); // 2: pop out k_RInfo and klass_RInfo
Expand All @@ -1103,7 +1103,7 @@ void LIR_Assembler::typecheck_helper_slowcheck(ciKlass *k, Register obj, Registe
__ addi(sp, sp, -2 * wordSize); // 2: store k_RInfo and klass_RInfo
__ sd(klass_RInfo, Address(sp, wordSize)); // sub klass
__ sd(k_RInfo, Address(sp, 0)); // super klass
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
// load result to k_RInfo
__ ld(k_RInfo, Address(sp, 0));
__ addi(sp, sp, 2 * wordSize); // 2: pop out k_RInfo and klass_RInfo
Expand Down Expand Up @@ -1418,7 +1418,7 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit
} else {
unwind_id = C1StubId::handle_exception_nofpu_id;
}
__ far_call(RuntimeAddress(Runtime1::entry_for(unwind_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(unwind_id)));
__ nop();
}

Expand Down Expand Up @@ -1857,7 +1857,7 @@ void LIR_Assembler::leal(LIR_Opr addr, LIR_Opr dest, LIR_PatchCode patch_code, C
void LIR_Assembler::rt_call(LIR_Opr result, address dest, const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) {
assert(!tmp->is_valid(), "don't need temporary");

__ rt_call(dest, t1);
__ rt_call(dest);

if (info != nullptr) {
add_call_info_here(info);
Expand Down Expand Up @@ -2068,7 +2068,7 @@ void LIR_Assembler::deoptimize_trap(CodeEmitInfo *info) {
default: ShouldNotReachHere();
}

__ far_call(RuntimeAddress(target), t1);
__ far_call(RuntimeAddress(target));
add_call_info_here(info);
}

Expand Down Expand Up @@ -2152,7 +2152,7 @@ void LIR_Assembler::lir_store_slowcheck(Register k_RInfo, Register klass_RInfo,
__ addi(sp, sp, -2 * wordSize); // 2: store k_RInfo and klass_RInfo
__ sd(klass_RInfo, Address(sp, wordSize)); // sub klass
__ sd(k_RInfo, Address(sp, 0)); // super klass
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)), t1);
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
// load result to k_RInfo
__ ld(k_RInfo, Address(sp, 0));
__ addi(sp, sp, 2 * wordSize); // 2: pop out k_RInfo and klass_RInfo
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register

if (CURRENT_ENV->dtrace_alloc_probes()) {
assert(obj == x10, "must be");
far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)), t1);
far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)));
}

verify_oop(obj);
Expand Down Expand Up @@ -316,7 +316,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register tmp1

if (CURRENT_ENV->dtrace_alloc_probes()) {
assert(obj == x10, "must be");
far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)), t1);
far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)));
}

verify_oop(obj);
Expand Down
14 changes: 7 additions & 7 deletions src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int StubAssembler::call_RT(Register oop_result, Register metadata_result, addres
set_last_Java_frame(sp, fp, retaddr, t0);

// do the call
rt_call(entry, t1);
rt_call(entry);
bind(retaddr);
int call_offset = offset();
// verify callee-saved register
Expand Down Expand Up @@ -97,11 +97,11 @@ int StubAssembler::call_RT(Register oop_result, Register metadata_result, addres
}
if (frame_size() == no_frame_size) {
leave();
far_jump(RuntimeAddress(StubRoutines::forward_exception_entry()), t1);
far_jump(RuntimeAddress(StubRoutines::forward_exception_entry()));
} else if (_stub_id == (int)C1StubId::forward_exception_id) {
should_not_reach_here();
} else {
far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::forward_exception_id)), t1);
far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::forward_exception_id)));
}
bind(L);
}
Expand Down Expand Up @@ -570,7 +570,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
Label retaddr;
__ set_last_Java_frame(sp, fp, retaddr, t0);
// do the call
__ rt_call(target, t1);
__ rt_call(target);
__ bind(retaddr);
OopMapSet* oop_maps = new OopMapSet();
assert_cond(oop_maps != nullptr);
Expand Down Expand Up @@ -613,7 +613,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {

restore_live_registers(sasm);
__ leave();
__ far_jump(RuntimeAddress(deopt_blob->unpack_with_reexecution()), t1);
__ far_jump(RuntimeAddress(deopt_blob->unpack_with_reexecution()));

__ bind(no_deopt);
__ stop("deopt not performed");
Expand Down Expand Up @@ -935,7 +935,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob();
assert(deopt_blob != nullptr, "deoptimization blob must have been created");
__ leave();
__ far_jump(RuntimeAddress(deopt_blob->unpack_with_reexecution()), t1);
__ far_jump(RuntimeAddress(deopt_blob->unpack_with_reexecution()));
}
break;

Expand Down Expand Up @@ -1034,7 +1034,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob();
assert(deopt_blob != nullptr, "deoptimization blob must have been created");

__ far_jump(RuntimeAddress(deopt_blob->unpack_with_reexecution()), t1);
__ far_jump(RuntimeAddress(deopt_blob->unpack_with_reexecution()));
}
break;

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void C2SafepointPollStub::emit(C2_MacroAssembler& masm) {
__ addi(t0, t0, offset);
});
__ sd(t0, Address(xthread, JavaThread::saved_exception_pc_offset()));
__ far_jump(callback_addr, t1);
__ far_jump(callback_addr);
}

int C2EntryBarrierStub::max_size() const {
Expand All @@ -60,7 +60,7 @@ int C2EntryBarrierStub::max_size() const {

void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) {
__ bind(entry());
__ rt_call(StubRoutines::method_entry_barrier(), t1);
__ rt_call(StubRoutines::method_entry_barrier());

__ j(continuation());

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ void G1BarrierSetAssembler::gen_pre_barrier_stub(LIR_Assembler* ce, G1PreBarrier
}
__ beqz(pre_val_reg, *stub->continuation(), /* is_far */ true);
ce->store_parameter(stub->pre_val()->as_register(), 0);
__ far_call(RuntimeAddress(bs->pre_barrier_c1_runtime_code_blob()->code_begin()), t1);
__ far_call(RuntimeAddress(bs->pre_barrier_c1_runtime_code_blob()->code_begin()));
__ j(*stub->continuation());
}

Expand All @@ -344,7 +344,7 @@ void G1BarrierSetAssembler::gen_post_barrier_stub(LIR_Assembler* ce, G1PostBarri
Register new_val_reg = stub->new_val()->as_register();
__ beqz(new_val_reg, *stub->continuation(), /* is_far */ true);
ce->store_parameter(stub->addr()->as_pointer_register(), 0);
__ far_call(RuntimeAddress(bs->post_barrier_c1_runtime_code_blob()->code_begin()), t1);
__ far_call(RuntimeAddress(bs->post_barrier_c1_runtime_code_blob()->code_begin()));
__ j(*stub->continuation());
}

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Label* slo
Label skip_barrier;
__ beq(t0, t1, skip_barrier);

__ rt_call(StubRoutines::method_entry_barrier(), t1);
__ rt_call(StubRoutines::method_entry_barrier());

__ j(skip_barrier);

Expand Down Expand Up @@ -351,7 +351,7 @@ void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler* masm) {

__ bind(bad_call);

__ far_jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub()), t1);
__ far_jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub()));
__ bind(method_live);
}

Expand Down
Loading

0 comments on commit dbcc4ad

Please sign in to comment.