< prev index next >
src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CompiledMethodInfo.java
Print this page
*** 37,46 ****
--- 37,48 ----
import jdk.vm.ci.hotspot.HotSpotCompiledCode;
import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
final class CompiledMethodInfo {
+ static final String archStr = System.getProperty("os.arch").toLowerCase();
+
private static final int UNINITIALIZED_OFFSET = -1;
private static class AOTMethodOffsets {
/**
* Offset in metaspace names section.
*** 302,315 ****
return null;
}
boolean hasMark(Site call, MarkId id) {
for (Mark m : compilationResult.getMarks()) {
// TODO: X64-specific code.
// Call instructions are aligned to 8
// bytes - 1 on x86 to patch address atomically,
! int adjOffset = (m.pcOffset & (-8)) + 7;
// Mark points before aligning nops.
if ((call.pcOffset == adjOffset) && MarkId.getEnum((int) m.id) == id) {
return true;
}
}
--- 304,325 ----
return null;
}
boolean hasMark(Site call, MarkId id) {
for (Mark m : compilationResult.getMarks()) {
+ int adjOffset = m.pcOffset;
+ if (archStr.equals("aarch64")) {
+ // FIXME: This is very ugly.
+ // The mark is at the end of a group of three instructions:
+ // adrp; add; ldr
+ adjOffset += 12;
+ } else {
// TODO: X64-specific code.
// Call instructions are aligned to 8
// bytes - 1 on x86 to patch address atomically,
! adjOffset = (adjOffset & (-8)) + 7;
! }
// Mark points before aligning nops.
if ((call.pcOffset == adjOffset) && MarkId.getEnum((int) m.id) == id) {
return true;
}
}
< prev index next >