From be121573e9f7a13d1595a3a5901fc2974c995a61 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Fri, 6 Dec 2024 15:36:46 +0100 Subject: [PATCH 1/9] set max test time compiler unit tests to 5 mins --- compiler/mx.compiler/mx_compiler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/mx.compiler/mx_compiler.py b/compiler/mx.compiler/mx_compiler.py index 4aec44e0ad36..69beea9f0763 100644 --- a/compiler/mx.compiler/mx_compiler.py +++ b/compiler/mx.compiler/mx_compiler.py @@ -834,6 +834,10 @@ def apply(self, config): vmArgs.append('-Djdk.graal.TrackNodeSourcePosition=true') vmArgs.append('-esa') + if '-JUnitMaxTestTime' not in mainClassArgs: + # The max time (in seconds) for any compiler unit test + mainClassArgs.extend(['-JUnitMaxTestTime', '300']) + # Always run unit tests without UseJVMCICompiler unless explicitly requested if _get_XX_option_value(vmArgs, 'UseJVMCICompiler', None) is None: vmArgs.append('-XX:-UseJVMCICompiler') From e2a660b07f6f069210714bfd79d3ce5a93a21d39 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Wed, 8 Jan 2025 17:12:18 -0800 Subject: [PATCH 2/9] Properly run each HumongousReferenceObjectTest test individually in separate invocation --- .../test/HumongousReferenceObjectTest.java | 38 +++++++++++++++---- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HumongousReferenceObjectTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HumongousReferenceObjectTest.java index 49b4368c330c..98923d117d99 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HumongousReferenceObjectTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HumongousReferenceObjectTest.java @@ -29,9 +29,11 @@ import java.util.Collections; import java.util.List; -import jdk.graal.compiler.core.test.SubprocessTest; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.TestName; +import jdk.graal.compiler.core.test.SubprocessTest; import jdk.internal.vm.annotation.Contended; @SuppressWarnings("unused") @@ -51,6 +53,8 @@ public static void testSnippet() { } } + @Rule public TestName currentTest = new TestName(); + public void runSubprocessTest(String... args) throws IOException, InterruptedException { List newArgs = new ArrayList<>(); Collections.addAll(newArgs, args); @@ -59,23 +63,41 @@ public void runSubprocessTest(String... args) throws IOException, InterruptedExc newArgs.remove("-XX:+UseG1GC"); newArgs.remove("-XX:+UseParallelGC"); - launchSubprocess(() -> { + launchSubprocess(currentTest.getMethodName(), () -> { test("testSnippet"); }, newArgs.toArray(new String[0])); // Test without assertions as well newArgs.add("-da"); - launchSubprocess(() -> { + launchSubprocess(currentTest.getMethodName(), () -> { test("testSnippet"); }, newArgs.toArray(new String[0])); } + // Checkstyle: stop method name check @Test - public void testG1() throws IOException, InterruptedException { - String[] sizes = {"-XX:G1HeapRegionSize=1M", "-XX:G1HeapRegionSize=2M", "-XX:G1HeapRegionSize=4M", "-XX:G1HeapRegionSize=8M"}; - for (String size : sizes) { - runSubprocessTest("-XX:+UseG1GC", "-XX:+EnableContended", "-XX:-RestrictContended", "-Xmx128m", "-XX:ContendedPaddingWidth=8192", size); - } + public void testG1_1M() throws IOException, InterruptedException { + testG1("-XX:G1HeapRegionSize=1M"); + } + + @Test + public void testG1_2M() throws IOException, InterruptedException { + testG1("-XX:G1HeapRegionSize=2M"); + } + + @Test + public void testG1_4M() throws IOException, InterruptedException { + testG1("-XX:G1HeapRegionSize=4M"); + } + + @Test + public void testG1_8M() throws IOException, InterruptedException { + testG1("-XX:G1HeapRegionSize=9M"); + } + // Checkstyle: resume method name check + + public void testG1(String size) throws IOException, InterruptedException { + runSubprocessTest("-XX:+UseG1GC", "-XX:+EnableContended", "-XX:-RestrictContended", "-Xmx128m", "-XX:ContendedPaddingWidth=8192", size); } @Test From 2c98339f33bab92469afa6764db8a6b325e1ff49 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Thu, 9 Jan 2025 09:06:36 -0800 Subject: [PATCH 3/9] SubprocessTest should only run the current unit test in the subprocess --- .../jdk21/test/PreviewEnabledTest.java | 2 +- .../compiler/core/test/SubprocessTest.java | 27 ++++------- .../ea/ReadEliminationCodeEmissionTest.java | 4 +- .../hotspot/test/GCBarrierEmissionTest.java | 45 ++++++++++--------- .../test/HumongousReferenceObjectTest.java | 8 +--- .../hotspot/test/SafeConstructionTest.java | 14 +++--- .../jdk/graal/compiler/test/GraalTest.java | 11 +++++ 7 files changed, 55 insertions(+), 56 deletions(-) diff --git a/compiler/src/jdk.graal.compiler.hotspot.jdk21.test/src/jdk/graal/compiler/hotspot/jdk21/test/PreviewEnabledTest.java b/compiler/src/jdk.graal.compiler.hotspot.jdk21.test/src/jdk/graal/compiler/hotspot/jdk21/test/PreviewEnabledTest.java index baee9c47743c..da7e9b435c1c 100644 --- a/compiler/src/jdk.graal.compiler.hotspot.jdk21.test/src/jdk/graal/compiler/hotspot/jdk21/test/PreviewEnabledTest.java +++ b/compiler/src/jdk.graal.compiler.hotspot.jdk21.test/src/jdk/graal/compiler/hotspot/jdk21/test/PreviewEnabledTest.java @@ -57,6 +57,6 @@ public void testBody() { @Test public void testInSubprocess() throws IOException, InterruptedException { - SubprocessTest.launchSubprocess(getClass(), this::testBody, "--enable-preview"); + SubprocessTest.launchSubprocess(getClass(), currentUnitTestName(), this::testBody, "--enable-preview"); } } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java index 5511c631c615..46ce44b3f90e 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java @@ -67,29 +67,20 @@ public abstract class SubprocessTest extends GraalCompilerTest { * {@link Subprocess} instance describing the process after its successful termination. */ public SubprocessUtil.Subprocess launchSubprocess(Runnable runnable, String... args) throws InterruptedException, IOException { - return launchSubprocess(null, null, true, getClass(), null, runnable, args); - } - - /** - * Like {@link #launchSubprocess(Runnable, String...)}, but with an extra {@code testSelector} - * to specify a specific test method to execute in the test class. - */ - public SubprocessUtil.Subprocess launchSubprocess(String testSelector, Runnable runnable, String... args) throws InterruptedException, IOException { - return launchSubprocess(null, null, true, getClass(), testSelector, runnable, args); + return launchSubprocess(null, null, true, getClass(), currentUnitTestName(), runnable, args); } public SubprocessUtil.Subprocess launchSubprocess(Predicate vmArgsFilter, Runnable runnable, String... args) throws InterruptedException, IOException { - return launchSubprocess(null, vmArgsFilter, true, getClass(), null, runnable, args); + return launchSubprocess(null, vmArgsFilter, true, getClass(), currentUnitTestName(), runnable, args); } - public static SubprocessUtil.Subprocess launchSubprocess(Class testClass, Runnable runnable, String... args) throws InterruptedException, IOException { - return launchSubprocess(null, null, true, testClass, null, runnable, args); + public SubprocessUtil.Subprocess launchSubprocess(Class testClass, Runnable runnable, String... args) throws InterruptedException, IOException { + return launchSubprocess(null, null, true, testClass, currentUnitTestName(), runnable, args); } - public static SubprocessUtil.Subprocess launchSubprocess(Predicate> testPredicate, Predicate vmArgsFilter, boolean expectNormalExit, - Class testClass, Runnable runnable, String... args) + public static SubprocessUtil.Subprocess launchSubprocess(Class testClass, String testSelector, Runnable runnable, String... args) throws InterruptedException, IOException { - return launchSubprocess(testPredicate, vmArgsFilter, expectNormalExit, testClass, null, runnable, args); + return launchSubprocess(null, null, true, testClass, testSelector, runnable, args); } private static List filter(List args, Predicate vmArgsFilter) { @@ -131,10 +122,8 @@ public static SubprocessUtil.Subprocess launchSubprocess(Predicate> List mainClassAndArgs = new LinkedList<>(); mainClassAndArgs.add("com.oracle.mxtool.junit.MxJUnitWrapper"); - String testName = testClass.getName(); - if (testSelector != null) { - testName += "#" + testSelector; - } + assert testSelector != null : "must pass the name of the current unit test"; + String testName = testClass.getName() + "#" + testSelector; mainClassAndArgs.add(testName); boolean junitVerbose = getProcessCommandLine().contains("-JUnitVerbose"); if (junitVerbose) { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ea/ReadEliminationCodeEmissionTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ea/ReadEliminationCodeEmissionTest.java index aede29a1bcf1..a24cb2969b85 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ea/ReadEliminationCodeEmissionTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ea/ReadEliminationCodeEmissionTest.java @@ -60,7 +60,7 @@ public static int accessVolatile1Snippet(A a) { @Test public void accessVolatile1() { - runTest("accessVolatile1", new A(12)); + runTest(currentUnitTestName(), new A(12)); } public void runTest(String baseName, Object... args) { @@ -120,7 +120,7 @@ public void runTest(String baseName, Object... args) { "-Dgraal.Dump=:5"}; } try { - subprocess = launchSubprocess(baseName, run, vmArgs); + subprocess = launchSubprocess(run, vmArgs); } catch (InterruptedException | IOException e) { throw new RuntimeException(e); } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/GCBarrierEmissionTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/GCBarrierEmissionTest.java index 291b2eb886e0..9705268d65b9 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/GCBarrierEmissionTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/GCBarrierEmissionTest.java @@ -92,7 +92,7 @@ public static Object fieldReadBarrierSnippet(TestObject t) { @Test public void fieldReadBarrier() { - runTest("fieldReadBarrier", new TestObject()); + runTest(new TestObject()); } public static void fieldWriteBarrierSnippet(TestObject t, Object value) { @@ -101,7 +101,7 @@ public static void fieldWriteBarrierSnippet(TestObject t, Object value) { @Test public void fieldWriteBarrier() { - runTest("fieldWriteBarrier", new TestObject(), "string"); + runTest(new TestObject(), "string"); } public static void volatileFieldWriteBarrierSnippet(TestObject t, Object value) { @@ -110,7 +110,7 @@ public static void volatileFieldWriteBarrierSnippet(TestObject t, Object value) @Test public void volatileFieldWriteBarrier() { - runTest("volatileFieldWriteBarrier", new TestObject(), "string"); + runTest(new TestObject(), "string"); } public static void arrayWriteBarrierSnippet(Object[] t, Object value) { @@ -119,7 +119,7 @@ public static void arrayWriteBarrierSnippet(Object[] t, Object value) { @Test public void arrayWriteBarrier() { - runTest("arrayWriteBarrier", new Object[1], "string"); + runTest(new Object[1], "string"); } public static void volatileArrayWriteBarrierSnippet(Object[] t, Object value) { @@ -131,7 +131,7 @@ public static void volatileArrayWriteBarrierSnippet(Object[] t, Object value) { @Test public void volatileArrayWriteBarrier() { - runTest("volatileArrayWriteBarrier", new Object[1], "string"); + runTest(new Object[1], "string"); } public static void fieldWriteNullBarrierSnippet(TestObject t) { @@ -140,7 +140,7 @@ public static void fieldWriteNullBarrierSnippet(TestObject t) { @Test public void fieldWriteNullBarrier() { - runTest("fieldWriteNullBarrier", new TestObject()); + runTest(new TestObject()); } public static void volatileFieldWriteNullBarrierSnippet(TestObject t) { @@ -149,7 +149,7 @@ public static void volatileFieldWriteNullBarrierSnippet(TestObject t) { @Test public void volatileFieldWriteNullBarrier() { - runTest("volatileFieldWriteNullBarrier", new TestObject()); + runTest(new TestObject()); } public static void arrayWriteNullBarrierSnippet(Object[] t) { @@ -158,7 +158,7 @@ public static void arrayWriteNullBarrierSnippet(Object[] t) { @Test public void arrayWriteNullBarrier() { - runTest("arrayWriteNullBarrier", new Object[]{new Object[1]}); + runTest(new Object[]{new Object[1]}); } public static Object valueCompareAndSwapBarrierSnippet(TestObject t1, Object value) { @@ -174,7 +174,7 @@ public void valueCompareAndSwapBarrier() { assertTrue(graph.getNodes().filter(ValueCompareAndSwapNode.class).isNotEmpty(), "expected ValueCompareAndSwapNode"); return true; }; - runTest("valueCompareAndSwapBarrier", nodePredicate, supply(TestObject::new), "string"); + runTest(nodePredicate, supply(TestObject::new), "string"); } public static boolean logicCompareAndSwapBarrierSnippet(TestObject t1, Object value) { @@ -190,7 +190,7 @@ public void logicCompareAndSwapBarrier() { assertTrue(graph.getNodes().filter(LogicCompareAndSwapNode.class).isNotEmpty(), "expected LogicCompareAndSwapNode"); return true; }; - runTest("logicCompareAndSwapBarrier", nodePredicate, supply(TestObject::new), "string"); + runTest(nodePredicate, supply(TestObject::new), "string"); } public static Object getAndSetBarrierSnippet(TestObject t1, Object value) { @@ -206,7 +206,7 @@ public void getAndSetBarrier() { assertTrue(graph.getNodes().filter(LoweredAtomicReadAndWriteNode.class).isNotEmpty(), "expected LoweredAtomicReadAndWriteNode"); return true; }; - runTest("getAndSetBarrier", nodePredicate, supply(TestObject::new), "string"); + runTest(nodePredicate, supply(TestObject::new), "string"); } public static boolean phantomRefersToBarrierSnippet(PhantomReference phantom, Object value) { @@ -216,7 +216,7 @@ public static boolean phantomRefersToBarrierSnippet(PhantomReference pha @Test public void phantomRefersToBarrier() { ReferenceQueue queue = new ReferenceQueue<>(); - runTest("phantomRefersToBarrier", new PhantomReference<>("string", queue), "string"); + runTest(new PhantomReference<>("string", queue), "string"); } public static boolean weakRefersToBarrierSnippet(WeakReference weak, Object value) { @@ -225,7 +225,7 @@ public static boolean weakRefersToBarrierSnippet(WeakReference weak, Obj @Test public void weakRefersToBarrier() { - runTest("weakRefersToBarrier", new WeakReference<>("string"), "string"); + runTest(new WeakReference<>("string"), "string"); } public static Object referenceGetBarrierSnippet(WeakReference weak) { @@ -234,7 +234,7 @@ public static Object referenceGetBarrierSnippet(WeakReference weak) { @Test public void referenceGetBarrier() { - runTest("referenceGetBarrier", new WeakReference<>("string")); + runTest(new WeakReference<>("string")); } public static TestObject objectAllocationBarrierSnippet() { @@ -243,7 +243,7 @@ public static TestObject objectAllocationBarrierSnippet() { @Test public void objectAllocationBarrier() { - runTest("objectAllocationBarrier"); + runTest(); } public static String stringAllocationBarrierSnippet() { @@ -252,7 +252,7 @@ public static String stringAllocationBarrierSnippet() { @Test public void stringAllocationBarrier() { - runTest("stringAllocationBarrier"); + runTest(); } private static TestObject obj6 = new TestObject(6); @@ -265,7 +265,7 @@ public static Object testuuvCAESnippet() { @Test public void testuuvCAE() { - runTest("testuuvCAE"); + runTest(); } public static Object threadHandleBarrierSnippet() { @@ -274,7 +274,7 @@ public static Object threadHandleBarrierSnippet() { @Test public void threadHandleBarrier() { - runTest("threadHandleBarrier"); + runTest(); } @Override @@ -286,11 +286,12 @@ protected void checkLowTierGraph(StructuredGraph graph) { Predicate graphPredicate; - public void runTest(String baseName, Object... args) { - runTest(baseName, null, args); + public void runTest(Object... args) { + runTest(null, args); } - public void runTest(String baseName, Predicate predicate, Object... args) { + public void runTest(Predicate predicate, Object... args) { + String baseName = currentUnitTestName(); String snippetName = baseName + "Snippet"; String methodSpec = getClass().getName() + "::" + snippetName; Method m = getMethod(snippetName); @@ -350,7 +351,7 @@ public void runTest(String baseName, Predicate predicate, Objec "-XX:LogFile=" + logName}; } try { - subprocess = launchSubprocess(baseName, run, vmArgs); + subprocess = launchSubprocess(run, vmArgs); } catch (InterruptedException | IOException e) { throw new RuntimeException(e); } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HumongousReferenceObjectTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HumongousReferenceObjectTest.java index 98923d117d99..ba31fdcf6f97 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HumongousReferenceObjectTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HumongousReferenceObjectTest.java @@ -29,9 +29,7 @@ import java.util.Collections; import java.util.List; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.TestName; import jdk.graal.compiler.core.test.SubprocessTest; import jdk.internal.vm.annotation.Contended; @@ -53,8 +51,6 @@ public static void testSnippet() { } } - @Rule public TestName currentTest = new TestName(); - public void runSubprocessTest(String... args) throws IOException, InterruptedException { List newArgs = new ArrayList<>(); Collections.addAll(newArgs, args); @@ -63,13 +59,13 @@ public void runSubprocessTest(String... args) throws IOException, InterruptedExc newArgs.remove("-XX:+UseG1GC"); newArgs.remove("-XX:+UseParallelGC"); - launchSubprocess(currentTest.getMethodName(), () -> { + launchSubprocess(() -> { test("testSnippet"); }, newArgs.toArray(new String[0])); // Test without assertions as well newArgs.add("-da"); - launchSubprocess(currentTest.getMethodName(), () -> { + launchSubprocess(() -> { test("testSnippet"); }, newArgs.toArray(new String[0])); } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/SafeConstructionTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/SafeConstructionTest.java index 29125e17b935..8991482e8b5d 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/SafeConstructionTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/SafeConstructionTest.java @@ -30,7 +30,14 @@ import java.lang.reflect.Constructor; import java.util.List; +import org.junit.Assert; +import org.junit.Test; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.MethodVisitor; + import com.oracle.truffle.api.impl.asm.Opcodes; + import jdk.graal.compiler.core.test.SubprocessTest; import jdk.graal.compiler.nodes.StructuredGraph; import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; @@ -40,11 +47,6 @@ import jdk.graal.compiler.test.AddExports; import jdk.internal.vm.annotation.Stable; import jdk.vm.ci.meta.ResolvedJavaMethod; -import org.junit.Assert; -import org.junit.Test; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.FieldVisitor; -import org.objectweb.asm.MethodVisitor; /** * Assert that a barrier is inserted at the end of a constructor that writes to Stable fields or if @@ -89,7 +91,7 @@ public void checkAlwaysSafeConstructors() throws NoSuchMethodException { @Test public void runCheckStableWriteConstructors() throws IOException, InterruptedException { - launchSubprocess("runCheckStableWriteConstructors", this::checkStableWriteConstructors, "--add-opens=java.base/java.lang=ALL-UNNAMED"); + launchSubprocess(this::checkStableWriteConstructors, "--add-opens=java.base/java.lang=ALL-UNNAMED"); } private void checkStableWriteConstructors() { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/test/GraalTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/test/GraalTest.java index 233a30fbe2af..52ee0f9a03e1 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/test/GraalTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/test/GraalTest.java @@ -47,9 +47,11 @@ import org.junit.After; import org.junit.Assert; import org.junit.AssumptionViolatedException; +import org.junit.Rule; import org.junit.internal.ComparisonCriteria; import org.junit.internal.ExactComparisonCriteria; import org.junit.rules.DisableOnDebug; +import org.junit.rules.TestName; import org.junit.rules.TestRule; import org.junit.rules.Timeout; @@ -72,6 +74,15 @@ public class GraalTest { public static final Unsafe UNSAFE = Unsafe.getUnsafe(); + @Rule public TestName currentUnitTestName = new TestName(); + + /** + * Returns the name of the current unit test being run. + */ + public String currentUnitTestName() { + return currentUnitTestName.getMethodName(); + } + protected Method getMethod(String methodName) { return getMethod(getClass(), methodName); } From e3a134c2e8bdebb8a089d8da7a22ef88ae75fbd4 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Mon, 17 Feb 2025 12:30:13 -0800 Subject: [PATCH 4/9] Run all tests in StringIntrinsicAVX3ThresholdTest --- .../graal/compiler/core/test/SubprocessTest.java | 8 +++----- .../test/StringIntrinsicAVX3ThresholdTest.java | 13 ++++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java index 46ce44b3f90e..c62026ef8288 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java @@ -74,10 +74,6 @@ public SubprocessUtil.Subprocess launchSubprocess(Predicate vmArgsFilter return launchSubprocess(null, vmArgsFilter, true, getClass(), currentUnitTestName(), runnable, args); } - public SubprocessUtil.Subprocess launchSubprocess(Class testClass, Runnable runnable, String... args) throws InterruptedException, IOException { - return launchSubprocess(null, null, true, testClass, currentUnitTestName(), runnable, args); - } - public static SubprocessUtil.Subprocess launchSubprocess(Class testClass, String testSelector, Runnable runnable, String... args) throws InterruptedException, IOException { return launchSubprocess(null, null, true, testClass, testSelector, runnable, args); @@ -93,6 +89,8 @@ private static List filter(List args, Predicate vmArgsFi return result; } + public static final String ALL_TESTS = "ALL_TESTS"; + public boolean isRecursiveLaunch() { return isRecursiveLaunch(getClass()); } @@ -123,7 +121,7 @@ public static SubprocessUtil.Subprocess launchSubprocess(Predicate> List mainClassAndArgs = new LinkedList<>(); mainClassAndArgs.add("com.oracle.mxtool.junit.MxJUnitWrapper"); assert testSelector != null : "must pass the name of the current unit test"; - String testName = testClass.getName() + "#" + testSelector; + String testName = testSelector.equals(ALL_TESTS) ? testClass.getName() : testClass.getName() + "#" + testSelector; mainClassAndArgs.add(testName); boolean junitVerbose = getProcessCommandLine().contains("-JUnitVerbose"); if (junitVerbose) { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/StringIntrinsicAVX3ThresholdTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/StringIntrinsicAVX3ThresholdTest.java index 7fdc04073c1c..965cb386cbf6 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/StringIntrinsicAVX3ThresholdTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/StringIntrinsicAVX3ThresholdTest.java @@ -52,8 +52,7 @@ public void before() { */ } - @SuppressWarnings("unused") - public void testWithAVX3Threshold(String testSelector, Class testClass) { + public void testWithAVX3Threshold(Class testClass) { Runnable nopRunnable = () -> { /* * The runnable is only relevant when running a test in the same class as the parent @@ -62,7 +61,7 @@ public void testWithAVX3Threshold(String testSelector, Class Date: Mon, 17 Feb 2025 21:15:38 +0000 Subject: [PATCH 5/9] added javadoc to ALL_TESTS --- .../src/jdk/graal/compiler/core/test/SubprocessTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java index c62026ef8288..19a9b9ca1a6c 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java @@ -89,6 +89,9 @@ private static List filter(List args, Predicate vmArgsFi return result; } + /** + * Sentinel value meaning all tests in the specified test class are to be run. + */ public static final String ALL_TESTS = "ALL_TESTS"; public boolean isRecursiveLaunch() { From 3e6fb33d994b57a93a0f7ca1a0daef3cef7f3dd9 Mon Sep 17 00:00:00 2001 From: Josef Eisl Date: Wed, 19 Feb 2025 09:49:31 +0000 Subject: [PATCH 6/9] ci: move javadoc post-merge to jdk latest --- ci_includes/publish-javadoc.jsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci_includes/publish-javadoc.jsonnet b/ci_includes/publish-javadoc.jsonnet index 86b18a84f4f6..c77d79fad2b6 100644 --- a/ci_includes/publish-javadoc.jsonnet +++ b/ci_includes/publish-javadoc.jsonnet @@ -4,7 +4,7 @@ local linux_amd64 = common.linux_amd64, local javadoc_publisher = { - name: 'graal-publish-javadoc-' + utils.prefixed_jdk(self.jdk_version), + name: 'graal-publish-javadoc-' + self.jdk_name, run+: [ ["cd", "./sdk"], ["mx", "build"], @@ -59,7 +59,7 @@ }, local all_builds = [ - common.post_merge + linux_amd64 + common.labsjdk21 + javadoc_publisher, + common.post_merge + linux_amd64 + common.labsjdkLatest + javadoc_publisher, ], // adds a "defined_in" field to all builds mentioning the location of this current file builds:: utils.add_defined_in(all_builds, std.thisFile), From 3f48227bda438ae0cf0ad672f88ee263a00e667f Mon Sep 17 00:00:00 2001 From: Josef Eisl Date: Wed, 19 Feb 2025 10:21:44 +0000 Subject: [PATCH 7/9] tools: move gate-tools-javadoc to JDK latest --- tools/ci/ci.jsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci/ci.jsonnet b/tools/ci/ci.jsonnet index 947c90e57dad..fa3e96448120 100644 --- a/tools/ci/ci.jsonnet +++ b/tools/ci/ci.jsonnet @@ -43,7 +43,7 @@ }, local tools_javadoc = tools_common + common_guard + { - name: "gate-tools-javadoc", + name: "gate-tools-javadoc-" + self.jdk_name, run: [ ["mx", "build"], ["mx", "javadoc"], @@ -85,7 +85,7 @@ common.linux_amd64 + common.oraclejdkLatest + tools_gate, common.linux_amd64 + common.oraclejdk21 + tools_gate, - common.linux_amd64 + common.oraclejdk21 + tools_javadoc, + common.linux_amd64 + common.oraclejdkLatest + tools_javadoc, common.linux_amd64 + common.oraclejdk21 + tools_coverage_weekly, common.linux_aarch64 + common.labsjdkLatest + tools_weekly, common.linux_aarch64 + common.labsjdk21 + tools_weekly, From 74b27763fdcddd94c824cd0f049b3961950f588d Mon Sep 17 00:00:00 2001 From: Josef Eisl Date: Wed, 19 Feb 2025 10:22:26 +0000 Subject: [PATCH 8/9] truffle: move gate-truffle-javadoc to JDK latest --- truffle/ci/ci.jsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/truffle/ci/ci.jsonnet b/truffle/ci/ci.jsonnet index 2999241643cf..21ec59970055 100644 --- a/truffle/ci/ci.jsonnet +++ b/truffle/ci/ci.jsonnet @@ -121,8 +121,8 @@ linux_amd64 + common.oraclejdk21 + truffle_gate + guard + {timelimit: "45:00"}, linux_amd64 + common.oraclejdkLatest + truffle_gate + guard + {environment+: {DISABLE_DSL_STATE_BITS_TESTS: "true"}}, - truffle_common + linux_amd64 + common.oraclejdk21 + guard { - name: "gate-truffle-javadoc", + truffle_common + linux_amd64 + common.oraclejdkLatest + guard { + name: "gate-truffle-javadoc-" + self.jdk_name, run: [ ["mx", "build"], ["mx", "javadoc"], From 25dff4d91b434baa14959f89ebe26131fff700ea Mon Sep 17 00:00:00 2001 From: Josef Eisl Date: Wed, 19 Feb 2025 10:19:09 +0000 Subject: [PATCH 9/9] truffle: fix javadoc problems --- .../src/com/oracle/truffle/api/bytecode/Instruction.java | 2 +- .../src/com/oracle/truffle/api/InternalResource.java | 2 +- .../src/com/oracle/truffle/api/nodes/RootNode.java | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/Instruction.java b/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/Instruction.java index 3fc5382af2ea..ebd63c8c8ab9 100644 --- a/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/Instruction.java +++ b/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/Instruction.java @@ -92,7 +92,7 @@ protected Instruction(Object token) { * {@link BytecodeNode}, it is therefore recommended to use {@link #getLocation()} instead * whenever possible. * - * @ee {@link #getLocation()} + * @see #getLocation() * @since 24.2 */ public abstract int getBytecodeIndex(); diff --git a/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/InternalResource.java b/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/InternalResource.java index 4cf820257a78..15c65a2bd299 100644 --- a/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/InternalResource.java +++ b/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/InternalResource.java @@ -105,7 +105,7 @@ * * The resource files are listed in the * {@code META-INF/resources/////file-list} file. For the file - * list format, refer to {@link InternalResource.Env#unpackFiles(Env, Path)}. Additionally, the + * list format, refer to {@link InternalResource#unpackFiles(Env, Path)}. Additionally, the * {@code META-INF/resources/////sha256} file contains an * SHA-256 hash of the resource files. It is recommended to use non-encapsulated resource paths that * include the component ID and resource ID, as this helps prevent ambiguity when the language or diff --git a/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java b/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java index 17b38d87307b..d155349e9ff5 100644 --- a/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java +++ b/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java @@ -651,15 +651,15 @@ protected Node findInstrumentableCallNode(Node callNode, Frame frame, int byteco /** * Provide a list of stack frames that led to a schedule of asynchronous execution of this root * node on the provided frame. The asynchronous frames are expected to be found here when - * {@link Env#getAsynchronousStackDepth()} is positive. The language is free to provide - * asynchronous frames or longer list of frames when it's of no performance penalty, or if - * requested by other options. This method is invoked on slow-paths only and with a context + * {@link TruffleLanguage#getAsynchronousStackDepth()} is positive. The language is free to + * provide asynchronous frames or longer list of frames when it's of no performance penalty, or + * if requested by other options. This method is invoked on slow-paths only and with a context * entered. * * @param frame A frame, never null * @return a list of {@link TruffleStackTraceElement}, or null when no asynchronous * stack is available. - * @see Env#getAsynchronousStackDepth() + * @see TruffleLanguage#getAsynchronousStackDepth() * @since 20.1.0 */ protected List findAsynchronousFrames(Frame frame) {