diff --git a/common.json b/common.json index d2e86081a7ff..c5b69f6d5239 100644 --- a/common.json +++ b/common.json @@ -8,7 +8,7 @@ "COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet", "jdks": { - "galahad-jdk": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+27-3513", "platformspecific": true, "extrabundles": ["static-libs"]}, + "galahad-jdk": {"name": "jpg-jdk", "version": "24", "build_id": "2024-12-09-1307270.yudi.zheng.jdk", "platformspecific": true, "extrabundles": ["static-libs"]}, "oraclejdk17": {"name": "jpg-jdk", "version": "17.0.7", "build_id": "jdk-17.0.7+8", "platformspecific": true, "extrabundles": ["static-libs"]}, "labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.1-b02", "platformspecific": true }, diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_jdk_internal_misc_VM.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_jdk_internal_misc_VM.java index ae7b5fee71f8..60175cfbcfe8 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_jdk_internal_misc_VM.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_jdk_internal_misc_VM.java @@ -35,6 +35,7 @@ import com.oracle.svm.core.annotate.RecomputeFieldValue.Kind; import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetClass; +import com.oracle.svm.core.annotate.TargetElement; import com.oracle.svm.core.snippets.KnownIntrinsics; import jdk.internal.misc.Unsafe; @@ -68,7 +69,12 @@ public static ClassLoader latestUserDefinedLoader0() { @Alias @InjectAccessors(DirectMemoryAccessors.class) // private static long directMemory; @Alias @InjectAccessors(PageAlignDirectMemoryAccessors.class) // - private static boolean pageAlignDirectMemory; + @TargetElement(onlyWith = JDKLatest.class) // + private static Boolean pageAlignDirectMemory; + + @Alias @InjectAccessors(PageAlignDirectMemoryJDK21Accessors.class) // + @TargetElement(name = "pageAlignDirectMemory", onlyWith = JDK21OrEarlier.class) // + private static boolean pageAlignDirectMemoryJDK21; } final class DirectMemoryAccessors { @@ -125,7 +131,7 @@ final class PageAlignDirectMemoryAccessors { private static boolean initialized; private static boolean pageAlignDirectMemory; - static boolean getPageAlignDirectMemory() { + static Boolean getPageAlignDirectMemory() { if (!initialized) { initialize(); } @@ -140,3 +146,9 @@ private static void initialize() { initialized = true; } } + +final class PageAlignDirectMemoryJDK21Accessors { + static boolean getPageAlignDirectMemory() { + return PageAlignDirectMemoryAccessors.getPageAlignDirectMemory(); + } +} \ No newline at end of file