hotspot/src/share/vm/runtime/compilationPolicy.cpp
changeset 6747 ab166511728e
parent 6453 970dc585ab63
child 7397 5b173b4ca846
equal deleted inserted replaced
6746:c12892ba621d 6747:ab166511728e
   127   } else {
   127   } else {
   128     _compiler_count = CICompilerCount;
   128     _compiler_count = CICompilerCount;
   129   }
   129   }
   130 }
   130 }
   131 
   131 
       
   132 // Note: this policy is used ONLY if TieredCompilation is off.
       
   133 // compiler_count() behaves the following way:
       
   134 // - with TIERED build (with both COMPILER1 and COMPILER2 defined) it should return
       
   135 //   zero for the c1 compilation levels, hence the particular ordering of the
       
   136 //   statements.
       
   137 // - the same should happen when COMPILER2 is defined and COMPILER1 is not
       
   138 //   (server build without TIERED defined).
       
   139 // - if only COMPILER1 is defined (client build), zero should be returned for
       
   140 //   the c2 level.
       
   141 // - if neither is defined - always return zero.
   132 int NonTieredCompPolicy::compiler_count(CompLevel comp_level) {
   142 int NonTieredCompPolicy::compiler_count(CompLevel comp_level) {
       
   143   assert(!TieredCompilation, "This policy should not be used with TieredCompilation");
       
   144 #ifdef COMPILER2
       
   145   if (is_c2_compile(comp_level)) {
       
   146     return _compiler_count;
       
   147   } else {
       
   148     return 0;
       
   149   }
       
   150 #endif
       
   151 
   133 #ifdef COMPILER1
   152 #ifdef COMPILER1
   134   if (is_c1_compile(comp_level)) {
   153   if (is_c1_compile(comp_level)) {
   135     return _compiler_count;
   154     return _compiler_count;
   136   }
   155   } else {
   137 #endif
   156     return 0;
   138 
       
   139 #ifdef COMPILER2
       
   140   if (is_c2_compile(comp_level)) {
       
   141     return _compiler_count;
       
   142   }
   157   }
   143 #endif
   158 #endif
   144 
   159 
   145   return 0;
   160   return 0;
   146 }
   161 }