8342882: RISC-V: Unify handling of jumps to runtime
Reviewed-by: rehn
This commit is contained in:
parent
2c31c8eeb4
commit
85774b713e
@ -758,15 +758,14 @@ void ZBarrierSetAssembler::generate_c2_store_barrier_stub(MacroAssembler* masm,
|
||||
__ la(c_rarg0, stub->ref_addr());
|
||||
|
||||
if (stub->is_native()) {
|
||||
__ la(t1, RuntimeAddress(ZBarrierSetRuntime::store_barrier_on_native_oop_field_without_healing_addr()));
|
||||
__ rt_call(ZBarrierSetRuntime::store_barrier_on_native_oop_field_without_healing_addr());
|
||||
} else if (stub->is_atomic()) {
|
||||
__ la(t1, RuntimeAddress(ZBarrierSetRuntime::store_barrier_on_oop_field_with_healing_addr()));
|
||||
__ rt_call(ZBarrierSetRuntime::store_barrier_on_oop_field_with_healing_addr());
|
||||
} else if (stub->is_nokeepalive()) {
|
||||
__ la(t1, RuntimeAddress(ZBarrierSetRuntime::no_keepalive_store_barrier_on_oop_field_without_healing_addr()));
|
||||
__ rt_call(ZBarrierSetRuntime::no_keepalive_store_barrier_on_oop_field_without_healing_addr());
|
||||
} else {
|
||||
__ la(t1, RuntimeAddress(ZBarrierSetRuntime::store_barrier_on_oop_field_without_healing_addr()));
|
||||
__ rt_call(ZBarrierSetRuntime::store_barrier_on_oop_field_without_healing_addr());
|
||||
}
|
||||
__ jalr(t1);
|
||||
}
|
||||
|
||||
// Stub exit
|
||||
|
@ -454,12 +454,7 @@ void MacroAssembler::call_VM_base(Register oop_result,
|
||||
ld(t0, Address(java_thread, in_bytes(Thread::pending_exception_offset())));
|
||||
Label ok;
|
||||
beqz(t0, ok);
|
||||
RuntimeAddress target(StubRoutines::forward_exception_entry());
|
||||
relocate(target.rspec(), [&] {
|
||||
int32_t offset;
|
||||
la(t1, target.target(), offset);
|
||||
jr(t1, offset);
|
||||
});
|
||||
j(RuntimeAddress(StubRoutines::forward_exception_entry()));
|
||||
bind(ok);
|
||||
}
|
||||
|
||||
@ -977,17 +972,19 @@ void MacroAssembler::j(const address dest, Register temp) {
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::j(const Address &adr, Register temp) {
|
||||
switch (adr.getMode()) {
|
||||
void MacroAssembler::j(const Address &dest, Register temp) {
|
||||
switch (dest.getMode()) {
|
||||
case Address::literal: {
|
||||
relocate(adr.rspec(), [&] {
|
||||
j(adr.target(), temp);
|
||||
relocate(dest.rspec(), [&] {
|
||||
int32_t offset;
|
||||
la(temp, dest.target(), offset);
|
||||
jr(temp, offset);
|
||||
});
|
||||
break;
|
||||
}
|
||||
case Address::base_plus_offset: {
|
||||
int32_t offset = ((int32_t)adr.offset() << 20) >> 20;
|
||||
la(temp, Address(adr.base(), adr.offset() - offset));
|
||||
int32_t offset = ((int32_t)dest.offset() << 20) >> 20;
|
||||
la(temp, Address(dest.base(), dest.offset() - offset));
|
||||
jr(temp, offset);
|
||||
break;
|
||||
}
|
||||
@ -4194,8 +4191,7 @@ void MacroAssembler::reserved_stack_check() {
|
||||
// We have already removed our own frame.
|
||||
// throw_delayed_StackOverflowError will think that it's been
|
||||
// called by our caller.
|
||||
la(t1, RuntimeAddress(SharedRuntime::throw_delayed_StackOverflowError_entry()));
|
||||
jr(t1);
|
||||
j(RuntimeAddress(SharedRuntime::throw_delayed_StackOverflowError_entry()));
|
||||
should_not_reach_here();
|
||||
|
||||
bind(no_reserved_zone_enabling);
|
||||
|
@ -663,7 +663,7 @@ class MacroAssembler: public Assembler {
|
||||
// For long reach uses temp register for:
|
||||
// la + jr
|
||||
void j(const address dest, Register temp = t1);
|
||||
void j(const Address &adr, Register temp = t1);
|
||||
void j(const Address &dest, Register temp = t1);
|
||||
void j(Label &l, Register temp = noreg);
|
||||
|
||||
// jump register: jalr x0, offset(rs)
|
||||
|
@ -1139,8 +1139,7 @@ static void gen_continuation_yield(MacroAssembler* masm,
|
||||
Label ok;
|
||||
__ beqz(t0, ok);
|
||||
__ leave();
|
||||
__ la(t1, RuntimeAddress(StubRoutines::forward_exception_entry()));
|
||||
__ jr(t1);
|
||||
__ j(RuntimeAddress(StubRoutines::forward_exception_entry()));
|
||||
__ bind(ok);
|
||||
|
||||
__ leave();
|
||||
|
@ -508,7 +508,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// complete return to VM
|
||||
assert(StubRoutines::_call_stub_return_address != nullptr,
|
||||
"_call_stub_return_address must have been generated before");
|
||||
__ j(StubRoutines::_call_stub_return_address);
|
||||
__ j(RuntimeAddress(StubRoutines::_call_stub_return_address));
|
||||
|
||||
return start;
|
||||
}
|
||||
@ -3782,8 +3782,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
Label thaw_success;
|
||||
// t1 contains the size of the frames to thaw, 0 if overflow or no more frames
|
||||
__ bnez(t1, thaw_success);
|
||||
__ la(t1, RuntimeAddress(SharedRuntime::throw_StackOverflowError_entry()));
|
||||
__ jr(t1);
|
||||
__ j(RuntimeAddress(SharedRuntime::throw_StackOverflowError_entry()));
|
||||
__ bind(thaw_success);
|
||||
|
||||
// make room for the thawed frames
|
||||
|
@ -421,7 +421,7 @@ address TemplateInterpreterGenerator::generate_exception_handler_common(
|
||||
c_rarg1, c_rarg2);
|
||||
}
|
||||
// throw exception
|
||||
__ j(address(Interpreter::throw_exception_entry()));
|
||||
__ j(RuntimeAddress(Interpreter::throw_exception_entry()));
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ void TemplateTable::aastore() {
|
||||
|
||||
// Come here on failure
|
||||
// object is at TOS
|
||||
__ j(Interpreter::_throw_ArrayStoreException_entry);
|
||||
__ j(RuntimeAddress(Interpreter::_throw_ArrayStoreException_entry));
|
||||
|
||||
// Come here on success
|
||||
__ bind(ok_is_subtype);
|
||||
@ -3672,7 +3672,7 @@ void TemplateTable::checkcast() {
|
||||
// Come here on failure
|
||||
__ push_reg(x13);
|
||||
// object is at TOS
|
||||
__ j(Interpreter::_throw_ClassCastException_entry);
|
||||
__ j(RuntimeAddress(Interpreter::_throw_ClassCastException_entry));
|
||||
|
||||
// Come here on success
|
||||
__ bind(ok_is_subtype);
|
||||
@ -3779,7 +3779,7 @@ void TemplateTable::_breakpoint() {
|
||||
void TemplateTable::athrow() {
|
||||
transition(atos, vtos);
|
||||
__ null_check(x10);
|
||||
__ j(Interpreter::throw_exception_entry());
|
||||
__ j(RuntimeAddress(Interpreter::throw_exception_entry()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user