@@ -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 ;
0 commit comments