< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page




2537       } else {
2538         if (FLAG_SET_CMDLINE(uintx, MinHeapFreeRatio, minf) != Flag::SUCCESS) {
2539           return JNI_EINVAL;
2540         }
2541       }
2542     // -Xss
2543     } else if (match_option(option, "-Xss", &tail)) {
2544       julong long_ThreadStackSize = 0;
2545       ArgsRange errcode = parse_memory_size(tail, &long_ThreadStackSize, 1000);
2546       if (errcode != arg_in_range) {
2547         jio_fprintf(defaultStream::error_stream(),
2548                     "Invalid thread stack size: %s\n", option->optionString);
2549         describe_range_error(errcode);
2550         return JNI_EINVAL;
2551       }
2552       // Internally track ThreadStackSize in units of 1024 bytes.
2553       if (FLAG_SET_CMDLINE(intx, ThreadStackSize,
2554                        round_to((int)long_ThreadStackSize, K) / K) != Flag::SUCCESS) {
2555         return JNI_EINVAL;
2556       }
2557     // -Xoss
2558     } else if (match_option(option, "-Xoss", &tail)) {
2559           // HotSpot does not have separate native and Java stacks, ignore silently for compatibility






2560     } else if (match_option(option, "-XX:CodeCacheExpansionSize=", &tail)) {
2561       julong long_CodeCacheExpansionSize = 0;
2562       ArgsRange errcode = parse_memory_size(tail, &long_CodeCacheExpansionSize, os::vm_page_size());
2563       if (errcode != arg_in_range) {
2564         jio_fprintf(defaultStream::error_stream(),
2565                    "Invalid argument: %s. Must be at least %luK.\n", option->optionString,
2566                    os::vm_page_size()/K);
2567         return JNI_EINVAL;
2568       }
2569       if (FLAG_SET_CMDLINE(uintx, CodeCacheExpansionSize, (uintx)long_CodeCacheExpansionSize) != Flag::SUCCESS) {
2570         return JNI_EINVAL;
2571       }
2572     } else if (match_option(option, "-Xmaxjitcodesize", &tail) ||
2573                match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) {
2574       julong long_ReservedCodeCacheSize = 0;
2575 
2576       ArgsRange errcode = parse_memory_size(tail, &long_ReservedCodeCacheSize, 1);
2577       if (errcode != arg_in_range) {
2578         jio_fprintf(defaultStream::error_stream(),
2579                     "Invalid maximum code cache size: %s.\n", option->optionString);


2612     } else if (match_option(option, "-XX:NonProfiledCodeHeapSize=", &tail)) {
2613       julong long_NonProfiledCodeHeapSize = 0;
2614 
2615       ArgsRange errcode = parse_memory_size(tail, &long_NonProfiledCodeHeapSize, 1);
2616       if (errcode != arg_in_range) {
2617         jio_fprintf(defaultStream::error_stream(),
2618                     "Invalid maximum non-profiled code heap size: %s.\n", option->optionString);
2619         return JNI_EINVAL;
2620       }
2621       if (FLAG_SET_CMDLINE(uintx, NonProfiledCodeHeapSize, (uintx)long_NonProfiledCodeHeapSize) != Flag::SUCCESS) {
2622         return JNI_EINVAL;
2623       }
2624     // -green
2625     } else if (match_option(option, "-green")) {
2626       jio_fprintf(defaultStream::error_stream(),
2627                   "Green threads support not available\n");
2628           return JNI_EINVAL;
2629     // -native
2630     } else if (match_option(option, "-native")) {
2631           // HotSpot always uses native threads, ignore silently for compatibility
2632     // -Xsqnopause
2633     } else if (match_option(option, "-Xsqnopause")) {
2634           // EVM option, ignore silently for compatibility
2635     // -Xrs
2636     } else if (match_option(option, "-Xrs")) {
2637           // Classic/EVM option, new functionality
2638       if (FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true) != Flag::SUCCESS) {
2639         return JNI_EINVAL;
2640       }
2641     } else if (match_option(option, "-Xusealtsigs")) {
2642           // change default internal VM signals used - lower case for back compat
2643       if (FLAG_SET_CMDLINE(bool, UseAltSigs, true) != Flag::SUCCESS) {
2644         return JNI_EINVAL;
2645       }
2646     // -Xoptimize
2647     } else if (match_option(option, "-Xoptimize")) {
2648           // EVM option, ignore silently for compatibility
2649     // -Xprof
2650     } else if (match_option(option, "-Xprof")) {
2651 #if INCLUDE_FPROF
2652       _has_profile = true;
2653 #else // INCLUDE_FPROF
2654       jio_fprintf(defaultStream::error_stream(),
2655         "Flat profiling is not supported in this VM.\n");
2656       return JNI_ERR;
2657 #endif // INCLUDE_FPROF
2658     // -Xconcurrentio
2659     } else if (match_option(option, "-Xconcurrentio")) {
2660       if (FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true) != Flag::SUCCESS) {
2661         return JNI_EINVAL;
2662       }
2663       if (FLAG_SET_CMDLINE(bool, BackgroundCompilation, false) != Flag::SUCCESS) {
2664         return JNI_EINVAL;
2665       }
2666       if (FLAG_SET_CMDLINE(intx, DeferThrSuspendLoopCount, 1) != Flag::SUCCESS) {
2667         return JNI_EINVAL;
2668       }


