< prev index next >
src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CompiledMethodInfo.java
Print this page
@@ -37,10 +37,12 @@
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,14 +304,22 @@
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,
- int adjOffset = (m.pcOffset & (-8)) + 7;
+ adjOffset = (adjOffset & (-8)) + 7;
+ }
// Mark points before aligning nops.
if ((call.pcOffset == adjOffset) && MarkId.getEnum((int) m.id) == id) {
return true;
}
}
< prev index next >