8234432: AOT tests failing with 'used 'epsilon gc' is different from current 'g1 gc'' after CMS removal
authordlong
Fri, 22 Nov 2019 19:23:30 -0800
changeset 59237 2601fc0874be
parent 59236 e2ee246e44e3
child 59239 9fe5d0d4e9c5
8234432: AOT tests failing with 'used 'epsilon gc' is different from current 'g1 gc'' after CMS removal Reviewed-by: kvn
src/hotspot/share/jvmci/vmStructs_jvmci.cpp
src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java
--- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp	Fri Nov 22 15:32:00 2019 -0800
+++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp	Fri Nov 22 19:23:30 2019 -0800
@@ -465,6 +465,13 @@
   declare_constant(CodeInstaller::INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED) \
   declare_constant(CodeInstaller::INVOKE_INVALID)                         \
                                                                           \
+  declare_constant(CollectedHeap::Serial)                                 \
+  declare_constant(CollectedHeap::Parallel)                               \
+  declare_constant(CollectedHeap::G1)                                     \
+  declare_constant(CollectedHeap::Epsilon)                                \
+  declare_constant(CollectedHeap::Z)                                      \
+  declare_constant(CollectedHeap::Shenandoah)                             \
+                                                                          \
   declare_constant(ConstantPool::CPCACHE_INDEX_TAG)                       \
   declare_constant(ConstantPool::_has_dynamic_constant)                   \
                                                                           \
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java	Fri Nov 22 15:32:00 2019 -0800
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java	Fri Nov 22 19:23:30 2019 -0800
@@ -51,6 +51,7 @@
 import org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory;
 import org.graalvm.compiler.hotspot.HotSpotGraalOptionValues;
 import org.graalvm.compiler.hotspot.HotSpotGraalRuntime;
+import org.graalvm.compiler.hotspot.HotSpotGraalRuntime.HotSpotGC;
 import org.graalvm.compiler.hotspot.HotSpotHostBackend;
 import org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin;
 import org.graalvm.compiler.java.GraphBuilderPhase;
@@ -223,7 +224,11 @@
                 System.gc();
             }
 
-            int gc = runtime.getGarbageCollector().ordinal() + 1;
+            HotSpotGC graal_gc = runtime.getGarbageCollector();
+            int def = graal_gc.ordinal() + 1;
+            String name = "CollectedHeap::" + graal_gc.name();
+            int gc = graalHotSpotVMConfig.getConstant(name, Integer.class, def);
+
             BinaryContainer binaryContainer = new BinaryContainer(graalOptions, graalHotSpotVMConfig, graphBuilderConfig, gc, JVM_VERSION);
             DataBuilder dataBuilder = new DataBuilder(this, backend, classes, binaryContainer);
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java	Fri Nov 22 15:32:00 2019 -0800
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java	Fri Nov 22 19:23:30 2019 -0800
@@ -232,6 +232,7 @@
         // Supported GCs
         Serial(true, "UseSerialGC"),
         Parallel(true, "UseParallelGC", "UseParallelOldGC"),
+        CMS(true, "UseConcMarkSweepGC"),
         G1(true, "UseG1GC"),
 
         // Unsupported GCs