< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page

1956       return false;
1957     }
1958   }
1959 #endif
1960 
1961 #if INCLUDE_JFR
1962   if (status && (FlightRecorderOptions || StartFlightRecording)) {
1963     if (!create_numbered_module_property("jdk.module.addmods", "jdk.jfr", addmods_count++)) {
1964       return false;
1965     }
1966   }
1967 #endif
1968 
1969 #ifndef SUPPORT_RESERVED_STACK_AREA
1970   if (StackReservedPages != 0) {
1971     FLAG_SET_CMDLINE(StackReservedPages, 0);
1972     warning("Reserved Stack Area not supported on this platform");
1973   }
1974 #endif
1975 










1976 #if !defined(X86) && !defined(AARCH64) && !defined(PPC64) && !defined(RISCV64)
1977   if (UseHeavyMonitors) {
1978     jio_fprintf(defaultStream::error_stream(),
1979                 "UseHeavyMonitors is not fully implemented on this architecture");
1980     return false;
1981   }
1982 #endif
1983 #if (defined(X86) || defined(PPC64)) && !defined(ZERO)
1984   if (UseHeavyMonitors && UseRTMForStackLocks) {
1985     jio_fprintf(defaultStream::error_stream(),
1986                 "-XX:+UseHeavyMonitors and -XX:+UseRTMForStackLocks are mutually exclusive");
1987 
1988     return false;
1989   }
1990 #endif
1991   if (VerifyHeavyMonitors && !UseHeavyMonitors) {
1992     jio_fprintf(defaultStream::error_stream(),
1993                 "-XX:+VerifyHeavyMonitors requires -XX:+UseHeavyMonitors");
1994     return false;
1995   }

2913 #endif // INCLUDE_JVMCI
2914 #if INCLUDE_JFR
2915     } else if (match_jfr_option(&option)) {
2916       return JNI_EINVAL;
2917 #endif
2918     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
2919       // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have
2920       // already been handled
2921       if ((strncmp(tail, "Flags=", strlen("Flags=")) != 0) &&
2922           (strncmp(tail, "VMOptionsFile=", strlen("VMOptionsFile=")) != 0)) {
2923         if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
2924           return JNI_EINVAL;
2925         }
2926       }
2927     // Unknown option
2928     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
2929       return JNI_ERR;
2930     }
2931   }
2932 






2933   // PrintSharedArchiveAndExit will turn on
2934   //   -Xshare:on
2935   //   -Xlog:class+path=info
2936   if (PrintSharedArchiveAndExit) {
2937     UseSharedSpaces = true;
2938     RequireSharedSpaces = true;
2939     LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
2940   }
2941 
2942   fix_appclasspath();
2943 
2944   return JNI_OK;
2945 }
2946 
2947 void Arguments::add_patch_mod_prefix(const char* module_name, const char* path, bool* patch_mod_javabase) {
2948   // For java.base check for duplicate --patch-module options being specified on the command line.
2949   // This check is only required for java.base, all other duplicate module specifications
2950   // will be checked during module system initialization.  The module system initialization
2951   // will throw an ExceptionInInitializerError if this situation occurs.
2952   if (strcmp(module_name, JAVA_BASE_NAME) == 0) {

4057 #ifdef ZERO
4058   // Clear flags not supported on zero.
4059   FLAG_SET_DEFAULT(ProfileInterpreter, false);
4060 #endif // ZERO
4061 
4062   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4063     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4064     DebugNonSafepoints = true;
4065   }
4066 
4067   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4068     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4069   }
4070 
4071   // Treat the odd case where local verification is enabled but remote
4072   // verification is not as if both were enabled.
4073   if (BytecodeVerificationLocal && !BytecodeVerificationRemote) {
4074     log_info(verification)("Turning on remote verification because local verification is on");
4075     FLAG_SET_DEFAULT(BytecodeVerificationRemote, true);
4076   }







