Mercurial > hg > graal-compiler
diff src/share/vm/opto/doCall.cpp @ 12816:2720ab7a0d70
Merge
author | ccheung |
---|---|
date | Fri, 04 Oct 2013 21:00:43 -0700 |
parents | 29bdcf12457c |
children | 3213ba4d3dff |
line wrap: on
line diff
--- a/src/share/vm/opto/doCall.cpp Sat Oct 05 03:14:53 2013 +0200 +++ b/src/share/vm/opto/doCall.cpp Fri Oct 04 21:00:43 2013 -0700 @@ -110,6 +110,7 @@ // 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. + CallGenerator* cg_intrinsic = NULL; if (allow_inline && allow_intrinsics) { CallGenerator* cg = find_intrinsic(callee, call_does_dispatch); if (cg != NULL) { @@ -121,7 +122,16 @@ cg = CallGenerator::for_predicted_intrinsic(cg, inline_cg); } } - return cg; + + // If intrinsic does the virtual dispatch, we try to use the type profile + // first, and hopefully inline it as the regular virtual call below. + // We will retry the intrinsic if nothing had claimed it afterwards. + if (cg->does_virtual_dispatch()) { + cg_intrinsic = cg; + cg = NULL; + } else { + return cg; + } } } @@ -266,6 +276,13 @@ } } + // Nothing claimed the intrinsic, we go with straight-forward inlining + // for already discovered intrinsic. + if (allow_inline && allow_intrinsics && cg_intrinsic != NULL) { + assert(cg_intrinsic->does_virtual_dispatch(), "sanity"); + return cg_intrinsic; + } + // There was no special inlining tactic, or it bailed out. // Use a more generic tactic, like a simple call. if (call_does_dispatch) {