Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/arguments.cpp @ 13102:f9f4503a4ab5
Merge
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Thu, 21 Nov 2013 15:04:54 +0100 |
parents | 096c224171c4 |
children | fbcdae53b17e |
comparison
equal
deleted
inserted
replaced
13101:790ebab62d23 | 13102:f9f4503a4ab5 |
---|---|
1149 } | 1149 } |
1150 if (!UseInterpreter) { // -Xcomp | 1150 if (!UseInterpreter) { // -Xcomp |
1151 Tier3InvokeNotifyFreqLog = 0; | 1151 Tier3InvokeNotifyFreqLog = 0; |
1152 Tier4InvocationThreshold = 0; | 1152 Tier4InvocationThreshold = 0; |
1153 } | 1153 } |
1154 if (FLAG_IS_DEFAULT(NmethodSweepFraction)) { | |
1155 FLAG_SET_DEFAULT(NmethodSweepFraction, 1 + ReservedCodeCacheSize / (16 * M)); | |
1156 } | |
1157 } | 1154 } |
1158 | 1155 |
1159 #if INCLUDE_ALL_GCS | 1156 #if INCLUDE_ALL_GCS |
1160 static void disable_adaptive_size_policy(const char* collector_name) { | 1157 static void disable_adaptive_size_policy(const char* collector_name) { |
1161 if (UseAdaptiveSizePolicy) { | 1158 if (UseAdaptiveSizePolicy) { |
1425 // We need to fit both the NULL page and the heap into the memory budget, while | 1422 // We need to fit both the NULL page and the heap into the memory budget, while |
1426 // keeping alignment constraints of the heap. To guarantee the latter, as the | 1423 // keeping alignment constraints of the heap. To guarantee the latter, as the |
1427 // NULL page is located before the heap, we pad the NULL page to the conservative | 1424 // NULL page is located before the heap, we pad the NULL page to the conservative |
1428 // maximum alignment that the GC may ever impose upon the heap. | 1425 // maximum alignment that the GC may ever impose upon the heap. |
1429 size_t displacement_due_to_null_page = align_size_up_(os::vm_page_size(), | 1426 size_t displacement_due_to_null_page = align_size_up_(os::vm_page_size(), |
1430 Arguments::conservative_max_heap_alignment()); | 1427 _conservative_max_heap_alignment); |
1431 | 1428 |
1432 LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page); | 1429 LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page); |
1433 NOT_LP64(ShouldNotReachHere(); return 0); | 1430 NOT_LP64(ShouldNotReachHere(); return 0); |
1434 } | 1431 } |
1435 | 1432 |
1522 } else if (UseG1GC) { | 1519 } else if (UseG1GC) { |
1523 heap_alignment = G1CollectedHeap::conservative_max_heap_alignment(); | 1520 heap_alignment = G1CollectedHeap::conservative_max_heap_alignment(); |
1524 } | 1521 } |
1525 #endif // INCLUDE_ALL_GCS | 1522 #endif // INCLUDE_ALL_GCS |
1526 _conservative_max_heap_alignment = MAX3(heap_alignment, os::max_page_size(), | 1523 _conservative_max_heap_alignment = MAX3(heap_alignment, os::max_page_size(), |
1527 CollectorPolicy::compute_max_alignment()); | 1524 CollectorPolicy::compute_heap_alignment()); |
1528 } | 1525 } |
1529 | 1526 |
1530 void Arguments::set_ergonomics_flags() { | 1527 void Arguments::set_ergonomics_flags() { |
1531 | 1528 |
1532 if (os::is_server_class_machine()) { | 1529 if (os::is_server_class_machine()) { |
1974 jio_fprintf(defaultStream::error_stream(), | 1971 jio_fprintf(defaultStream::error_stream(), |
1975 "Conflicting collector combinations in option list; " | 1972 "Conflicting collector combinations in option list; " |
1976 "please refer to the release notes for the combinations " | 1973 "please refer to the release notes for the combinations " |
1977 "allowed\n"); | 1974 "allowed\n"); |
1978 status = false; | 1975 status = false; |
1979 } else if (ReservedCodeCacheSize > 2*G) { | |
1980 // Code cache size larger than MAXINT is not supported. | |
1981 jio_fprintf(defaultStream::error_stream(), | |
1982 "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M, | |
1983 (2*G)/M); | |
1984 status = false; | |
1985 } | 1976 } |
1986 return status; | 1977 return status; |
1987 } | 1978 } |
1988 | 1979 |
1989 void Arguments::check_deprecated_gcs() { | 1980 void Arguments::check_deprecated_gcs() { |
2010 "and will likely be removed in future release"); | 2001 "and will likely be removed in future release"); |
2011 } | 2002 } |
2012 if (FLAG_IS_CMDLINE(DefaultMaxRAMFraction)) { | 2003 if (FLAG_IS_CMDLINE(DefaultMaxRAMFraction)) { |
2013 warning("DefaultMaxRAMFraction is deprecated and will likely be removed in a future release. " | 2004 warning("DefaultMaxRAMFraction is deprecated and will likely be removed in a future release. " |
2014 "Use MaxRAMFraction instead."); | 2005 "Use MaxRAMFraction instead."); |
2006 } | |
2007 if (FLAG_IS_CMDLINE(UseCMSCompactAtFullCollection)) { | |
2008 warning("UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release."); | |
2009 } | |
2010 if (FLAG_IS_CMDLINE(CMSFullGCsBeforeCompaction)) { | |
2011 warning("CMSFullGCsBeforeCompaction is deprecated and will likely be removed in a future release."); | |
2012 } | |
2013 if (FLAG_IS_CMDLINE(UseCMSCollectionPassing)) { | |
2014 warning("UseCMSCollectionPassing is deprecated and will likely be removed in a future release."); | |
2015 } | 2015 } |
2016 } | 2016 } |
2017 | 2017 |
2018 // Check stack pages settings | 2018 // Check stack pages settings |
2019 bool Arguments::check_stack_pages() | 2019 bool Arguments::check_stack_pages() |
2061 | 2061 |
2062 // Divide by bucket size to prevent a large size from causing rollover when | 2062 // Divide by bucket size to prevent a large size from causing rollover when |
2063 // calculating amount of memory needed to be allocated for the String table. | 2063 // calculating amount of memory needed to be allocated for the String table. |
2064 status = status && verify_interval(StringTableSize, minimumStringTableSize, | 2064 status = status && verify_interval(StringTableSize, minimumStringTableSize, |
2065 (max_uintx / StringTable::bucket_size()), "StringTable size"); | 2065 (max_uintx / StringTable::bucket_size()), "StringTable size"); |
2066 | |
2067 status = status && verify_interval(SymbolTableSize, minimumSymbolTableSize, | |
2068 (max_uintx / SymbolTable::bucket_size()), "SymbolTable size"); | |
2066 | 2069 |
2067 if (MinHeapFreeRatio > MaxHeapFreeRatio) { | 2070 if (MinHeapFreeRatio > MaxHeapFreeRatio) { |
2068 jio_fprintf(defaultStream::error_stream(), | 2071 jio_fprintf(defaultStream::error_stream(), |
2069 "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or " | 2072 "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or " |
2070 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n", | 2073 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n", |
2176 | 2179 |
2177 status = status && verify_min_value(ParGCArrayScanChunk, 1, "ParGCArrayScanChunk"); | 2180 status = status && verify_min_value(ParGCArrayScanChunk, 1, "ParGCArrayScanChunk"); |
2178 | 2181 |
2179 #if INCLUDE_ALL_GCS | 2182 #if INCLUDE_ALL_GCS |
2180 if (UseG1GC) { | 2183 if (UseG1GC) { |
2184 status = status && verify_percentage(G1NewSizePercent, "G1NewSizePercent"); | |
2185 status = status && verify_percentage(G1MaxNewSizePercent, "G1MaxNewSizePercent"); | |
2186 status = status && verify_interval(G1NewSizePercent, 0, G1MaxNewSizePercent, "G1NewSizePercent"); | |
2187 | |
2181 status = status && verify_percentage(InitiatingHeapOccupancyPercent, | 2188 status = status && verify_percentage(InitiatingHeapOccupancyPercent, |
2182 "InitiatingHeapOccupancyPercent"); | 2189 "InitiatingHeapOccupancyPercent"); |
2183 status = status && verify_min_value(G1RefProcDrainInterval, 1, | 2190 status = status && verify_min_value(G1RefProcDrainInterval, 1, |
2184 "G1RefProcDrainInterval"); | 2191 "G1RefProcDrainInterval"); |
2185 status = status && verify_min_value((intx)G1ConcMarkStepDurationMillis, 1, | 2192 status = status && verify_min_value((intx)G1ConcMarkStepDurationMillis, 1, |
2699 // -Xbatch | 2706 // -Xbatch |
2700 } else if (match_option(option, "-Xbatch", &tail)) { | 2707 } else if (match_option(option, "-Xbatch", &tail)) { |
2701 FLAG_SET_CMDLINE(bool, BackgroundCompilation, false); | 2708 FLAG_SET_CMDLINE(bool, BackgroundCompilation, false); |
2702 // -Xmn for compatibility with other JVM vendors | 2709 // -Xmn for compatibility with other JVM vendors |
2703 } else if (match_option(option, "-Xmn", &tail)) { | 2710 } else if (match_option(option, "-Xmn", &tail)) { |
2704 julong long_initial_eden_size = 0; | 2711 julong long_initial_young_size = 0; |
2705 ArgsRange errcode = parse_memory_size(tail, &long_initial_eden_size, 1); | 2712 ArgsRange errcode = parse_memory_size(tail, &long_initial_young_size, 1); |
2706 if (errcode != arg_in_range) { | 2713 if (errcode != arg_in_range) { |
2707 jio_fprintf(defaultStream::error_stream(), | 2714 jio_fprintf(defaultStream::error_stream(), |
2708 "Invalid initial eden size: %s\n", option->optionString); | 2715 "Invalid initial young generation size: %s\n", option->optionString); |
2709 describe_range_error(errcode); | 2716 describe_range_error(errcode); |
2710 return JNI_EINVAL; | 2717 return JNI_EINVAL; |
2711 } | 2718 } |
2712 FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_eden_size); | 2719 FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_young_size); |
2713 FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_eden_size); | 2720 FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_young_size); |
2714 // -Xms | 2721 // -Xms |
2715 } else if (match_option(option, "-Xms", &tail)) { | 2722 } else if (match_option(option, "-Xms", &tail)) { |
2716 julong long_initial_heap_size = 0; | 2723 julong long_initial_heap_size = 0; |
2717 // an initial heap size of 0 means automatically determine | 2724 // an initial heap size of 0 means automatically determine |
2718 ArgsRange errcode = parse_memory_size(tail, &long_initial_heap_size, 0); | 2725 ArgsRange errcode = parse_memory_size(tail, &long_initial_heap_size, 0); |
2720 jio_fprintf(defaultStream::error_stream(), | 2727 jio_fprintf(defaultStream::error_stream(), |
2721 "Invalid initial heap size: %s\n", option->optionString); | 2728 "Invalid initial heap size: %s\n", option->optionString); |
2722 describe_range_error(errcode); | 2729 describe_range_error(errcode); |
2723 return JNI_EINVAL; | 2730 return JNI_EINVAL; |
2724 } | 2731 } |
2732 set_min_heap_size((uintx)long_initial_heap_size); | |
2733 // Currently the minimum size and the initial heap sizes are the same. | |
2734 // Can be overridden with -XX:InitialHeapSize. | |
2725 FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size); | 2735 FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size); |
2726 // Currently the minimum size and the initial heap sizes are the same. | |
2727 set_min_heap_size(InitialHeapSize); | |
2728 // -Xmx | 2736 // -Xmx |
2729 } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) { | 2737 } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) { |
2730 julong long_max_heap_size = 0; | 2738 julong long_max_heap_size = 0; |
2731 ArgsRange errcode = parse_memory_size(tail, &long_max_heap_size, 1); | 2739 ArgsRange errcode = parse_memory_size(tail, &long_max_heap_size, 1); |
2732 if (errcode != arg_in_range) { | 2740 if (errcode != arg_in_range) { |
2736 return JNI_EINVAL; | 2744 return JNI_EINVAL; |
2737 } | 2745 } |
2738 FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size); | 2746 FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size); |
2739 // Xmaxf | 2747 // Xmaxf |
2740 } else if (match_option(option, "-Xmaxf", &tail)) { | 2748 } else if (match_option(option, "-Xmaxf", &tail)) { |
2741 int maxf = (int)(atof(tail) * 100); | 2749 char* err; |
2742 if (maxf < 0 || maxf > 100) { | 2750 int maxf = (int)(strtod(tail, &err) * 100); |
2751 if (*err != '\0' || maxf < 0 || maxf > 100) { | |
2743 jio_fprintf(defaultStream::error_stream(), | 2752 jio_fprintf(defaultStream::error_stream(), |
2744 "Bad max heap free percentage size: %s\n", | 2753 "Bad max heap free percentage size: %s\n", |
2745 option->optionString); | 2754 option->optionString); |
2746 return JNI_EINVAL; | 2755 return JNI_EINVAL; |
2747 } else { | 2756 } else { |
2748 FLAG_SET_CMDLINE(uintx, MaxHeapFreeRatio, maxf); | 2757 FLAG_SET_CMDLINE(uintx, MaxHeapFreeRatio, maxf); |
2749 } | 2758 } |
2750 // Xminf | 2759 // Xminf |
2751 } else if (match_option(option, "-Xminf", &tail)) { | 2760 } else if (match_option(option, "-Xminf", &tail)) { |
2752 int minf = (int)(atof(tail) * 100); | 2761 char* err; |
2753 if (minf < 0 || minf > 100) { | 2762 int minf = (int)(strtod(tail, &err) * 100); |
2763 if (*err != '\0' || minf < 0 || minf > 100) { | |
2754 jio_fprintf(defaultStream::error_stream(), | 2764 jio_fprintf(defaultStream::error_stream(), |
2755 "Bad min heap free percentage size: %s\n", | 2765 "Bad min heap free percentage size: %s\n", |
2756 option->optionString); | 2766 option->optionString); |
2757 return JNI_EINVAL; | 2767 return JNI_EINVAL; |
2758 } else { | 2768 } else { |
3691 if (CompilationPolicyChoice >= 2) { | 3701 if (CompilationPolicyChoice >= 2) { |
3692 vm_exit_during_initialization( | 3702 vm_exit_during_initialization( |
3693 "Incompatible compilation policy selected", NULL); | 3703 "Incompatible compilation policy selected", NULL); |
3694 } | 3704 } |
3695 } | 3705 } |
3706 // Set NmethodSweepFraction after the size of the code cache is adapted (in case of tiered) | |
3707 if (FLAG_IS_DEFAULT(NmethodSweepFraction)) { | |
3708 FLAG_SET_DEFAULT(NmethodSweepFraction, 1 + ReservedCodeCacheSize / (16 * M)); | |
3709 } | |
3710 | |
3696 | 3711 |
3697 // Set heap size based on available physical memory | 3712 // Set heap size based on available physical memory |
3698 set_heap_size(); | 3713 set_heap_size(); |
3699 | 3714 |
3700 #if INCLUDE_ALL_GCS | 3715 #if INCLUDE_ALL_GCS |
3718 } | 3733 } |
3719 } | 3734 } |
3720 #else // INCLUDE_ALL_GCS | 3735 #else // INCLUDE_ALL_GCS |
3721 assert(verify_serial_gc_flags(), "SerialGC unset"); | 3736 assert(verify_serial_gc_flags(), "SerialGC unset"); |
3722 #endif // INCLUDE_ALL_GCS | 3737 #endif // INCLUDE_ALL_GCS |
3738 | |
3739 // Initialize Metaspace flags and alignments. | |
3740 Metaspace::ergo_initialize(); | |
3723 | 3741 |
3724 // Set bytecode rewriting flags | 3742 // Set bytecode rewriting flags |
3725 set_bytecode_flags(); | 3743 set_bytecode_flags(); |
3726 | 3744 |
3727 // Set flags if Aggressive optimization flags (-XX:+AggressiveOpts) enabled. | 3745 // Set flags if Aggressive optimization flags (-XX:+AggressiveOpts) enabled. |
3772 #endif | 3790 #endif |
3773 if (IncrementalInline && FLAG_IS_DEFAULT(MaxNodeLimit)) { | 3791 if (IncrementalInline && FLAG_IS_DEFAULT(MaxNodeLimit)) { |
3774 // incremental inlining: bump MaxNodeLimit | 3792 // incremental inlining: bump MaxNodeLimit |
3775 FLAG_SET_DEFAULT(MaxNodeLimit, (intx)75000); | 3793 FLAG_SET_DEFAULT(MaxNodeLimit, (intx)75000); |
3776 } | 3794 } |
3795 if (!UseTypeSpeculation && FLAG_IS_DEFAULT(TypeProfileLevel)) { | |
3796 // nothing to use the profiling, turn if off | |
3797 FLAG_SET_DEFAULT(TypeProfileLevel, 0); | |
3798 } | |
3799 if (UseTypeSpeculation && FLAG_IS_DEFAULT(ReplaceInParentMaps)) { | |
3800 // Doing the replace in parent maps helps speculation | |
3801 FLAG_SET_DEFAULT(ReplaceInParentMaps, true); | |
3802 } | |
3803 #ifndef X86 | |
3804 // Only on x86 for now | |
3805 FLAG_SET_DEFAULT(TypeProfileLevel, 0); | |
3806 #endif | |
3777 #endif | 3807 #endif |
3778 | 3808 |
3779 if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) { | 3809 if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) { |
3780 warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output"); | 3810 warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output"); |
3781 DebugNonSafepoints = true; | 3811 DebugNonSafepoints = true; |