4077 
4078 #ifndef PRODUCT
4079   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
4080     if (use_vm_log()) {
4081       LogVMOutput = true;
4082     }
4083   }
4084 #endif // PRODUCT
4085 
4086   if (PrintCommandLineFlags) {
4087     JVMFlag::printSetFlags(tty);
4088   }
4089 
4090 #ifdef COMPILER2
4091   if (!FLAG_IS_DEFAULT(EnableVectorSupport) && !EnableVectorSupport) {
4092     if (!FLAG_IS_DEFAULT(EnableVectorReboxing) && EnableVectorReboxing) {
4093       warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
4094     }
4095     FLAG_SET_DEFAULT(EnableVectorReboxing, false);
4096 

1956       return false;
1957     }
1958   }
1959 #endif
1960 
1961 #if INCLUDE_JFR
1962   if (status && (FlightRecorderOptions || StartFlightRecording)) {
1963     if (!create_numbered_module_property("jdk.module.addmods", "jdk.jfr", addmods_count++)) {
1964       return false;
1965     }
1966   }
1967 #endif
1968 
1969 #ifndef SUPPORT_RESERVED_STACK_AREA
1970   if (StackReservedPages != 0) {
1971     FLAG_SET_CMDLINE(StackReservedPages, 0);
1972     warning("Reserved Stack Area not supported on this platform");
1973   }
1974 #endif
1975 
1976   if (AMD64_ONLY(false &&) AARCH64_ONLY(false &&) !FLAG_IS_DEFAULT(InlineTypePassFieldsAsArgs)) {
1977     FLAG_SET_CMDLINE(InlineTypePassFieldsAsArgs, false);
1978     warning("InlineTypePassFieldsAsArgs is not supported on this platform");
1979   }
1980 
1981   if (AMD64_ONLY(false &&) AARCH64_ONLY(false &&) !FLAG_IS_DEFAULT(InlineTypeReturnedAsFields)) {
1982     FLAG_SET_CMDLINE(InlineTypeReturnedAsFields, false);
1983     warning("InlineTypeReturnedAsFields is not supported on this platform");
1984   }
1985 
1986 #if !defined(X86) && !defined(AARCH64) && !defined(PPC64) && !defined(RISCV64)
1987   if (UseHeavyMonitors) {
1988     jio_fprintf(defaultStream::error_stream(),
1989                 "UseHeavyMonitors is not fully implemented on this architecture");
1990     return false;
1991   }
1992 #endif
1993 #if (defined(X86) || defined(PPC64)) && !defined(ZERO)
1994   if (UseHeavyMonitors && UseRTMForStackLocks) {
1995     jio_fprintf(defaultStream::error_stream(),
1996                 "-XX:+UseHeavyMonitors and -XX:+UseRTMForStackLocks are mutually exclusive");
1997 
1998     return false;
1999   }
2000 #endif
2001   if (VerifyHeavyMonitors && !UseHeavyMonitors) {
2002     jio_fprintf(defaultStream::error_stream(),
2003                 "-XX:+VerifyHeavyMonitors requires -XX:+UseHeavyMonitors");
2004     return false;
2005   }

2923 #endif // INCLUDE_JVMCI
2924 #if INCLUDE_JFR
2925     } else if (match_jfr_option(&option)) {
2926       return JNI_EINVAL;
2927 #endif
2928     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
2929       // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have
2930       // already been handled
2931       if ((strncmp(tail, "Flags=", strlen("Flags=")) != 0) &&
2932           (strncmp(tail, "VMOptionsFile=", strlen("VMOptionsFile=")) != 0)) {
2933         if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
2934           return JNI_EINVAL;
2935         }
2936       }
2937     // Unknown option
2938     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
2939       return JNI_ERR;
2940     }
2941   }
2942 
2943   if (!EnableValhalla && EnablePrimitiveClasses) {
2944     jio_fprintf(defaultStream::error_stream(),
2945                 "Cannot specify -XX:+EnablePrimitiveClasses without -XX:+EnableValhalla");
2946     return JNI_EINVAL;
2947   }
2948 
2949   // PrintSharedArchiveAndExit will turn on
2950   //   -Xshare:on
2951   //   -Xlog:class+path=info
2952   if (PrintSharedArchiveAndExit) {
2953     UseSharedSpaces = true;
2954     RequireSharedSpaces = true;
2955     LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
2956   }
2957 
2958   fix_appclasspath();
2959 
2960   return JNI_OK;
2961 }
2962 
2963 void Arguments::add_patch_mod_prefix(const char* module_name, const char* path, bool* patch_mod_javabase) {
2964   // For java.base check for duplicate --patch-module options being specified on the command line.
2965   // This check is only required for java.base, all other duplicate module specifications
2966   // will be checked during module system initialization.  The module system initialization
2967   // will throw an ExceptionInInitializerError if this situation occurs.
2968   if (strcmp(module_name, JAVA_BASE_NAME) == 0) {

4073 #ifdef ZERO
4074   // Clear flags not supported on zero.
4075   FLAG_SET_DEFAULT(ProfileInterpreter, false);
4076 #endif // ZERO
4077 
4078   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4079     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4080     DebugNonSafepoints = true;
4081   }
4082 
4083   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4084     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4085   }
4086 
4087   // Treat the odd case where local verification is enabled but remote
4088   // verification is not as if both were enabled.
4089   if (BytecodeVerificationLocal && !BytecodeVerificationRemote) {
4090     log_info(verification)("Turning on remote verification because local verification is on");
4091     FLAG_SET_DEFAULT(BytecodeVerificationRemote, true);
4092   }
4093   if (!EnableValhalla || (is_interpreter_only() && !is_dumping_archive() && !UseSharedSpaces)) {
4094     // Disable calling convention optimizations if inline types are not supported.
4095     // Also these aren't useful in -Xint. However, don't disable them when dumping or using
4096     // the CDS archive, as the values must match between dumptime and runtime.
4097     InlineTypePassFieldsAsArgs = false;
4098     InlineTypeReturnedAsFields = false;
4099   }
4100 
4101 #ifndef PRODUCT
4102   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
4103     if (use_vm_log()) {
4104       LogVMOutput = true;
4105     }
4106   }
4107 #endif // PRODUCT
4108 
4109   if (PrintCommandLineFlags) {
4110     JVMFlag::printSetFlags(tty);
4111   }
4112 
4113 #ifdef COMPILER2
4114   if (!FLAG_IS_DEFAULT(EnableVectorSupport) && !EnableVectorSupport) {
4115     if (!FLAG_IS_DEFAULT(EnableVectorReboxing) && EnableVectorReboxing) {
4116       warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
4117     }
4118     FLAG_SET_DEFAULT(EnableVectorReboxing, false);
4119 
< prev index next >