< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page
@@ -2009,10 +2009,20 @@
      FLAG_SET_CMDLINE(StackReservedPages, 0);
      warning("Reserved Stack Area not supported on this platform");
    }
  #endif
  
+   if (AMD64_ONLY(false &&) AARCH64_ONLY(false &&) !FLAG_IS_DEFAULT(InlineTypePassFieldsAsArgs)) {
+     FLAG_SET_CMDLINE(InlineTypePassFieldsAsArgs, false);
+     warning("InlineTypePassFieldsAsArgs is not supported on this platform");
+   }
+ 
+   if (AMD64_ONLY(false &&) AARCH64_ONLY(false &&) !FLAG_IS_DEFAULT(InlineTypeReturnedAsFields)) {
+     FLAG_SET_CMDLINE(InlineTypeReturnedAsFields, false);
+     warning("InlineTypeReturnedAsFields is not supported on this platform");
+   }
+ 
    return status;
  }
  
  bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
    const char* option_type) {

@@ -2941,10 +2951,28 @@
      } else if (is_bad_option(option, args->ignoreUnrecognized)) {
        return JNI_ERR;
      }
    }
  
+   if (EnableValhalla) {
+     // create_property("valhalla.enableValhalla", "true", InternalProperty)
+     const char* prop_name = "valhalla.enableValhalla";
+     const char* prop_value = "true";
+     const size_t prop_len = strlen(prop_name) + strlen(prop_value) + 2;
+     char* property = AllocateHeap(prop_len, mtArguments);
+     int ret = jio_snprintf(property, prop_len, "%s=%s", prop_name, prop_value);
+     if (ret < 0 || ret >= (int)prop_len) {
+       FreeHeap(property);
+       return JNI_ENOMEM;
+     }
+     bool added = add_property(property, UnwriteableProperty, InternalProperty);
+     FreeHeap(property);
+     if (!added) {
+       return JNI_ENOMEM;
+     }
+   }
+ 
    // PrintSharedArchiveAndExit will turn on
    //   -Xshare:on
    //   -Xlog:class+path=info
    if (PrintSharedArchiveAndExit) {
      if (FLAG_SET_CMDLINE(UseSharedSpaces, true) != JVMFlag::SUCCESS) {

@@ -4045,10 +4073,17 @@
    // 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() && !is_dumping_archive() && !UseSharedSpaces)) {
+     // Disable calling convention optimizations if inline types are not supported.
+     // Also these aren't useful in -Xint. However, don't disable them when dumping or using
+     // the CDS archive, as the values must match between dumptime and runtime.
+     InlineTypePassFieldsAsArgs = false;
+     InlineTypeReturnedAsFields = false;
+   }
  
  #ifndef PRODUCT
    if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
      if (use_vm_log()) {
        LogVMOutput = true;
< prev index next >