2774         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true) != Flag::SUCCESS) {
2775           return JNI_EINVAL;
2776         }
2777       } else if (strcmp(tail, ":none") == 0) {
2778         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, false) != Flag::SUCCESS) {
2779           return JNI_EINVAL;
2780         }
2781         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, false) != Flag::SUCCESS) {
2782           return JNI_EINVAL;
2783         }
2784       } else if (is_bad_option(option, args->ignoreUnrecognized, "verification")) {
2785         return JNI_EINVAL;
2786       }
2787     // -Xdebug
2788     } else if (match_option(option, "-Xdebug")) {
2789       // note this flag has been used, then ignore
2790       set_xdebug_mode(true);
2791     // -Xnoagent
2792     } else if (match_option(option, "-Xnoagent")) {
2793       // For compatibility with classic. HotSpot refuses to load the old style agent.dll.
2794     } else if (match_option(option, "-Xboundthreads")) {
2795       // Ignore silently for compatibility
2796     } else if (match_option(option, "-Xloggc:", &tail)) {
2797       // Redirect GC output to the file. -Xloggc:<filename>
2798       // ostream_init_log(), when called will use this filename
2799       // to initialize a fileStream.
2800       _gc_log_filename = os::strdup_check_oom(tail);
2801      if (!is_filename_valid(_gc_log_filename)) {
2802        jio_fprintf(defaultStream::output_stream(),
2803                   "Invalid file name for use with -Xloggc: Filename can only contain the "
2804                   "characters [A-Z][a-z][0-9]-_.%%[p|t] but it has been %s\n"
2805                   "Note %%p or %%t can only be used once\n", _gc_log_filename);
2806         return JNI_EINVAL;
2807       }
2808       if (FLAG_SET_CMDLINE(bool, PrintGC, true) != Flag::SUCCESS) {
2809         return JNI_EINVAL;
2810       }
2811       if (FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true) != Flag::SUCCESS) {
2812         return JNI_EINVAL;
2813       }
2814     // JNI hooks
2815     } else if (match_option(option, "-Xcheck", &tail)) {




2537       } else {
2538         if (FLAG_SET_CMDLINE(uintx, MinHeapFreeRatio, minf) != Flag::SUCCESS) {
2539           return JNI_EINVAL;
2540         }
2541       }
2542     // -Xss
2543     } else if (match_option(option, "-Xss", &tail)) {
2544       julong long_ThreadStackSize = 0;
2545       ArgsRange errcode = parse_memory_size(tail, &long_ThreadStackSize, 1000);
2546       if (errcode != arg_in_range) {
2547         jio_fprintf(defaultStream::error_stream(),
2548                     "Invalid thread stack size: %s\n", option->optionString);
2549         describe_range_error(errcode);
2550         return JNI_EINVAL;
2551       }
2552       // Internally track ThreadStackSize in units of 1024 bytes.
2553       if (FLAG_SET_CMDLINE(intx, ThreadStackSize,
2554                        round_to((int)long_ThreadStackSize, K) / K) != Flag::SUCCESS) {
2555         return JNI_EINVAL;
2556       }
2557     // -Xoss, -Xsqnopause, -Xoptimize, -Xboundthreads
2558     } else if (match_option(option, "-Xoss", &tail) ||
2559                match_option(option, "-Xsqnopause") ||
2560                match_option(option, "-Xoptimize") ||
2561                match_option(option, "-Xboundthreads")) {
2562       // All these options are deprecated in JDK 9 and will be removed in a future release
2563       char version[256];
2564       JDK_Version::jdk(9).to_string(version, sizeof(version));
2565       warning("ignoring option %s; support was removed in %s", option->optionString, version);
2566     } else if (match_option(option, "-XX:CodeCacheExpansionSize=", &tail)) {
2567       julong long_CodeCacheExpansionSize = 0;
2568       ArgsRange errcode = parse_memory_size(tail, &long_CodeCacheExpansionSize, os::vm_page_size());
2569       if (errcode != arg_in_range) {
2570         jio_fprintf(defaultStream::error_stream(),
2571                    "Invalid argument: %s. Must be at least %luK.\n", option->optionString,
2572                    os::vm_page_size()/K);
2573         return JNI_EINVAL;
2574       }
2575       if (FLAG_SET_CMDLINE(uintx, CodeCacheExpansionSize, (uintx)long_CodeCacheExpansionSize) != Flag::SUCCESS) {
2576         return JNI_EINVAL;
2577       }
2578     } else if (match_option(option, "-Xmaxjitcodesize", &tail) ||
2579                match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) {
2580       julong long_ReservedCodeCacheSize = 0;
2581 
2582       ArgsRange errcode = parse_memory_size(tail, &long_ReservedCodeCacheSize, 1);
2583       if (errcode != arg_in_range) {
2584         jio_fprintf(defaultStream::error_stream(),
2585                     "Invalid maximum code cache size: %s.\n", option->optionString);


2618     } else if (match_option(option, "-XX:NonProfiledCodeHeapSize=", &tail)) {
2619       julong long_NonProfiledCodeHeapSize = 0;
2620 
2621       ArgsRange errcode = parse_memory_size(tail, &long_NonProfiledCodeHeapSize, 1);
2622       if (errcode != arg_in_range) {
2623         jio_fprintf(defaultStream::error_stream(),
2624                     "Invalid maximum non-profiled code heap size: %s.\n", option->optionString);
2625         return JNI_EINVAL;
2626       }
2627       if (FLAG_SET_CMDLINE(uintx, NonProfiledCodeHeapSize, (uintx)long_NonProfiledCodeHeapSize) != Flag::SUCCESS) {
2628         return JNI_EINVAL;
2629       }
2630     // -green
2631     } else if (match_option(option, "-green")) {
2632       jio_fprintf(defaultStream::error_stream(),
2633                   "Green threads support not available\n");
2634           return JNI_EINVAL;
2635     // -native
2636     } else if (match_option(option, "-native")) {
2637           // HotSpot always uses native threads, ignore silently for compatibility



2638     // -Xrs
2639     } else if (match_option(option, "-Xrs")) {
2640           // Classic/EVM option, new functionality
2641       if (FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true) != Flag::SUCCESS) {
2642         return JNI_EINVAL;
2643       }
2644     } else if (match_option(option, "-Xusealtsigs")) {
2645           // change default internal VM signals used - lower case for back compat
2646       if (FLAG_SET_CMDLINE(bool, UseAltSigs, true) != Flag::SUCCESS) {
2647         return JNI_EINVAL;
2648       }



2649     // -Xprof
2650     } else if (match_option(option, "-Xprof")) {
2651 #if INCLUDE_FPROF
2652       _has_profile = true;
2653 #else // INCLUDE_FPROF
2654       jio_fprintf(defaultStream::error_stream(),
2655         "Flat profiling is not supported in this VM.\n");
2656       return JNI_ERR;
2657 #endif // INCLUDE_FPROF
2658     // -Xconcurrentio
2659     } else if (match_option(option, "-Xconcurrentio")) {
2660       if (FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true) != Flag::SUCCESS) {
2661         return JNI_EINVAL;
2662       }
2663       if (FLAG_SET_CMDLINE(bool, BackgroundCompilation, false) != Flag::SUCCESS) {
2664         return JNI_EINVAL;
2665       }
2666       if (FLAG_SET_CMDLINE(intx, DeferThrSuspendLoopCount, 1) != Flag::SUCCESS) {
2667         return JNI_EINVAL;
2668       }


