// Note: this policy is used ONLY if TieredCompilation is off. // compiler_count() behaves the following way: // - with TIERED build (with both COMPILER1 and COMPILER2 defined) it should return // zero for the c1 compilation levels, hence the particular ordering of the // statements. // - the same should happen when COMPILER2 is defined and COMPILER1 is not // (server build without TIERED defined). // - if only COMPILER1 is defined (client build), zero should be returned for // the c2 level. // - if neither is defined - always return zero. int NonTieredCompPolicy::compiler_count(CompLevel comp_level) { assert(!TieredCompilation, "This policy should not be used with TieredCompilation"); #ifdef COMPILER2 if (is_c2_compile(comp_level)) { return _compiler_count; } else { return 0; } #endif #ifdef COMPILER1 if (is_c1_compile(comp_level)) { return _compiler_count; } else { return 0; } #endif return 0; }
static CompileQueue* compile_queue(int comp_level) { if (is_c2_compile(comp_level)) return _c2_method_queue; if (is_c1_compile(comp_level)) return _c1_method_queue; return NULL; }
static AbstractCompiler* compiler(int comp_level) { if (is_c2_compile(comp_level)) return _compilers[1]; // C2 if (is_c1_compile(comp_level)) return _compilers[0]; // C1 return NULL; }
inline bool is_compile(int comp_level) { return is_c1_compile(comp_level) || is_c2_compile(comp_level); }