diff --git a/common.json b/common.json index 5d02b36586fe..974c9f3ccfb7 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+15-1637", "platformspecific": true, "extrabundles": ["static-libs"]}, + "galahad-jdk": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+18-2013", "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 }, @@ -45,13 +45,13 @@ "oraclejdk23": {"name": "jpg-jdk", "version": "23", "build_id": "jdk-23+37", "platformspecific": true, "extrabundles": ["static-libs"]}, - "oraclejdk-latest": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+17", "platformspecific": true, "extrabundles": ["static-libs"]}, - "labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-24+17-jvmci-b01", "platformspecific": true }, - "labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-24+17-jvmci-b01-debug", "platformspecific": true }, - "labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-24+17-jvmci-b01-sulong", "platformspecific": true }, - "labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-24+17-jvmci-b01", "platformspecific": true }, - "labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-24+17-jvmci-b01-debug", "platformspecific": true }, - "labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-24+17-jvmci-b01-sulong", "platformspecific": true } + "oraclejdk-latest": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+18", "platformspecific": true, "extrabundles": ["static-libs"]}, + "labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-24+18-jvmci-b01", "platformspecific": true }, + "labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-24+18-jvmci-b01-debug", "platformspecific": true }, + "labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-24+18-jvmci-b01-sulong", "platformspecific": true }, + "labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-24+18-jvmci-b01", "platformspecific": true }, + "labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-24+18-jvmci-b01-debug", "platformspecific": true }, + "labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-24+18-jvmci-b01-sulong", "platformspecific": true } }, "eclipse": { diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java index 74607b300037..4f63e1596064 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java @@ -649,6 +649,7 @@ private long getXGCAddressField(String name) { public final int lockStackTopOffset = getFieldOffset("LockStack::_top", Integer.class, "uint32_t", -1, JDK >= 22); public final int lockStackEndOffset = getConstant("LockStack::_end_offset", Integer.class, -1, JDK >= 22); public final int threadOmCacheOffset = getFieldOffset("JavaThread::_om_cache", Integer.class, "OMCache", -1, JDK >= 24); + public final int threadUnlockedInflatedMonitorOffset = getFieldOffset("JavaThread::_unlocked_inflated_monitor", Integer.class, "ObjectMonitor*", -1, JDK >= 24); public final int omCacheOopToOopDifference = getConstant("OMCache::oop_to_oop_difference", Integer.class, -1, JDK >= 24); public final int omCacheOopToMonitorDifference = getConstant("OMCache::oop_to_monitor_difference", Integer.class, -1, JDK >= 24); diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/JVMCIVersionCheck.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/JVMCIVersionCheck.java index 034b285fa0fd..2ecf860ef5db 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/JVMCIVersionCheck.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/JVMCIVersionCheck.java @@ -55,8 +55,8 @@ public final class JVMCIVersionCheck { private static final Map> JVMCI_MIN_VERSIONS = Map.of( "21", Map.of(DEFAULT_VENDOR_ENTRY, createLegacyVersion(23, 1, 33)), "24", Map.of( - "Oracle Corporation", createLabsJDKVersion("24+17", 1), - DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("24+17", 1))); + "Oracle Corporation", createLabsJDKVersion("24+18", 1), + DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("24+18", 1))); private static final int NA = 0; /** * Minimum Java release supported by Graal. diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/UnimplementedGraalIntrinsics.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/UnimplementedGraalIntrinsics.java index 18c4d48586b9..d6ea2158ba4c 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/UnimplementedGraalIntrinsics.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/UnimplementedGraalIntrinsics.java @@ -151,6 +151,13 @@ public UnimplementedGraalIntrinsics(Architecture arch) { // @formatter:on ); + if (jdk >= 24) { + add(toBeInvestigated, // @formatter:off + "jdk/internal/vm/vector/VectorSupport.selectFromOp(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$VectorMask;Ljdk/internal/vm/vector/VectorSupport$VectorSelectFromOp;)Ljdk/internal/vm/vector/VectorSupport$Vector;", + "jdk/internal/vm/vector/VectorSupport.wrapShuffleIndexes(Ljava/lang/Class;Ljava/lang/Class;Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;ILjdk/internal/vm/vector/VectorSupport$WrapShuffleIndexesOperation;)Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;"); + // @formatter:on + } + // These are known to be implemented down stream add(enterprise, // @formatter:off "java/lang/Integer.toString(I)Ljava/lang/String;", diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/HotSpotReplacementsUtil.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/HotSpotReplacementsUtil.java index 0250444c0f1d..978a9692e909 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/HotSpotReplacementsUtil.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/HotSpotReplacementsUtil.java @@ -30,9 +30,6 @@ import java.lang.ref.Reference; -import jdk.graal.compiler.core.common.type.Stamp; -import jdk.graal.compiler.hotspot.meta.HotSpotLoweringProvider; -import jdk.vm.ci.meta.Constant; import org.graalvm.word.LocationIdentity; import jdk.graal.compiler.api.replacements.Fold; @@ -40,11 +37,13 @@ import jdk.graal.compiler.core.common.SuppressFBWarnings; import jdk.graal.compiler.core.common.spi.ForeignCallDescriptor; import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; import jdk.graal.compiler.core.common.type.TypeReference; import jdk.graal.compiler.debug.GraalError; import jdk.graal.compiler.graph.Node.ConstantNodeParameter; import jdk.graal.compiler.graph.Node.NodeIntrinsic; import jdk.graal.compiler.hotspot.GraalHotSpotVMConfig; +import jdk.graal.compiler.hotspot.meta.HotSpotLoweringProvider; import jdk.graal.compiler.hotspot.word.KlassPointer; import jdk.graal.compiler.nodes.CanonicalizableLocation; import jdk.graal.compiler.nodes.CompressionNode; @@ -71,6 +70,7 @@ import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.Assumptions; import jdk.vm.ci.meta.Assumptions.AssumptionResult; +import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaField; @@ -322,6 +322,8 @@ public static Object getPendingException(Word thread) { public static final LocationIdentity JAVA_THREAD_OM_CACHE_LOCATION = NamedLocationIdentity.mutable("JavaThread::_om_cache"); + public static final LocationIdentity JAVA_THREAD_UNLOCKED_INFLATED_MONITOR_LOCATION = NamedLocationIdentity.mutable("JavaThread::_unlocked_inflated_monitor"); + @Fold public static JavaKind getWordKind() { return runtime().getHostJVMCIBackend().getCodeCache().getTarget().wordJavaKind; @@ -687,6 +689,11 @@ static int javaThreadOomCacheOffset(@InjectedParameter GraalHotSpotVMConfig conf return config.threadOmCacheOffset; } + @Fold + public static int javaThreadUnlockedInflatedMonitorOffset(@InjectedParameter GraalHotSpotVMConfig config) { + return config.threadUnlockedInflatedMonitorOffset; + } + @Fold static int omCacheOopToOopDifference(@InjectedParameter GraalHotSpotVMConfig config) { return config.omCacheOopToOopDifference; @@ -1054,4 +1061,5 @@ public ValueNode canonicalizeRead(ValueNode read, ValueNode object, ValueNode of public static final LocationIdentity METASPACE_ARRAY_LENGTH_LOCATION = NamedLocationIdentity.immutable("MetaspaceArrayLength"); public static final LocationIdentity SECONDARY_SUPERS_ELEMENT_LOCATION = NamedLocationIdentity.immutable("SecondarySupersElement"); + } diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/MonitorSnippets.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/MonitorSnippets.java index 176777258074..6fa32cf03b3a 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/MonitorSnippets.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/MonitorSnippets.java @@ -37,6 +37,7 @@ import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.JAVA_THREAD_LOCK_STACK_LOCATION; import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.JAVA_THREAD_LOCK_STACK_TOP_LOCATION; import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.JAVA_THREAD_OM_CACHE_LOCATION; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.JAVA_THREAD_UNLOCKED_INFLATED_MONITOR_LOCATION; import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_ACCESS_FLAGS_LOCATION; import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_MISC_FLAGS_LOCATION; import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.MARK_WORD_LOCATION; @@ -50,6 +51,7 @@ import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.javaThreadLockStackEndOffset; import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.javaThreadLockStackTopOffset; import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.javaThreadOomCacheOffset; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.javaThreadUnlockedInflatedMonitorOffset; import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.jvmAccIsValueBasedClass; import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.klassAccessFlagsOffset; import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.klassMiscFlagsOffset; @@ -143,6 +145,7 @@ import jdk.graal.compiler.replacements.SnippetTemplate.SnippetInfo; import jdk.graal.compiler.replacements.Snippets; import jdk.graal.compiler.replacements.nodes.CStringConstant; +import jdk.graal.compiler.serviceprovider.JavaVersionUtil; import jdk.graal.compiler.word.Word; import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.Register; @@ -592,45 +595,71 @@ private static boolean tryExitInflated(Object object, Word thread, Word lock, bo int recursionsOffset = objectMonitorRecursionsOffset(INJECTED_VMCONFIG); Word recursions = monitor.readWord(recursionsOffset, OBJECT_MONITOR_RECURSION_LOCATION); if (probability(FAST_PATH_PROBABILITY, recursions.equal(0))) { - // recursions == 0 - int cxqOffset = objectMonitorCxqOffset(INJECTED_VMCONFIG); - Word cxq = monitor.readWord(cxqOffset, OBJECT_MONITOR_CXQ_LOCATION); - int entryListOffset = objectMonitorEntryListOffset(INJECTED_VMCONFIG); - Word entryList = monitor.readWord(entryListOffset, OBJECT_MONITOR_ENTRY_LIST_LOCATION); - if (probability(FREQUENT_PROBABILITY, cxq.or(entryList).equal(0))) { - // cxq == 0 && entryList == 0 - // Nobody is waiting, success - // release_store - memoryBarrier(MembarNode.FenceKind.STORE_RELEASE); - monitor.writeWord(ownerOffset, zero()); - traceObject(trace, "-lock{heavyweight:simple}", object, false); - counters.unlockHeavySimple.inc(); - return true; - } else { - int succOffset = objectMonitorSuccOffset(INJECTED_VMCONFIG); - Word succ = monitor.readWord(succOffset, OBJECT_MONITOR_SUCC_LOCATION); - if (probability(FREQUENT_PROBABILITY, succ.isNonNull())) { - // There may be a thread spinning on this monitor. Temporarily setting - // the monitor owner to null, and hope that the other thread will grab it. - monitor.writeWordVolatile(ownerOffset, zero()); - succ = monitor.readWordVolatile(succOffset, OBJECT_MONITOR_SUCC_LOCATION); - if (probability(NOT_FREQUENT_PROBABILITY, succ.isNonNull())) { - // We manage to release the monitor before the other running thread even - // notices. - traceObject(trace, "-lock{heavyweight:transfer}", object, false); - counters.unlockHeavyTransfer.inc(); - return true; - } else { - // Either the monitor is grabbed by a spinning thread, or the spinning - // thread parks. Now we attempt to reset the owner of the monitor. - if (probability(FREQUENT_PROBABILITY, !monitor.logicCompareAndSwapWord(ownerOffset, zero(), thread, OBJECT_MONITOR_OWNER_LOCATION))) { - // The monitor is stolen. + if (JavaVersionUtil.JAVA_SPEC == 21) { + // recursions == 0 + int cxqOffset = objectMonitorCxqOffset(INJECTED_VMCONFIG); + Word cxq = monitor.readWord(cxqOffset, OBJECT_MONITOR_CXQ_LOCATION); + int entryListOffset = objectMonitorEntryListOffset(INJECTED_VMCONFIG); + Word entryList = monitor.readWord(entryListOffset, OBJECT_MONITOR_ENTRY_LIST_LOCATION); + if (probability(FREQUENT_PROBABILITY, cxq.or(entryList).equal(0))) { + // cxq == 0 && entryList == 0 + // Nobody is waiting, success + // release_store + memoryBarrier(MembarNode.FenceKind.STORE_RELEASE); + monitor.writeWord(ownerOffset, zero()); + traceObject(trace, "-lock{heavyweight:simple}", object, false); + counters.unlockHeavySimple.inc(); + return true; + } else { + int succOffset = objectMonitorSuccOffset(INJECTED_VMCONFIG); + Word succ = monitor.readWord(succOffset, OBJECT_MONITOR_SUCC_LOCATION); + if (probability(FREQUENT_PROBABILITY, succ.isNonNull())) { + // There may be a thread spinning on this monitor. Temporarily setting + // the monitor owner to null, and hope that the other thread will grab it. + monitor.writeWordVolatile(ownerOffset, zero()); + succ = monitor.readWordVolatile(succOffset, OBJECT_MONITOR_SUCC_LOCATION); + if (probability(NOT_FREQUENT_PROBABILITY, succ.isNonNull())) { + // We manage to release the monitor before the other running thread even + // notices. traceObject(trace, "-lock{heavyweight:transfer}", object, false); counters.unlockHeavyTransfer.inc(); return true; + } else { + // Either the monitor is grabbed by a spinning thread, or the spinning + // thread parks. Now we attempt to reset the owner of the monitor. + if (probability(FREQUENT_PROBABILITY, !monitor.logicCompareAndSwapWord(ownerOffset, zero(), thread, OBJECT_MONITOR_OWNER_LOCATION))) { + // The monitor is stolen. + traceObject(trace, "-lock{heavyweight:transfer}", object, false); + counters.unlockHeavyTransfer.inc(); + return true; + } } } } + } else { + // Set owner to null. + memoryBarrier(MembarNode.FenceKind.STORE_RELEASE); + monitor.writeWord(ownerOffset, zero()); + memoryBarrier(MembarNode.FenceKind.STORE_LOAD); + Word cxq = monitor.readWord(objectMonitorCxqOffset(INJECTED_VMCONFIG), OBJECT_MONITOR_CXQ_LOCATION); + Word entryList = monitor.readWord(objectMonitorEntryListOffset(INJECTED_VMCONFIG), OBJECT_MONITOR_ENTRY_LIST_LOCATION); + // Check if the entry lists are empty. + if (probability(FREQUENT_PROBABILITY, cxq.or(entryList).equal(0))) { + traceObject(trace, "-lock{heavyweight:simple}", object, false); + counters.unlockHeavySimple.inc(); + return true; + } + // Check if there is a successor. + Word succ = monitor.readWord(objectMonitorSuccOffset(INJECTED_VMCONFIG), OBJECT_MONITOR_SUCC_LOCATION); + if (probability(FREQUENT_PROBABILITY, succ.isNonNull())) { + // We manage to release the monitor before the other running thread even + // notices. + traceObject(trace, "-lock{heavyweight:transfer}", object, false); + counters.unlockHeavyTransfer.inc(); + return true; + } else { + thread.writeWord(javaThreadUnlockedInflatedMonitorOffset(INJECTED_VMCONFIG), monitor, JAVA_THREAD_UNLOCKED_INFLATED_MONITOR_LOCATION); + } } } else { // Recursive inflated unlock diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/TypeCheckSnippetUtils.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/TypeCheckSnippetUtils.java index 9f1b1af857a2..eab2d9e8d694 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/TypeCheckSnippetUtils.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/TypeCheckSnippetUtils.java @@ -25,6 +25,18 @@ package jdk.graal.compiler.hotspot.replacements; import static jdk.graal.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_BITMAP_LOCATION; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_HASH_SLOT_LOCATION; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_SUPER_CHECK_OFFSET_LOCATION; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.METASPACE_ARRAY_LENGTH_LOCATION; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.PRIMARY_SUPERS_LOCATION; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.SECONDARY_SUPERS_LOCATION; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.SECONDARY_SUPER_CACHE_LOCATION; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.klassBitmapOffset; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.klassHashSlotOffset; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.metaspaceArrayLengthOffset; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.secondarySuperCacheOffset; +import static jdk.graal.compiler.hotspot.replacements.HotSpotReplacementsUtil.superCheckOffsetOffset; import static jdk.graal.compiler.hotspot.stubs.LookUpSecondarySupersTableStub.SECONDARY_SUPERS_TABLE_MASK; import static jdk.graal.compiler.hotspot.stubs.LookUpSecondarySupersTableStub.loadSecondarySupersElement; import static jdk.graal.compiler.nodes.extended.BranchProbabilityNode.FREQUENT_PROBABILITY; @@ -33,7 +45,6 @@ import java.util.Arrays; -import jdk.graal.compiler.api.replacements.Fold; import jdk.graal.compiler.debug.Assertions; import jdk.graal.compiler.hotspot.nodes.type.KlassPointerStamp; import jdk.graal.compiler.hotspot.stubs.LookUpSecondarySupersTableStub; @@ -56,14 +67,9 @@ */ public class TypeCheckSnippetUtils { - @Fold - static boolean isJDK21() { - return JavaVersionUtil.JAVA_SPEC == 21; - } - static boolean checkSecondarySubType(KlassPointer t, KlassPointer sNonNull, Counters counters) { // if (S.cache == T) return true - if (isJDK21() && sNonNull.readKlassPointer(HotSpotReplacementsUtil.secondarySuperCacheOffset(INJECTED_VMCONFIG), HotSpotReplacementsUtil.SECONDARY_SUPER_CACHE_LOCATION).equal(t)) { + if (JavaVersionUtil.JAVA_SPEC == 21 && sNonNull.readKlassPointer(secondarySuperCacheOffset(INJECTED_VMCONFIG), SECONDARY_SUPER_CACHE_LOCATION).equal(t)) { counters.cacheHit.inc(); return true; } @@ -73,11 +79,11 @@ static boolean checkSecondarySubType(KlassPointer t, KlassPointer sNonNull, Coun static boolean checkUnknownSubType(KlassPointer t, KlassPointer sNonNull, Counters counters) { // int off = T.offset - int superCheckOffset = t.readInt(HotSpotReplacementsUtil.superCheckOffsetOffset(INJECTED_VMCONFIG), HotSpotReplacementsUtil.KLASS_SUPER_CHECK_OFFSET_LOCATION); - boolean primary = superCheckOffset != HotSpotReplacementsUtil.secondarySuperCacheOffset(INJECTED_VMCONFIG); + int superCheckOffset = t.readInt(superCheckOffsetOffset(INJECTED_VMCONFIG), KLASS_SUPER_CHECK_OFFSET_LOCATION); + boolean primary = superCheckOffset != secondarySuperCacheOffset(INJECTED_VMCONFIG); if (primary) { - if (sNonNull.readKlassPointer(superCheckOffset, HotSpotReplacementsUtil.PRIMARY_SUPERS_LOCATION).equal(t)) { + if (sNonNull.readKlassPointer(superCheckOffset, PRIMARY_SUPERS_LOCATION).equal(t)) { // if (T = S[off]) return true counters.displayHit.inc(); return true; @@ -101,13 +107,13 @@ static boolean checkSelfAndSupers(KlassPointer t, KlassPointer s, Counters count return true; } - Word secondarySupers = s.readWord(HotSpotReplacementsUtil.secondarySupersOffset(INJECTED_VMCONFIG), HotSpotReplacementsUtil.SECONDARY_SUPERS_LOCATION); + Word secondarySupers = s.readWord(HotSpotReplacementsUtil.secondarySupersOffset(INJECTED_VMCONFIG), SECONDARY_SUPERS_LOCATION); - if (isJDK21()) { - int length = secondarySupers.readInt(HotSpotReplacementsUtil.metaspaceArrayLengthOffset(INJECTED_VMCONFIG), HotSpotReplacementsUtil.METASPACE_ARRAY_LENGTH_LOCATION); + if (JavaVersionUtil.JAVA_SPEC == 21) { + int length = secondarySupers.readInt(metaspaceArrayLengthOffset(INJECTED_VMCONFIG), METASPACE_ARRAY_LENGTH_LOCATION); for (int i = 0; i < length; i++) { if (probability(NOT_LIKELY_PROBABILITY, t.equal(loadSecondarySupersElement(secondarySupers, i)))) { - s.writeKlassPointer(HotSpotReplacementsUtil.secondarySuperCacheOffset(INJECTED_VMCONFIG), t, HotSpotReplacementsUtil.SECONDARY_SUPER_CACHE_LOCATION); + s.writeKlassPointer(secondarySuperCacheOffset(INJECTED_VMCONFIG), t, SECONDARY_SUPER_CACHE_LOCATION); counters.secondariesHit.inc(); return true; } @@ -143,8 +149,8 @@ static boolean checkSelfAndSupers(KlassPointer t, KlassPointer s, Counters count // Long.bitCount(S.bitmap << (63 - T.hash)) - 1 // bit will be folded when T is constant. - int bit = t.readByte(HotSpotReplacementsUtil.klassHashSlotOffset(INJECTED_VMCONFIG), HotSpotReplacementsUtil.KLASS_HASH_SLOT_LOCATION); - long bitmap = s.readLong(HotSpotReplacementsUtil.klassBitmapOffset(INJECTED_VMCONFIG), HotSpotReplacementsUtil.KLASS_BITMAP_LOCATION); + int bit = t.readByte(klassHashSlotOffset(INJECTED_VMCONFIG), KLASS_HASH_SLOT_LOCATION); + long bitmap = s.readLong(klassBitmapOffset(INJECTED_VMCONFIG), KLASS_BITMAP_LOCATION); long bitmapShifted = bitmap << (SECONDARY_SUPERS_TABLE_MASK - bit); if (probability(NOT_LIKELY_PROBABILITY, bitmapShifted >= 0)) { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/container/ContainerLibrary.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/container/ContainerLibrary.java index e3ac87060bd2..358760e9997f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/container/ContainerLibrary.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/container/ContainerLibrary.java @@ -79,13 +79,13 @@ @BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/compilerWarnings.hpp") @BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/globalDefinitions_gcc.hpp") @BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/globalDefinitions.hpp") -@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/macros.hpp") +@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+18/src/hotspot/share/utilities/macros.hpp") @BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/ostream.cpp") @BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/ostream.hpp") // The following annotations are for files in `src/svm`, which are completely customized for SVM @BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/logging/log.hpp") @BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/memory/allocation.cpp") -@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/runtime/globals.hpp") +@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+18/src/hotspot/share/runtime/globals.hpp") @BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/debug.cpp") @BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/debug.hpp") public class ContainerLibrary {