2774         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true) != Flag::SUCCESS) {
2775           return JNI_EINVAL;
2776         }
2777       } else if (strcmp(tail, ":none") == 0) {
2778         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, false) != Flag::SUCCESS) {
2779           return JNI_EINVAL;
2780         }
2781         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, false) != Flag::SUCCESS) {
2782           return JNI_EINVAL;
2783         }
2784       } else if (is_bad_option(option, args->ignoreUnrecognized, "verification")) {
2785         return JNI_EINVAL;
2786       }
2787     // -Xdebug
2788     } else if (match_option(option, "-Xdebug")) {
2789       // note this flag has been used, then ignore
2790       set_xdebug_mode(true);
2791     // -Xnoagent
2792     } else if (match_option(option, "-Xnoagent")) {
2793       // For compatibility with classic. HotSpot refuses to load the old style agent.dll.


2794     } else if (match_option(option, "-Xloggc:", &tail)) {
2795       // Redirect GC output to the file. -Xloggc:<filename>
2796       // ostream_init_log(), when called will use this filename
2797       // to initialize a fileStream.
2798       _gc_log_filename = os::strdup_check_oom(tail);
2799      if (!is_filename_valid(_gc_log_filename)) {
2800        jio_fprintf(defaultStream::output_stream(),
2801                   "Invalid file name for use with -Xloggc: Filename can only contain the "
2802                   "characters [A-Z][a-z][0-9]-_.%%[p|t] but it has been %s\n"
2803                   "Note %%p or %%t can only be used once\n", _gc_log_filename);
2804         return JNI_EINVAL;
2805       }
2806       if (FLAG_SET_CMDLINE(bool, PrintGC, true) != Flag::SUCCESS) {
2807         return JNI_EINVAL;
2808       }
2809       if (FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true) != Flag::SUCCESS) {
2810         return JNI_EINVAL;
2811       }
2812     // JNI hooks
2813     } else if (match_option(option, "-Xcheck", &tail)) {


< prev index next >