< prev index next >

src/hotspot/share/prims/whitebox.cpp

Print this page

1107   if (method->is_abstract()) {
1108     tty->print_cr("WB error: request to compile abstract method");
1109     return false;
1110   }
1111   if (comp_level > CompilationPolicy::highest_compile_level()) {
1112     tty->print_cr("WB error: invalid compilation level %d", comp_level);
1113     return false;
1114   }
1115   if (comp == nullptr) {
1116     tty->print_cr("WB error: no compiler for requested compilation level %d", comp_level);
1117     return false;
1118   }
1119 
1120   // Check if compilation is blocking
1121   methodHandle mh(THREAD, method);
1122   DirectiveSet* directive = DirectivesStack::getMatchingDirective(mh, comp);
1123   bool is_blocking = !directive->BackgroundCompilationOption;
1124   DirectivesStack::release(directive);
1125 
1126   // Compile method and check result
1127   nmethod* nm = CompileBroker::compile_method(mh, bci, comp_level, mh, mh->invocation_count(), CompileTask::Reason_Whitebox, CHECK_false);
1128   MutexLocker mu(THREAD, Compile_lock);
1129   bool is_queued = mh->queued_for_compilation();
1130   if ((!is_blocking && is_queued) || nm != nullptr) {
1131     return true;
1132   }
1133   // Check code again because compilation may be finished before Compile_lock is acquired.
1134   if (bci == InvocationEntryBci) {
1135     nmethod* code = mh->code();
1136     if (code != nullptr) {
1137       return true;
1138     }
1139   } else if (mh->lookup_osr_nmethod_for(bci, comp_level, false) != nullptr) {
1140     return true;
1141   }
1142   tty->print("WB error: failed to %s compile at level %d method ", is_blocking ? "blocking" : "", comp_level);
1143   mh->print_short_name(tty);
1144   tty->cr();
1145   if (is_blocking && is_queued) {
1146     tty->print_cr("WB error: blocking compilation is still in queue!");
1147   }

1107   if (method->is_abstract()) {
1108     tty->print_cr("WB error: request to compile abstract method");
1109     return false;
1110   }
1111   if (comp_level > CompilationPolicy::highest_compile_level()) {
1112     tty->print_cr("WB error: invalid compilation level %d", comp_level);
1113     return false;
1114   }
1115   if (comp == nullptr) {
1116     tty->print_cr("WB error: no compiler for requested compilation level %d", comp_level);
1117     return false;
1118   }
1119 
1120   // Check if compilation is blocking
1121   methodHandle mh(THREAD, method);
1122   DirectiveSet* directive = DirectivesStack::getMatchingDirective(mh, comp);
1123   bool is_blocking = !directive->BackgroundCompilationOption;
1124   DirectivesStack::release(directive);
1125 
1126   // Compile method and check result
1127   nmethod* nm = CompileBroker::compile_method(mh, bci, comp_level, mh, mh->invocation_count(), false, CompileTask::Reason_Whitebox, CHECK_false);
1128   MutexLocker mu(THREAD, Compile_lock);
1129   bool is_queued = mh->queued_for_compilation();
1130   if ((!is_blocking && is_queued) || nm != nullptr) {
1131     return true;
1132   }
1133   // Check code again because compilation may be finished before Compile_lock is acquired.
1134   if (bci == InvocationEntryBci) {
1135     nmethod* code = mh->code();
1136     if (code != nullptr) {
1137       return true;
1138     }
1139   } else if (mh->lookup_osr_nmethod_for(bci, comp_level, false) != nullptr) {
1140     return true;
1141   }
1142   tty->print("WB error: failed to %s compile at level %d method ", is_blocking ? "blocking" : "", comp_level);
1143   mh->print_short_name(tty);
1144   tty->cr();
1145   if (is_blocking && is_queued) {
1146     tty->print_cr("WB error: blocking compilation is still in queue!");
1147   }
< prev index next >