1.1 --- a/src/share/vm/runtime/compilationPolicy.cpp Fri Sep 24 13:14:32 2010 -0700 1.2 +++ b/src/share/vm/runtime/compilationPolicy.cpp Mon Sep 27 15:04:40 2010 -0700 1.3 @@ -129,16 +129,31 @@ 1.4 } 1.5 } 1.6 1.7 +// Note: this policy is used ONLY if TieredCompilation is off. 1.8 +// compiler_count() behaves the following way: 1.9 +// - with TIERED build (with both COMPILER1 and COMPILER2 defined) it should return 1.10 +// zero for the c1 compilation levels, hence the particular ordering of the 1.11 +// statements. 1.12 +// - the same should happen when COMPILER2 is defined and COMPILER1 is not 1.13 +// (server build without TIERED defined). 1.14 +// - if only COMPILER1 is defined (client build), zero should be returned for 1.15 +// the c2 level. 1.16 +// - if neither is defined - always return zero. 1.17 int NonTieredCompPolicy::compiler_count(CompLevel comp_level) { 1.18 + assert(!TieredCompilation, "This policy should not be used with TieredCompilation"); 1.19 +#ifdef COMPILER2 1.20 + if (is_c2_compile(comp_level)) { 1.21 + return _compiler_count; 1.22 + } else { 1.23 + return 0; 1.24 + } 1.25 +#endif 1.26 + 1.27 #ifdef COMPILER1 1.28 if (is_c1_compile(comp_level)) { 1.29 return _compiler_count; 1.30 - } 1.31 -#endif 1.32 - 1.33 -#ifdef COMPILER2 1.34 - if (is_c2_compile(comp_level)) { 1.35 - return _compiler_count; 1.36 + } else { 1.37 + return 0; 1.38 } 1.39 #endif 1.40