< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page

        

@@ -2109,10 +2109,50 @@
     }
   }
 
   status = status && GCArguments::check_args_consistency();
 
+  if (AMD64_ONLY(false &&) !FLAG_IS_DEFAULT(ValueTypePassFieldsAsArgs)) {
+    FLAG_SET_CMDLINE(ValueTypePassFieldsAsArgs, false);
+    warning("ValueTypePassFieldsAsArgs is not supported on this platform");
+  }
+
+  if (AMD64_ONLY(false &&) !FLAG_IS_DEFAULT(ValueTypeReturnedAsFields)) {
+    FLAG_SET_CMDLINE(ValueTypeReturnedAsFields, false);
+    warning("ValueTypeReturnedAsFields is not supported on this platform");
+  }
+
+  if (EnableValhalla) {
+    if (!TieredCompilation) {
+      if (!FLAG_IS_DEFAULT(EnableValhallaC1) && EnableValhallaC1) {
+        warning("EnableValhallaC1 is disabled because TieredCompilation is disabled");
+      }
+      FLAG_SET_CMDLINE(EnableValhallaC1, false);
+      if (!FLAG_IS_DEFAULT(TieredStopAtLevel) && TieredStopAtLevel != 4) {
+        warning("TieredStopAtLevel is reset to 4 because TieredCompilation is disabled");
+      }
+      FLAG_SET_CMDLINE(TieredStopAtLevel, 4);
+    }
+    if (!EnableValhallaC1) {
+      // C1 support for value types is incomplete. Don't use it by default.
+      if (!FLAG_IS_DEFAULT(TieredCompilation) && TieredCompilation) {
+        warning("TieredCompilation disabled because value types are not fully supported by C1");
+      }
+      FLAG_SET_CMDLINE(TieredCompilation, false);
+    } else {
+      /*
+        TEMP: to run the valuetype tests with C1, you need to use the following command-line:
+
+        cd test/hotspot/jtreg/compiler/valhalla/valuetypes
+        jtreg \
+            -javaoption:-XX:+EnableValhallaC1 \
+            -javaoption:-XX:TieredStopAtLevel=1 \
+            .
+
+      */
+    }
+  }
   return status;
 }
 
 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
   const char* option_type) {

@@ -2998,10 +3038,16 @@
     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
       return JNI_ERR;
     }
   }
 
+  if (EnableValhalla) {
+    if (!create_property("valhalla.enableValhalla", "true", InternalProperty)) {
+      return JNI_ENOMEM;
+    }
+  }
+
   // PrintSharedArchiveAndExit will turn on
   //   -Xshare:on
   //   -Xlog:class+path=info
   if (PrintSharedArchiveAndExit) {
     if (FLAG_SET_CMDLINE(UseSharedSpaces, true) != JVMFlag::SUCCESS) {

@@ -4073,10 +4119,15 @@
   // verification is not as if both were enabled.
   if (BytecodeVerificationLocal && !BytecodeVerificationRemote) {
     log_info(verification)("Turning on remote verification because local verification is on");
     FLAG_SET_DEFAULT(BytecodeVerificationRemote, true);
   }
+  if (!EnableValhalla || is_interpreter_only()) {
+    // Disable calling convention optimizations if value types are not supported
+    ValueTypePassFieldsAsArgs = false;
+    ValueTypeReturnedAsFields = false;
+  }
 
 #ifndef PRODUCT
   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
     if (use_vm_log()) {
       LogVMOutput = true;
< prev index next >