Skip to content

Commit c9d1216

Browse files
author
duke
committed
Backport 3488f53d2c3083bd886644684ec6885046ea7f8e
1 parent 4419ef2 commit c9d1216

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/hotspot/cpu/riscv/nativeInst_riscv.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,9 @@ address NativeCall::reloc_destination() {
7272

7373
address stub_addr = nullptr;
7474
if (code->is_nmethod()) {
75+
// TODO: Need to revisit this when porting the AOT features.
7576
stub_addr = trampoline_stub_Relocation::get_trampoline_for(call_addr, code->as_nmethod());
76-
}
77-
78-
if (stub_addr != nullptr) {
79-
stub_addr = MacroAssembler::target_addr_for_insn(call_addr);
77+
assert(stub_addr != nullptr, "Sanity");
8078
}
8179

8280
return stub_addr;
@@ -113,12 +111,12 @@ bool NativeCall::reloc_set_destination(address dest) {
113111
CodeBlob *code = CodeCache::find_blob(call_addr);
114112
assert(code != nullptr, "Could not find the containing code blob");
115113

116-
address stub_addr = nullptr;
117114
if (code->is_nmethod()) {
118-
stub_addr = trampoline_stub_Relocation::get_trampoline_for(call_addr, code->as_nmethod());
119-
}
120-
if (stub_addr != nullptr) {
121-
MacroAssembler::pd_patch_instruction_size(call_addr, stub_addr);
115+
// TODO: Need to revisit this when porting the AOT features.
116+
assert(dest != nullptr, "Sanity");
117+
assert(dest == trampoline_stub_Relocation::get_trampoline_for(call_addr,
118+
code->as_nmethod()), "Sanity");
119+
MacroAssembler::pd_patch_instruction_size(call_addr, dest);
122120
}
123121

124122
return true;

src/hotspot/cpu/riscv/nativeInst_riscv.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ class NativeInstruction {
9494
static uint64_t get_data64_at(address src) { return Bytes::get_native_u8(src); }
9595

9696
public:
97-
9897
inline friend NativeInstruction* nativeInstruction_at(address addr);
9998

10099
static bool maybe_cpool_ref(address instr) {
@@ -122,8 +121,8 @@ class NativeCall: private NativeInstruction {
122121
// to overload and hide it.
123122
instruction_size = 3 * NativeInstruction::instruction_size // auipc + ld + jalr
124123
};
125-
public:
126124

125+
public:
127126
static int byte_size() {
128127
return NativeCall::instruction_size; // auipc + ld + jalr
129128
}

0 commit comments

Comments
 (0)