src/share/vm/opto/doCall.cpp

Print this page

        

*** 59,69 **** } #endif CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, bool call_is_virtual, JVMState* jvms, bool allow_inline, ! float prof_factor) { ciMethod* caller = jvms->method(); int bci = jvms->bci(); Bytecodes::Code bytecode = caller->java_code_at_bci(bci); guarantee(call_method != NULL, "failed method resolution"); --- 59,69 ---- } #endif CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, bool call_is_virtual, JVMState* jvms, bool allow_inline, ! float prof_factor, bool allow_intrinsics) { ciMethod* caller = jvms->method(); int bci = jvms->bci(); Bytecodes::Code bytecode = caller->java_code_at_bci(bci); guarantee(call_method != NULL, "failed method resolution");
*** 106,116 **** // Special case the handling of certain common, profitable library // methods. If these methods are replaced with specialized code, // then we return it as the inlined version of the call. // We do this before the strict f.p. check below because the // intrinsics handle strict f.p. correctly. ! if (allow_inline) { CallGenerator* cg = find_intrinsic(call_method, call_is_virtual); if (cg != NULL) return cg; } // Do method handle calls. --- 106,116 ---- // Special case the handling of certain common, profitable library // methods. If these methods are replaced with specialized code, // then we return it as the inlined version of the call. // We do this before the strict f.p. check below because the // intrinsics handle strict f.p. correctly. ! if (allow_inline && allow_intrinsics) { CallGenerator* cg = find_intrinsic(call_method, call_is_virtual); if (cg != NULL) return cg; } // Do method handle calls.
*** 453,482 **** // it may contaminate the current compile state, making it // impossible to pull back and try again. Once we call // cg->generate(), we are committed. If it fails, the whole // compilation task is compromised. if (failing()) return; ! #ifndef PRODUCT ! if (PrintOpto || PrintOptoInlining || PrintInlining) { ! // Only one fall-back, so if an intrinsic fails, ignore any bytecodes. ! if (cg->is_intrinsic() && call_method->code_size() > 0) { ! tty->print("Bailed out of intrinsic, will not inline: "); ! call_method->print_name(); tty->cr(); ! } ! } ! #endif // This can happen if a library intrinsic is available, but refuses // the call site, perhaps because it did not match a pattern the ! // intrinsic was expecting to optimize. The fallback position is ! // to call out-of-line. ! try_inline = false; // Inline tactic bailed out. cg = C->call_generator(call_method, vtable_index, call_is_virtual, jvms, try_inline, prof_factor()); if ((new_jvms = cg->generate(jvms)) == NULL) { guarantee(failing(), "call failed to generate: calls should work"); return; } } if (cg->is_inline()) { // Accumulate has_loops estimate C->set_has_loops(C->has_loops() || call_method->has_loops()); C->env()->notice_inlined_method(call_method); --- 453,482 ---- // it may contaminate the current compile state, making it // impossible to pull back and try again. Once we call // cg->generate(), we are committed. If it fails, the whole // compilation task is compromised. if (failing()) return; ! // This can happen if a library intrinsic is available, but refuses // the call site, perhaps because it did not match a pattern the ! // intrinsic was expecting to optimize. Should always be possible to ! // get a normal java call that may inline in that case ! cg = C->call_generator(call_method, vtable_index, call_is_virtual, jvms, try_inline, prof_factor(), false); ! if ((new_jvms = cg->generate(jvms)) == NULL) { ! ! // Once again: If it fails, the whole compilation task is compromised. ! if (failing()) return; ! ! // last fallback, out-of-line ! try_inline = false; cg = C->call_generator(call_method, vtable_index, call_is_virtual, jvms, try_inline, prof_factor()); if ((new_jvms = cg->generate(jvms)) == NULL) { guarantee(failing(), "call failed to generate: calls should work"); return; } } + } if (cg->is_inline()) { // Accumulate has_loops estimate C->set_has_loops(C->has_loops() || call_method->has_loops()); C->env()->notice_inlined_method(call_method);