changeset 60109:374452022582

8238758: [JVMCI] fix JVMCI jtreg events tests to work with GraalVM Reviewed-by: kvn, dlong, never
author dnsimon
date Fri, 14 Feb 2020 09:25:43 -0800
parents 8d03748fae04
children 9b4d873446c9
files src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java test/hotspot/jtreg/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java test/hotspot/jtreg/compiler/jvmci/events/JvmciNotifyInstallEventTest.java test/hotspot/jtreg/compiler/jvmci/events/JvmciShutdownEventTest.java
diffstat 4 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java	Mon Jan 13 10:00:30 2020 +0100
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java	Fri Feb 14 09:25:43 2020 -0800
@@ -34,6 +34,7 @@
 import jdk.vm.ci.runtime.JVMCIRuntime;
 import jdk.vm.ci.services.JVMCIPermission;
 import jdk.vm.ci.services.JVMCIServiceLocator;
+import jdk.vm.ci.services.Services;
 
 import static jdk.vm.ci.services.Services.IS_IN_NATIVE_IMAGE;
 
@@ -96,6 +97,11 @@
                         }
                     }
                     if (factory == null) {
+                        if (Services.IS_IN_NATIVE_IMAGE) {
+                            throw new JVMCIError("JVMCI compiler '%s' not found in JVMCI native library.%n" +
+                                            "Use -XX:-UseJVMCINativeLibrary when specifying a JVMCI compiler available on a class path with %s.",
+                                            compilerName, Option.Compiler.getPropertyName());
+                        }
                         throw new JVMCIError("JVMCI compiler '%s' not found", compilerName);
                     }
                 }
--- a/test/hotspot/jtreg/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java	Mon Jan 13 10:00:30 2020 +0100
+++ b/test/hotspot/jtreg/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java	Fri Feb 14 09:25:43 2020 -0800
@@ -47,12 +47,12 @@
  *      compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:.
- *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
+ *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI -XX:-UseJVMCINativeLibrary
  *     -Dcompiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest.bootstrap=false
  *     compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:.
- *     -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI
+ *     -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -XX:-UseJVMCINativeLibrary
  *     -Dcompiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest.bootstrap=true
  *     compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
  */
--- a/test/hotspot/jtreg/compiler/jvmci/events/JvmciNotifyInstallEventTest.java	Mon Jan 13 10:00:30 2020 +0100
+++ b/test/hotspot/jtreg/compiler/jvmci/events/JvmciNotifyInstallEventTest.java	Fri Feb 14 09:25:43 2020 -0800
@@ -48,11 +48,12 @@
  *      compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:.
- *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
+ *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI -XX:-UseJVMCINativeLibrary
  *     compiler.jvmci.events.JvmciNotifyInstallEventTest
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:.
  *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI -XX:JVMCINMethodSizeLimit=0
+ *     -XX:-UseJVMCINativeLibrary
  *     compiler.jvmci.events.JvmciNotifyInstallEventTest
  */
 
--- a/test/hotspot/jtreg/compiler/jvmci/events/JvmciShutdownEventTest.java	Mon Jan 13 10:00:30 2020 +0100
+++ b/test/hotspot/jtreg/compiler/jvmci/events/JvmciShutdownEventTest.java	Fri Feb 14 09:25:43 2020 -0800
@@ -43,7 +43,8 @@
  *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilationRequestResult
  *      compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener
  *      compiler.jvmci.events.JvmciShutdownEventListener
- * @run main/othervm compiler.jvmci.events.JvmciShutdownEventTest
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions
+ *      compiler.jvmci.events.JvmciShutdownEventTest
  */
 
 package compiler.jvmci.events;
@@ -66,7 +67,7 @@
                 "Unexpected exit code with +EnableJVMCI",
                 "Unexpected output with +EnableJVMCI", ExitCode.OK,
                 addTestVMOptions, "-XX:+UnlockExperimentalVMOptions",
-                "-XX:+EnableJVMCI", "-Xbootclasspath/a:.",
+                "-XX:+EnableJVMCI", "-XX:-UseJVMCICompiler", "-Xbootclasspath/a:.",
                 JvmciShutdownEventListener.class.getName()
         );