Skip to content
This repository was archived by the owner on May 29, 2024. It is now read-only.

Commit a0597da

Browse files
committed
Use reloc info to find guard location
1 parent 90f5597 commit a0597da

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,13 @@ class NativeNMethodBarrier {
6262
address barrier_address;
6363
#if INCLUDE_JVMCI
6464
if (nm->is_compiled_by_jvmci()) {
65-
_instruction_address = nm->code_begin() + nm->frame_complete_offset();
66-
_guard_addr = reinterpret_cast<int*>(nm->consts_begin() + nm->jvmci_nmethod_data()->nmethod_entry_patch_offset());
65+
address pc = nm->code_begin() + nm->jvmci_nmethod_data()->nmethod_entry_patch_offset();
66+
RelocIterator iter(nm, pc, pc + 4);
67+
guarantee(iter.next(), "missing relocs");
68+
guarantee(iter.type() == relocInfo::section_word_type, "unexpected reloc");
69+
70+
_guard_addr = (int*) iter.section_word_reloc()->target();
71+
_instruction_address = pc;
6772
} else
6873
#endif
6974
{

src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset
9090
if (inst->is_adr_aligned() || inst->is_ldr_literal()
9191
|| (NativeInstruction::maybe_cpool_ref(pc))) {
9292
address dest = _constants->start() + data_offset;
93-
if (_nmethod_entry_patch_offset == pc_offset) {
94-
// Remember the offset into constants
95-
_nmethod_entry_patch_offset = data_offset;
96-
}
9793
_instructions->relocate(pc, section_word_Relocation::spec((address) dest, CodeBuffer::SECT_CONSTS));
9894
JVMCI_event_3("relocating at " PTR_FORMAT " (+%d) with destination at %d", p2i(pc), pc_offset, data_offset);
9995
} else {

0 commit comments

Comments
 (0)