8203370: [JVMCI] UseJVMCICompiler should imply EnableJVMCI
authordlong
Tue, 29 May 2018 12:06:05 -0700
changeset 50296 75681fe34e32
parent 50295 84256425a4e9
child 50297 580744d900c8
8203370: [JVMCI] UseJVMCICompiler should imply EnableJVMCI Reviewed-by: kvn
src/hotspot/share/runtime/arguments.cpp
test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java
--- a/src/hotspot/share/runtime/arguments.cpp	Tue May 29 21:01:13 2018 +0200
+++ b/src/hotspot/share/runtime/arguments.cpp	Tue May 29 12:06:05 2018 -0700
@@ -3365,6 +3365,10 @@
   UNSUPPORTED_OPTION(TieredCompilation);
 #endif
 
+  if (!check_vm_args_consistency()) {
+    return JNI_ERR;
+  }
+
 #if INCLUDE_JVMCI
   if (EnableJVMCI &&
       !create_numbered_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) {
@@ -3372,10 +3376,6 @@
   }
 #endif
 
-  if (!check_vm_args_consistency()) {
-    return JNI_ERR;
-  }
-
 #if INCLUDE_JVMCI
   if (UseJVMCICompiler) {
     Compilation_mode = CompMode_server;
--- a/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java	Tue May 29 21:01:13 2018 +0200
+++ b/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java	Tue May 29 12:06:05 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
 
 /*
  * @test TestBasicLogOutput
+ * @bug 8203370
  * @summary Ensure -XX:-JVMCIPrintProperties can be enabled and successfully prints expected output to stdout.
  * @requires vm.jvmci
  * @library /test/lib
@@ -34,9 +35,14 @@
 public class TestJVMCIPrintProperties {
 
     public static void main(String[] args) throws Exception {
+        test("-XX:+EnableJVMCI");
+        test("-XX:+UseJVMCICompiler");
+    }
+
+    static void test(String enableFlag) throws Exception {
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
             "-XX:+UnlockExperimentalVMOptions",
-            "-XX:+EnableJVMCI", "-Djvmci.Compiler=null",
+            enableFlag, "-Djvmci.Compiler=null",
             "-XX:+JVMCIPrintProperties");
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         output.shouldContain("[JVMCI properties]"); // expected message