src/share/vm/opto/doCall.cpp

changeset 5798
29bdcf12457c
parent 5763
1b64d46620a3
child 5981
3213ba4d3dff
     1.1 --- a/src/share/vm/opto/doCall.cpp	Sat Sep 28 12:42:22 2013 -0700
     1.2 +++ b/src/share/vm/opto/doCall.cpp	Fri Sep 27 11:52:24 2013 +0400
     1.3 @@ -110,6 +110,7 @@
     1.4    // then we return it as the inlined version of the call.
     1.5    // We do this before the strict f.p. check below because the
     1.6    // intrinsics handle strict f.p. correctly.
     1.7 +  CallGenerator* cg_intrinsic = NULL;
     1.8    if (allow_inline && allow_intrinsics) {
     1.9      CallGenerator* cg = find_intrinsic(callee, call_does_dispatch);
    1.10      if (cg != NULL) {
    1.11 @@ -121,7 +122,16 @@
    1.12            cg = CallGenerator::for_predicted_intrinsic(cg, inline_cg);
    1.13          }
    1.14        }
    1.15 -      return cg;
    1.16 +
    1.17 +      // If intrinsic does the virtual dispatch, we try to use the type profile
    1.18 +      // first, and hopefully inline it as the regular virtual call below.
    1.19 +      // We will retry the intrinsic if nothing had claimed it afterwards.
    1.20 +      if (cg->does_virtual_dispatch()) {
    1.21 +        cg_intrinsic = cg;
    1.22 +        cg = NULL;
    1.23 +      } else {
    1.24 +        return cg;
    1.25 +      }
    1.26      }
    1.27    }
    1.28  
    1.29 @@ -266,6 +276,13 @@
    1.30      }
    1.31    }
    1.32  
    1.33 +  // Nothing claimed the intrinsic, we go with straight-forward inlining
    1.34 +  // for already discovered intrinsic.
    1.35 +  if (allow_inline && allow_intrinsics && cg_intrinsic != NULL) {
    1.36 +    assert(cg_intrinsic->does_virtual_dispatch(), "sanity");
    1.37 +    return cg_intrinsic;
    1.38 +  }
    1.39 +
    1.40    // There was no special inlining tactic, or it bailed out.
    1.41    // Use a more generic tactic, like a simple call.
    1.42    if (call_does_dispatch) {

mercurial