< prev index next >

src/hotspot/share/prims/whitebox.cpp

Print this page

1072   if (method == nullptr) {
1073     tty->print_cr("WB error: request to compile null method");
1074     return false;
1075   }
1076   if (comp_level > CompilationPolicy::highest_compile_level()) {
1077     tty->print_cr("WB error: invalid compilation level %d", comp_level);
1078     return false;
1079   }
1080   if (comp == nullptr) {
1081     tty->print_cr("WB error: no compiler for requested compilation level %d", comp_level);
1082     return false;
1083   }
1084 
1085   // Check if compilation is blocking
1086   methodHandle mh(THREAD, method);
1087   DirectiveSet* directive = DirectivesStack::getMatchingDirective(mh, comp);
1088   bool is_blocking = !directive->BackgroundCompilationOption;
1089   DirectivesStack::release(directive);
1090 
1091   // Compile method and check result
1092   nmethod* nm = CompileBroker::compile_method(mh, bci, comp_level, mh, mh->invocation_count(), CompileTask::Reason_Whitebox, CHECK_false);
1093   MutexLocker mu(THREAD, Compile_lock);
1094   bool is_queued = mh->queued_for_compilation();
1095   if ((!is_blocking && is_queued) || nm != nullptr) {
1096     return true;
1097   }
1098   // Check code again because compilation may be finished before Compile_lock is acquired.
1099   if (bci == InvocationEntryBci) {
1100     CompiledMethod* code = mh->code();
1101     if (code != nullptr && code->as_nmethod_or_null() != nullptr) {
1102       return true;
1103     }
1104   } else if (mh->lookup_osr_nmethod_for(bci, comp_level, false) != nullptr) {
1105     return true;
1106   }
1107   tty->print("WB error: failed to %s compile at level %d method ", is_blocking ? "blocking" : "", comp_level);
1108   mh->print_short_name(tty);
1109   tty->cr();
1110   if (is_blocking && is_queued) {
1111     tty->print_cr("WB error: blocking compilation is still in queue!");
1112   }

1072   if (method == nullptr) {
1073     tty->print_cr("WB error: request to compile null method");
1074     return false;
1075   }
1076   if (comp_level > CompilationPolicy::highest_compile_level()) {
1077     tty->print_cr("WB error: invalid compilation level %d", comp_level);
1078     return false;
1079   }
1080   if (comp == nullptr) {
1081     tty->print_cr("WB error: no compiler for requested compilation level %d", comp_level);
1082     return false;
1083   }
1084 
1085   // Check if compilation is blocking
1086   methodHandle mh(THREAD, method);
1087   DirectiveSet* directive = DirectivesStack::getMatchingDirective(mh, comp);
1088   bool is_blocking = !directive->BackgroundCompilationOption;
1089   DirectivesStack::release(directive);
1090 
1091   // Compile method and check result
1092   nmethod* nm = CompileBroker::compile_method(mh, bci, comp_level, mh, mh->invocation_count(), false, CompileTask::Reason_Whitebox, CHECK_false);
1093   MutexLocker mu(THREAD, Compile_lock);
1094   bool is_queued = mh->queued_for_compilation();
1095   if ((!is_blocking && is_queued) || nm != nullptr) {
1096     return true;
1097   }
1098   // Check code again because compilation may be finished before Compile_lock is acquired.
1099   if (bci == InvocationEntryBci) {
1100     CompiledMethod* code = mh->code();
1101     if (code != nullptr && code->as_nmethod_or_null() != nullptr) {
1102       return true;
1103     }
1104   } else if (mh->lookup_osr_nmethod_for(bci, comp_level, false) != nullptr) {
1105     return true;
1106   }
1107   tty->print("WB error: failed to %s compile at level %d method ", is_blocking ? "blocking" : "", comp_level);
1108   mh->print_short_name(tty);
1109   tty->cr();
1110   if (is_blocking && is_queued) {
1111     tty->print_cr("WB error: blocking compilation is still in queue!");
1112   }
< prev index next >