1.1 --- a/src/share/vm/runtime/arguments.cpp Thu Sep 16 13:45:55 2010 -0700 1.2 +++ b/src/share/vm/runtime/arguments.cpp Thu Sep 16 16:48:40 2010 -0700 1.3 @@ -50,7 +50,6 @@ 1.4 bool Arguments::_UseOnStackReplacement = UseOnStackReplacement; 1.5 bool Arguments::_BackgroundCompilation = BackgroundCompilation; 1.6 bool Arguments::_ClipInlining = ClipInlining; 1.7 -intx Arguments::_Tier2CompileThreshold = Tier2CompileThreshold; 1.8 1.9 char* Arguments::SharedArchivePath = NULL; 1.10 1.11 @@ -913,7 +912,6 @@ 1.12 AlwaysCompileLoopMethods = Arguments::_AlwaysCompileLoopMethods; 1.13 UseOnStackReplacement = Arguments::_UseOnStackReplacement; 1.14 BackgroundCompilation = Arguments::_BackgroundCompilation; 1.15 - Tier2CompileThreshold = Arguments::_Tier2CompileThreshold; 1.16 1.17 // Change from defaults based on mode 1.18 switch (mode) { 1.19 @@ -950,6 +948,31 @@ 1.20 } 1.21 } 1.22 1.23 +void Arguments::set_tiered_flags() { 1.24 + if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) { 1.25 + FLAG_SET_DEFAULT(CompilationPolicyChoice, 2); 1.26 + } 1.27 + 1.28 + if (CompilationPolicyChoice < 2) { 1.29 + vm_exit_during_initialization( 1.30 + "Incompatible compilation policy selected", NULL); 1.31 + } 1.32 + 1.33 +#ifdef _LP64 1.34 + if (FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops)) { 1.35 + UseCompressedOops = false; 1.36 + } 1.37 + if (UseCompressedOops) { 1.38 + vm_exit_during_initialization( 1.39 + "Tiered compilation is not supported with compressed oops yet", NULL); 1.40 + } 1.41 +#endif 1.42 + // Increase the code cache size - tiered compiles a lot more. 1.43 + if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { 1.44 + FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2); 1.45 + } 1.46 +} 1.47 + 1.48 #ifndef KERNEL 1.49 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC 1.50 // if it's not explictly set or unset. If the user has chosen 1.51 @@ -1250,7 +1273,8 @@ 1.52 } 1.53 1.54 inline uintx max_heap_for_compressed_oops() { 1.55 - LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size()); 1.56 + // Heap should be above HeapBaseMinAddress to get zero based compressed oops. 1.57 + LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size() - HeapBaseMinAddress); 1.58 NOT_LP64(ShouldNotReachHere(); return 0); 1.59 } 1.60 1.61 @@ -1299,7 +1323,7 @@ 1.62 // Check that UseCompressedOops can be set with the max heap size allocated 1.63 // by ergonomics. 1.64 if (MaxHeapSize <= max_heap_for_compressed_oops()) { 1.65 -#ifndef COMPILER1 1.66 +#if !defined(COMPILER1) || defined(TIERED) 1.67 if (FLAG_IS_DEFAULT(UseCompressedOops) && !UseG1GC) { 1.68 FLAG_SET_ERGO(bool, UseCompressedOops, true); 1.69 } 1.70 @@ -1933,7 +1957,6 @@ 1.71 Arguments::_UseOnStackReplacement = UseOnStackReplacement; 1.72 Arguments::_ClipInlining = ClipInlining; 1.73 Arguments::_BackgroundCompilation = BackgroundCompilation; 1.74 - Arguments::_Tier2CompileThreshold = Tier2CompileThreshold; 1.75 1.76 // Parse JAVA_TOOL_OPTIONS environment variable (if present) 1.77 jint result = parse_java_tool_options_environment_variable(&scp, &scp_assembly_required); 1.78 @@ -2651,23 +2674,6 @@ 1.79 set_mode_flags(_int); 1.80 } 1.81 1.82 -#ifdef TIERED 1.83 - // If we are using tiered compilation in the tiered vm then c1 will 1.84 - // do the profiling and we don't want to waste that time in the 1.85 - // interpreter. 1.86 - if (TieredCompilation) { 1.87 - ProfileInterpreter = false; 1.88 - } else { 1.89 - // Since we are running vanilla server we must adjust the compile threshold 1.90 - // unless the user has already adjusted it because the default threshold assumes 1.91 - // we will run tiered. 1.92 - 1.93 - if (FLAG_IS_DEFAULT(CompileThreshold)) { 1.94 - CompileThreshold = Tier2CompileThreshold; 1.95 - } 1.96 - } 1.97 -#endif // TIERED 1.98 - 1.99 #ifndef COMPILER2 1.100 // Don't degrade server performance for footprint 1.101 if (FLAG_IS_DEFAULT(UseLargePages) && 1.102 @@ -2682,7 +2688,6 @@ 1.103 1.104 // Tiered compilation is undefined with C1. 1.105 TieredCompilation = false; 1.106 - 1.107 #else 1.108 if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) { 1.109 FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1); 1.110 @@ -2946,7 +2951,7 @@ 1.111 PrintGC = true; 1.112 } 1.113 1.114 -#if defined(_LP64) && defined(COMPILER1) 1.115 +#if defined(_LP64) && defined(COMPILER1) && !defined(TIERED) 1.116 UseCompressedOops = false; 1.117 #endif 1.118 1.119 @@ -2977,6 +2982,16 @@ 1.120 return JNI_EINVAL; 1.121 } 1.122 1.123 + if (TieredCompilation) { 1.124 + set_tiered_flags(); 1.125 + } else { 1.126 + // Check if the policy is valid. Policies 0 and 1 are valid for non-tiered setup. 1.127 + if (CompilationPolicyChoice >= 2) { 1.128 + vm_exit_during_initialization( 1.129 + "Incompatible compilation policy selected", NULL); 1.130 + } 1.131 + } 1.132 + 1.133 #ifndef KERNEL 1.134 if (UseConcMarkSweepGC) { 1.135 // Set flags for CMS and ParNew. Check UseConcMarkSweep first