Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 1805:a25394352030
Merge
author | kamg |
---|---|
date | Wed, 22 Sep 2010 12:54:51 -0400 |
parents | 728a287f6c20 18c378513575 |
children | 22e4420d19f7 dfb38ea7da17 |
comparison
equal
deleted
inserted
replaced
1804:2966dab85b3e | 1805:a25394352030 |
---|---|
48 // These parameters are reset in method parse_vm_init_args(JavaVMInitArgs*) | 48 // These parameters are reset in method parse_vm_init_args(JavaVMInitArgs*) |
49 bool Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods; | 49 bool Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods; |
50 bool Arguments::_UseOnStackReplacement = UseOnStackReplacement; | 50 bool Arguments::_UseOnStackReplacement = UseOnStackReplacement; |
51 bool Arguments::_BackgroundCompilation = BackgroundCompilation; | 51 bool Arguments::_BackgroundCompilation = BackgroundCompilation; |
52 bool Arguments::_ClipInlining = ClipInlining; | 52 bool Arguments::_ClipInlining = ClipInlining; |
53 intx Arguments::_Tier2CompileThreshold = Tier2CompileThreshold; | |
54 | 53 |
55 char* Arguments::SharedArchivePath = NULL; | 54 char* Arguments::SharedArchivePath = NULL; |
56 | 55 |
57 AgentLibraryList Arguments::_libraryList; | 56 AgentLibraryList Arguments::_libraryList; |
58 AgentLibraryList Arguments::_agentList; | 57 AgentLibraryList Arguments::_agentList; |
911 // use the saved values | 910 // use the saved values |
912 ClipInlining = Arguments::_ClipInlining; | 911 ClipInlining = Arguments::_ClipInlining; |
913 AlwaysCompileLoopMethods = Arguments::_AlwaysCompileLoopMethods; | 912 AlwaysCompileLoopMethods = Arguments::_AlwaysCompileLoopMethods; |
914 UseOnStackReplacement = Arguments::_UseOnStackReplacement; | 913 UseOnStackReplacement = Arguments::_UseOnStackReplacement; |
915 BackgroundCompilation = Arguments::_BackgroundCompilation; | 914 BackgroundCompilation = Arguments::_BackgroundCompilation; |
916 Tier2CompileThreshold = Arguments::_Tier2CompileThreshold; | |
917 | 915 |
918 // Change from defaults based on mode | 916 // Change from defaults based on mode |
919 switch (mode) { | 917 switch (mode) { |
920 default: | 918 default: |
921 ShouldNotReachHere(); | 919 ShouldNotReachHere(); |
945 jio_fprintf(defaultStream::error_stream(), | 943 jio_fprintf(defaultStream::error_stream(), |
946 "Class data sharing is inconsistent with other specified options.\n"); | 944 "Class data sharing is inconsistent with other specified options.\n"); |
947 vm_exit_during_initialization("Unable to use shared archive.", NULL); | 945 vm_exit_during_initialization("Unable to use shared archive.", NULL); |
948 } else { | 946 } else { |
949 FLAG_SET_DEFAULT(UseSharedSpaces, false); | 947 FLAG_SET_DEFAULT(UseSharedSpaces, false); |
948 } | |
949 } | |
950 | |
951 void Arguments::set_tiered_flags() { | |
952 if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) { | |
953 FLAG_SET_DEFAULT(CompilationPolicyChoice, 2); | |
954 } | |
955 | |
956 if (CompilationPolicyChoice < 2) { | |
957 vm_exit_during_initialization( | |
958 "Incompatible compilation policy selected", NULL); | |
959 } | |
960 | |
961 #ifdef _LP64 | |
962 if (FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops)) { | |
963 UseCompressedOops = false; | |
964 } | |
965 if (UseCompressedOops) { | |
966 vm_exit_during_initialization( | |
967 "Tiered compilation is not supported with compressed oops yet", NULL); | |
968 } | |
969 #endif | |
970 // Increase the code cache size - tiered compiles a lot more. | |
971 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { | |
972 FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2); | |
950 } | 973 } |
951 } | 974 } |
952 | 975 |
953 #ifndef KERNEL | 976 #ifndef KERNEL |
954 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC | 977 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC |
1248 } | 1271 } |
1249 return true; | 1272 return true; |
1250 } | 1273 } |
1251 | 1274 |
1252 inline uintx max_heap_for_compressed_oops() { | 1275 inline uintx max_heap_for_compressed_oops() { |
1253 LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size()); | 1276 // Heap should be above HeapBaseMinAddress to get zero based compressed oops. |
1277 LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size() - HeapBaseMinAddress); | |
1254 NOT_LP64(ShouldNotReachHere(); return 0); | 1278 NOT_LP64(ShouldNotReachHere(); return 0); |
1255 } | 1279 } |
1256 | 1280 |
1257 bool Arguments::should_auto_select_low_pause_collector() { | 1281 bool Arguments::should_auto_select_low_pause_collector() { |
1258 if (UseAutoGCSelectPolicy && | 1282 if (UseAutoGCSelectPolicy && |
1297 #ifndef ZERO | 1321 #ifndef ZERO |
1298 #ifdef _LP64 | 1322 #ifdef _LP64 |
1299 // Check that UseCompressedOops can be set with the max heap size allocated | 1323 // Check that UseCompressedOops can be set with the max heap size allocated |
1300 // by ergonomics. | 1324 // by ergonomics. |
1301 if (MaxHeapSize <= max_heap_for_compressed_oops()) { | 1325 if (MaxHeapSize <= max_heap_for_compressed_oops()) { |
1302 #ifndef COMPILER1 | 1326 #if !defined(COMPILER1) || defined(TIERED) |
1303 if (FLAG_IS_DEFAULT(UseCompressedOops) && !UseG1GC) { | 1327 if (FLAG_IS_DEFAULT(UseCompressedOops) && !UseG1GC) { |
1304 FLAG_SET_ERGO(bool, UseCompressedOops, true); | 1328 FLAG_SET_ERGO(bool, UseCompressedOops, true); |
1305 } | 1329 } |
1306 #endif | 1330 #endif |
1307 #ifdef _WIN64 | 1331 #ifdef _WIN64 |
1931 // Save default settings for some mode flags | 1955 // Save default settings for some mode flags |
1932 Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods; | 1956 Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods; |
1933 Arguments::_UseOnStackReplacement = UseOnStackReplacement; | 1957 Arguments::_UseOnStackReplacement = UseOnStackReplacement; |
1934 Arguments::_ClipInlining = ClipInlining; | 1958 Arguments::_ClipInlining = ClipInlining; |
1935 Arguments::_BackgroundCompilation = BackgroundCompilation; | 1959 Arguments::_BackgroundCompilation = BackgroundCompilation; |
1936 Arguments::_Tier2CompileThreshold = Tier2CompileThreshold; | |
1937 | 1960 |
1938 // Parse JAVA_TOOL_OPTIONS environment variable (if present) | 1961 // Parse JAVA_TOOL_OPTIONS environment variable (if present) |
1939 jint result = parse_java_tool_options_environment_variable(&scp, &scp_assembly_required); | 1962 jint result = parse_java_tool_options_environment_variable(&scp, &scp_assembly_required); |
1940 if (result != JNI_OK) { | 1963 if (result != JNI_OK) { |
1941 return result; | 1964 return result; |
2649 } | 2672 } |
2650 if (CompileThreshold == 0) { | 2673 if (CompileThreshold == 0) { |
2651 set_mode_flags(_int); | 2674 set_mode_flags(_int); |
2652 } | 2675 } |
2653 | 2676 |
2654 #ifdef TIERED | |
2655 // If we are using tiered compilation in the tiered vm then c1 will | |
2656 // do the profiling and we don't want to waste that time in the | |
2657 // interpreter. | |
2658 if (TieredCompilation) { | |
2659 ProfileInterpreter = false; | |
2660 } else { | |
2661 // Since we are running vanilla server we must adjust the compile threshold | |
2662 // unless the user has already adjusted it because the default threshold assumes | |
2663 // we will run tiered. | |
2664 | |
2665 if (FLAG_IS_DEFAULT(CompileThreshold)) { | |
2666 CompileThreshold = Tier2CompileThreshold; | |
2667 } | |
2668 } | |
2669 #endif // TIERED | |
2670 | |
2671 #ifndef COMPILER2 | 2677 #ifndef COMPILER2 |
2672 // Don't degrade server performance for footprint | 2678 // Don't degrade server performance for footprint |
2673 if (FLAG_IS_DEFAULT(UseLargePages) && | 2679 if (FLAG_IS_DEFAULT(UseLargePages) && |
2674 MaxHeapSize < LargePageHeapSizeThreshold) { | 2680 MaxHeapSize < LargePageHeapSizeThreshold) { |
2675 // No need for large granularity pages w/small heaps. | 2681 // No need for large granularity pages w/small heaps. |
2680 SOLARIS_ONLY(FLAG_SET_DEFAULT(UseISM, false)); | 2686 SOLARIS_ONLY(FLAG_SET_DEFAULT(UseISM, false)); |
2681 } | 2687 } |
2682 | 2688 |
2683 // Tiered compilation is undefined with C1. | 2689 // Tiered compilation is undefined with C1. |
2684 TieredCompilation = false; | 2690 TieredCompilation = false; |
2685 | |
2686 #else | 2691 #else |
2687 if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) { | 2692 if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) { |
2688 FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1); | 2693 FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1); |
2689 } | 2694 } |
2690 // Temporary disable bulk zeroing reduction with G1. See CR 6627983. | 2695 // Temporary disable bulk zeroing reduction with G1. See CR 6627983. |
2944 if (PrintGCDetails) { | 2949 if (PrintGCDetails) { |
2945 // Turn on -verbose:gc options as well | 2950 // Turn on -verbose:gc options as well |
2946 PrintGC = true; | 2951 PrintGC = true; |
2947 } | 2952 } |
2948 | 2953 |
2949 #if defined(_LP64) && defined(COMPILER1) | 2954 #if defined(_LP64) && defined(COMPILER1) && !defined(TIERED) |
2950 UseCompressedOops = false; | 2955 UseCompressedOops = false; |
2951 #endif | 2956 #endif |
2952 | 2957 |
2953 // Set object alignment values. | 2958 // Set object alignment values. |
2954 set_object_alignment(); | 2959 set_object_alignment(); |
2973 #endif // _LP64 | 2978 #endif // _LP64 |
2974 | 2979 |
2975 // Check the GC selections again. | 2980 // Check the GC selections again. |
2976 if (!check_gc_consistency()) { | 2981 if (!check_gc_consistency()) { |
2977 return JNI_EINVAL; | 2982 return JNI_EINVAL; |
2983 } | |
2984 | |
2985 if (TieredCompilation) { | |
2986 set_tiered_flags(); | |
2987 } else { | |
2988 // Check if the policy is valid. Policies 0 and 1 are valid for non-tiered setup. | |
2989 if (CompilationPolicyChoice >= 2) { | |
2990 vm_exit_during_initialization( | |
2991 "Incompatible compilation policy selected", NULL); | |
2992 } | |
2978 } | 2993 } |
2979 | 2994 |
2980 #ifndef KERNEL | 2995 #ifndef KERNEL |
2981 if (UseConcMarkSweepGC) { | 2996 if (UseConcMarkSweepGC) { |
2982 // Set flags for CMS and ParNew. Check UseConcMarkSweep first | 2997 // Set flags for CMS and ParNew. Check UseConcMarkSweep first |