comparison src/share/vm/runtime/arguments.cpp @ 1162:d749b1813f40

Merge
author trims
date Fri, 15 Jan 2010 14:25:44 -0800
parents 1fc01a2425ce
children 99af867dfa05
comparison
equal deleted inserted replaced
1130:1bc68593a110 1162:d749b1813f40
946 } else { 946 } else {
947 FLAG_SET_DEFAULT(UseSharedSpaces, false); 947 FLAG_SET_DEFAULT(UseSharedSpaces, false);
948 } 948 }
949 } 949 }
950 950
951 #ifndef KERNEL
951 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC 952 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC
952 // if it's not explictly set or unset. If the user has chosen 953 // if it's not explictly set or unset. If the user has chosen
953 // UseParNewGC and not explicitly set ParallelGCThreads we 954 // UseParNewGC and not explicitly set ParallelGCThreads we
954 // set it, unless this is a single cpu machine. 955 // set it, unless this is a single cpu machine.
955 void Arguments::set_parnew_gc_flags() { 956 void Arguments::set_parnew_gc_flags() {
1175 // OldPLABSize is not the default value but CMSParPromoteBlocksToClaim 1176 // OldPLABSize is not the default value but CMSParPromoteBlocksToClaim
1176 // is. In this situtation let CMSParPromoteBlocksToClaim follow 1177 // is. In this situtation let CMSParPromoteBlocksToClaim follow
1177 // the value (either from the command line or ergonomics) of 1178 // the value (either from the command line or ergonomics) of
1178 // OldPLABSize. Following OldPLABSize is an ergonomics decision. 1179 // OldPLABSize. Following OldPLABSize is an ergonomics decision.
1179 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, OldPLABSize); 1180 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, OldPLABSize);
1180 } 1181 } else {
1181 else {
1182 // OldPLABSize and CMSParPromoteBlocksToClaim are both set. 1182 // OldPLABSize and CMSParPromoteBlocksToClaim are both set.
1183 // CMSParPromoteBlocksToClaim is a collector-specific flag, so 1183 // CMSParPromoteBlocksToClaim is a collector-specific flag, so
1184 // we'll let it to take precedence. 1184 // we'll let it to take precedence.
1185 jio_fprintf(defaultStream::error_stream(), 1185 jio_fprintf(defaultStream::error_stream(),
1186 "Both OldPLABSize and CMSParPromoteBlocksToClaim" 1186 "Both OldPLABSize and CMSParPromoteBlocksToClaim"
1187 " options are specified for the CMS collector." 1187 " options are specified for the CMS collector."
1188 " CMSParPromoteBlocksToClaim will take precedence.\n"); 1188 " CMSParPromoteBlocksToClaim will take precedence.\n");
1189 } 1189 }
1190 } 1190 }
1191 } 1191 if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1192 // OldPLAB sizing manually turned off: Use a larger default setting,
1193 // unless it was manually specified. This is because a too-low value
1194 // will slow down scavenges.
1195 if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) {
1196 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, 50); // default value before 6631166
1197 }
1198 }
1199 // Overwrite OldPLABSize which is the variable we will internally use everywhere.
1200 FLAG_SET_ERGO(uintx, OldPLABSize, CMSParPromoteBlocksToClaim);
1201 // If either of the static initialization defaults have changed, note this
1202 // modification.
1203 if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) {
1204 CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight);
1205 }
1206 }
1207 #endif // KERNEL
1192 1208
1193 inline uintx max_heap_for_compressed_oops() { 1209 inline uintx max_heap_for_compressed_oops() {
1194 LP64_ONLY(return oopDesc::OopEncodingHeapMax - MaxPermSize - os::vm_page_size()); 1210 LP64_ONLY(return oopDesc::OopEncodingHeapMax - MaxPermSize - os::vm_page_size());
1195 NOT_LP64(ShouldNotReachHere(); return 0); 1211 NOT_LP64(ShouldNotReachHere(); return 0);
1196 } 1212 }
1848 if (!strcmp(tail, ":class") || !strcmp(tail, "")) { 1864 if (!strcmp(tail, ":class") || !strcmp(tail, "")) {
1849 FLAG_SET_CMDLINE(bool, TraceClassLoading, true); 1865 FLAG_SET_CMDLINE(bool, TraceClassLoading, true);
1850 FLAG_SET_CMDLINE(bool, TraceClassUnloading, true); 1866 FLAG_SET_CMDLINE(bool, TraceClassUnloading, true);
1851 } else if (!strcmp(tail, ":gc")) { 1867 } else if (!strcmp(tail, ":gc")) {
1852 FLAG_SET_CMDLINE(bool, PrintGC, true); 1868 FLAG_SET_CMDLINE(bool, PrintGC, true);
1853 FLAG_SET_CMDLINE(bool, TraceClassUnloading, true);
1854 } else if (!strcmp(tail, ":jni")) { 1869 } else if (!strcmp(tail, ":jni")) {
1855 FLAG_SET_CMDLINE(bool, PrintJNIResolving, true); 1870 FLAG_SET_CMDLINE(bool, PrintJNIResolving, true);
1856 } 1871 }
1857 // -da / -ea / -disableassertions / -enableassertions 1872 // -da / -ea / -disableassertions / -enableassertions
1858 // These accept an optional class/package name separated by a colon, e.g., 1873 // These accept an optional class/package name separated by a colon, e.g.,
2368 #else // ndef SOLARIS 2383 #else // ndef SOLARIS
2369 jio_fprintf(defaultStream::error_stream(), 2384 jio_fprintf(defaultStream::error_stream(),
2370 "ExtendedDTraceProbes flag is only applicable on Solaris\n"); 2385 "ExtendedDTraceProbes flag is only applicable on Solaris\n");
2371 return JNI_EINVAL; 2386 return JNI_EINVAL;
2372 #endif // ndef SOLARIS 2387 #endif // ndef SOLARIS
2373 } else
2374 #ifdef ASSERT 2388 #ifdef ASSERT
2375 if (match_option(option, "-XX:+FullGCALot", &tail)) { 2389 } else if (match_option(option, "-XX:+FullGCALot", &tail)) {
2376 FLAG_SET_CMDLINE(bool, FullGCALot, true); 2390 FLAG_SET_CMDLINE(bool, FullGCALot, true);
2377 // disable scavenge before parallel mark-compact 2391 // disable scavenge before parallel mark-compact
2378 FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false); 2392 FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false);
2379 } else
2380 #endif 2393 #endif
2381 if (match_option(option, "-XX:ParCMSPromoteBlocksToClaim=", &tail)) { 2394 } else if (match_option(option, "-XX:CMSParPromoteBlocksToClaim=", &tail)) {
2382 julong cms_blocks_to_claim = (julong)atol(tail); 2395 julong cms_blocks_to_claim = (julong)atol(tail);
2383 FLAG_SET_CMDLINE(uintx, CMSParPromoteBlocksToClaim, cms_blocks_to_claim); 2396 FLAG_SET_CMDLINE(uintx, CMSParPromoteBlocksToClaim, cms_blocks_to_claim);
2384 jio_fprintf(defaultStream::error_stream(), 2397 jio_fprintf(defaultStream::error_stream(),
2385 "Please use -XX:CMSParPromoteBlocksToClaim in place of " 2398 "Please use -XX:OldPLABSize in place of "
2399 "-XX:CMSParPromoteBlocksToClaim in the future\n");
2400 } else if (match_option(option, "-XX:ParCMSPromoteBlocksToClaim=", &tail)) {
2401 julong cms_blocks_to_claim = (julong)atol(tail);
2402 FLAG_SET_CMDLINE(uintx, CMSParPromoteBlocksToClaim, cms_blocks_to_claim);
2403 jio_fprintf(defaultStream::error_stream(),
2404 "Please use -XX:OldPLABSize in place of "
2386 "-XX:ParCMSPromoteBlocksToClaim in the future\n"); 2405 "-XX:ParCMSPromoteBlocksToClaim in the future\n");
2387 } else 2406 } else if (match_option(option, "-XX:ParallelGCOldGenAllocBufferSize=", &tail)) {
2388 if (match_option(option, "-XX:ParallelGCOldGenAllocBufferSize=", &tail)) {
2389 julong old_plab_size = 0; 2407 julong old_plab_size = 0;
2390 ArgsRange errcode = parse_memory_size(tail, &old_plab_size, 1); 2408 ArgsRange errcode = parse_memory_size(tail, &old_plab_size, 1);
2391 if (errcode != arg_in_range) { 2409 if (errcode != arg_in_range) {
2392 jio_fprintf(defaultStream::error_stream(), 2410 jio_fprintf(defaultStream::error_stream(),
2393 "Invalid old PLAB size: %s\n", option->optionString); 2411 "Invalid old PLAB size: %s\n", option->optionString);
2396 } 2414 }
2397 FLAG_SET_CMDLINE(uintx, OldPLABSize, old_plab_size); 2415 FLAG_SET_CMDLINE(uintx, OldPLABSize, old_plab_size);
2398 jio_fprintf(defaultStream::error_stream(), 2416 jio_fprintf(defaultStream::error_stream(),
2399 "Please use -XX:OldPLABSize in place of " 2417 "Please use -XX:OldPLABSize in place of "
2400 "-XX:ParallelGCOldGenAllocBufferSize in the future\n"); 2418 "-XX:ParallelGCOldGenAllocBufferSize in the future\n");
2401 } else 2419 } else if (match_option(option, "-XX:ParallelGCToSpaceAllocBufferSize=", &tail)) {
2402 if (match_option(option, "-XX:ParallelGCToSpaceAllocBufferSize=", &tail)) {
2403 julong young_plab_size = 0; 2420 julong young_plab_size = 0;
2404 ArgsRange errcode = parse_memory_size(tail, &young_plab_size, 1); 2421 ArgsRange errcode = parse_memory_size(tail, &young_plab_size, 1);
2405 if (errcode != arg_in_range) { 2422 if (errcode != arg_in_range) {
2406 jio_fprintf(defaultStream::error_stream(), 2423 jio_fprintf(defaultStream::error_stream(),
2407 "Invalid young PLAB size: %s\n", option->optionString); 2424 "Invalid young PLAB size: %s\n", option->optionString);
2410 } 2427 }
2411 FLAG_SET_CMDLINE(uintx, YoungPLABSize, young_plab_size); 2428 FLAG_SET_CMDLINE(uintx, YoungPLABSize, young_plab_size);
2412 jio_fprintf(defaultStream::error_stream(), 2429 jio_fprintf(defaultStream::error_stream(),
2413 "Please use -XX:YoungPLABSize in place of " 2430 "Please use -XX:YoungPLABSize in place of "
2414 "-XX:ParallelGCToSpaceAllocBufferSize in the future\n"); 2431 "-XX:ParallelGCToSpaceAllocBufferSize in the future\n");
2415 } else 2432 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
2416 if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
2417 // Skip -XX:Flags= since that case has already been handled 2433 // Skip -XX:Flags= since that case has already been handled
2418 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { 2434 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) {
2419 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { 2435 if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
2420 return JNI_EINVAL; 2436 return JNI_EINVAL;
2421 } 2437 }
2631 IgnoreUnrecognizedVMOptions = true; 2647 IgnoreUnrecognizedVMOptions = true;
2632 } 2648 }
2633 if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions", &tail)) { 2649 if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions", &tail)) {
2634 IgnoreUnrecognizedVMOptions = false; 2650 IgnoreUnrecognizedVMOptions = false;
2635 } 2651 }
2652 if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) {
2653 CommandLineFlags::printFlags();
2654 vm_exit(0);
2655 }
2636 } 2656 }
2637 2657
2638 if (IgnoreUnrecognizedVMOptions) { 2658 if (IgnoreUnrecognizedVMOptions) {
2639 // uncast const to modify the flag args->ignoreUnrecognized 2659 // uncast const to modify the flag args->ignoreUnrecognized
2640 *(jboolean*)(&args->ignoreUnrecognized) = true; 2660 *(jboolean*)(&args->ignoreUnrecognized) = true;
2697 if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) { 2717 if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
2698 warning("forcing ScavengeRootsInCode non-zero because EnableMethodHandles or AnonymousClasses is true"); 2718 warning("forcing ScavengeRootsInCode non-zero because EnableMethodHandles or AnonymousClasses is true");
2699 } 2719 }
2700 ScavengeRootsInCode = 1; 2720 ScavengeRootsInCode = 1;
2701 } 2721 }
2722 #ifdef COMPILER2
2723 if (EnableInvokeDynamic && DoEscapeAnalysis) {
2724 // TODO: We need to find rules for invokedynamic and EA. For now,
2725 // simply disable EA by default.
2726 if (FLAG_IS_DEFAULT(DoEscapeAnalysis)) {
2727 DoEscapeAnalysis = false;
2728 }
2729 }
2730 #endif
2702 2731
2703 if (PrintGCDetails) { 2732 if (PrintGCDetails) {
2704 // Turn on -verbose:gc options as well 2733 // Turn on -verbose:gc options as well
2705 PrintGC = true; 2734 PrintGC = true;
2706 if (FLAG_IS_DEFAULT(TraceClassUnloading)) {
2707 TraceClassUnloading = true;
2708 }
2709 } 2735 }
2710 2736
2711 #if defined(_LP64) && defined(COMPILER1) 2737 #if defined(_LP64) && defined(COMPILER1)
2712 UseCompressedOops = false; 2738 UseCompressedOops = false;
2713 #endif 2739 #endif
2720 #endif // KERNEL 2746 #endif // KERNEL
2721 2747
2722 // Set flags based on ergonomics. 2748 // Set flags based on ergonomics.
2723 set_ergonomics_flags(); 2749 set_ergonomics_flags();
2724 2750
2751 #ifdef _LP64
2752 // XXX JSR 292 currently does not support compressed oops.
2753 if (EnableMethodHandles && UseCompressedOops) {
2754 if (FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops)) {
2755 UseCompressedOops = false;
2756 }
2757 }
2758 #endif // _LP64
2759
2725 // Check the GC selections again. 2760 // Check the GC selections again.
2726 if (!check_gc_consistency()) { 2761 if (!check_gc_consistency()) {
2727 return JNI_EINVAL; 2762 return JNI_EINVAL;
2728 } 2763 }
2729 2764
2765 #ifndef KERNEL
2730 if (UseConcMarkSweepGC) { 2766 if (UseConcMarkSweepGC) {
2731 // Set flags for CMS and ParNew. Check UseConcMarkSweep first 2767 // Set flags for CMS and ParNew. Check UseConcMarkSweep first
2732 // to ensure that when both UseConcMarkSweepGC and UseParNewGC 2768 // to ensure that when both UseConcMarkSweepGC and UseParNewGC
2733 // are true, we don't call set_parnew_gc_flags() as well. 2769 // are true, we don't call set_parnew_gc_flags() as well.
2734 set_cms_and_parnew_gc_flags(); 2770 set_cms_and_parnew_gc_flags();
2742 set_parnew_gc_flags(); 2778 set_parnew_gc_flags();
2743 } else if (UseG1GC) { 2779 } else if (UseG1GC) {
2744 set_g1_gc_flags(); 2780 set_g1_gc_flags();
2745 } 2781 }
2746 } 2782 }
2783 #endif // KERNEL
2747 2784
2748 #ifdef SERIALGC 2785 #ifdef SERIALGC
2749 assert(verify_serial_gc_flags(), "SerialGC unset"); 2786 assert(verify_serial_gc_flags(), "SerialGC unset");
2750 #endif // SERIALGC 2787 #endif // SERIALGC
2751 2788
2754 2791
2755 // Set flags if Aggressive optimization flags (-XX:+AggressiveOpts) enabled. 2792 // Set flags if Aggressive optimization flags (-XX:+AggressiveOpts) enabled.
2756 set_aggressive_opts_flags(); 2793 set_aggressive_opts_flags();
2757 2794
2758 #ifdef CC_INTERP 2795 #ifdef CC_INTERP
2759 // Biased locking is not implemented with c++ interpreter 2796 // Clear flags not supported by the C++ interpreter
2797 FLAG_SET_DEFAULT(ProfileInterpreter, false);
2760 FLAG_SET_DEFAULT(UseBiasedLocking, false); 2798 FLAG_SET_DEFAULT(UseBiasedLocking, false);
2761 #endif /* CC_INTERP */ 2799 LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false));
2800 #endif // CC_INTERP
2801
2802 #ifdef ZERO
2803 // Clear flags not supported by Zero
2804 FLAG_SET_DEFAULT(TaggedStackInterpreter, false);
2805 #endif // ZERO
2762 2806
2763 #ifdef COMPILER2 2807 #ifdef COMPILER2
2764 if (!UseBiasedLocking || EmitSync != 0) { 2808 if (!UseBiasedLocking || EmitSync != 0) {
2765 UseOptoBiasInlining = false; 2809 UseOptoBiasInlining = false;
2766 } 2810 }
2767 #endif 2811 #endif
2768 2812
2813 if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
2814 warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
2815 DebugNonSafepoints = true;
2816 }
2817
2769 if (PrintCommandLineFlags) { 2818 if (PrintCommandLineFlags) {
2770 CommandLineFlags::printSetFlags(); 2819 CommandLineFlags::printSetFlags();
2771 } 2820 }
2772 2821
2773 #ifdef ASSERT
2774 if (PrintFlagsFinal) { 2822 if (PrintFlagsFinal) {
2775 CommandLineFlags::printFlags(); 2823 CommandLineFlags::printFlags();
2776 } 2824 }
2777 #endif
2778 2825
2779 return JNI_OK; 2826 return JNI_OK;
2780 } 2827 }
2781 2828
2782 int Arguments::PropertyList_count(SystemProperty* pl) { 2829 int Arguments::PropertyList_count(SystemProperty* pl) {