src/share/vm/compiler/compileBroker.cpp

Print this page




1192                                hot_method, hot_count, comment,
1193                                blocking);
1194   }
1195 
1196   if (blocking) {
1197     wait_for_completion(task);
1198   }
1199 }
1200 
1201 
1202 nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
1203                                        int comp_level,
1204                                        methodHandle hot_method, int hot_count,
1205                                        const char* comment, Thread* THREAD) {
1206   // make sure arguments make sense
1207   assert(method->method_holder()->oop_is_instance(), "not an instance method");
1208   assert(osr_bci == InvocationEntryBci || (0 <= osr_bci && osr_bci < method->code_size()), "bci out of range");
1209   assert(!method->is_abstract() && (osr_bci == InvocationEntryBci || !method->is_native()), "cannot compile abstract/native methods");
1210   assert(!method->method_holder()->is_not_initialized(), "method holder must be initialized");
1211 
1212   if (!TieredCompilation) {
1213     comp_level = CompLevel_highest_tier;
1214   }
1215 
1216   // return quickly if possible
1217 
1218   // lock, make sure that the compilation
1219   // isn't prohibited in a straightforward way.
1220 
1221   if (compiler(comp_level) == NULL || !compiler(comp_level)->can_compile_method(method) || compilation_is_prohibited(method, osr_bci, comp_level)) {
1222     return NULL;
1223   }
1224 
1225   if (osr_bci == InvocationEntryBci) {
1226     // standard compilation
1227     nmethod* method_code = method->code();
1228     if (method_code != NULL) {
1229       if (compilation_is_complete(method, osr_bci, comp_level)) {
1230         return method_code;
1231       }
1232     }
1233     if (method->is_not_compilable(comp_level)) return NULL;
1234 
1235     if (UseCodeCacheFlushing) {




1192                                hot_method, hot_count, comment,
1193                                blocking);
1194   }
1195 
1196   if (blocking) {
1197     wait_for_completion(task);
1198   }
1199 }
1200 
1201 
1202 nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
1203                                        int comp_level,
1204                                        methodHandle hot_method, int hot_count,
1205                                        const char* comment, Thread* THREAD) {
1206   // make sure arguments make sense
1207   assert(method->method_holder()->oop_is_instance(), "not an instance method");
1208   assert(osr_bci == InvocationEntryBci || (0 <= osr_bci && osr_bci < method->code_size()), "bci out of range");
1209   assert(!method->is_abstract() && (osr_bci == InvocationEntryBci || !method->is_native()), "cannot compile abstract/native methods");
1210   assert(!method->method_holder()->is_not_initialized(), "method holder must be initialized");
1211 




1212   // return quickly if possible
1213 
1214   // lock, make sure that the compilation
1215   // isn't prohibited in a straightforward way.
1216 
1217   if (compiler(comp_level) == NULL || !compiler(comp_level)->can_compile_method(method) || compilation_is_prohibited(method, osr_bci, comp_level)) {
1218     return NULL;
1219   }
1220 
1221   if (osr_bci == InvocationEntryBci) {
1222     // standard compilation
1223     nmethod* method_code = method->code();
1224     if (method_code != NULL) {
1225       if (compilation_is_complete(method, osr_bci, comp_level)) {
1226         return method_code;
1227       }
1228     }
1229     if (method->is_not_compilable(comp_level)) return NULL;
1230 
1231     if (UseCodeCacheFlushing) {