src/share/vm/opto/doCall.cpp

changeset 4409
d092d1b31229
parent 4357
ad5dd04754ee
child 4414
5698813d45eb
     1.1 --- a/src/share/vm/opto/doCall.cpp	Fri Dec 21 10:27:49 2012 -0800
     1.2 +++ b/src/share/vm/opto/doCall.cpp	Sun Dec 23 17:08:22 2012 +0100
     1.3 @@ -63,7 +63,7 @@
     1.4  
     1.5  CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool call_is_virtual,
     1.6                                         JVMState* jvms, bool allow_inline,
     1.7 -                                       float prof_factor, bool allow_intrinsics) {
     1.8 +                                       float prof_factor, bool allow_intrinsics, bool delayed_forbidden) {
     1.9    ciMethod*       caller   = jvms->method();
    1.10    int             bci      = jvms->bci();
    1.11    Bytecodes::Code bytecode = caller->java_code_at_bci(bci);
    1.12 @@ -130,7 +130,9 @@
    1.13    // MethodHandle.invoke* are native methods which obviously don't
    1.14    // have bytecodes and so normal inlining fails.
    1.15    if (callee->is_method_handle_intrinsic()) {
    1.16 -    return CallGenerator::for_method_handle_call(jvms, caller, callee);
    1.17 +    CallGenerator* cg = CallGenerator::for_method_handle_call(jvms, caller, callee, delayed_forbidden);
    1.18 +    assert (cg == NULL || !delayed_forbidden || !cg->is_late_inline() || cg->is_mh_late_inline(), "unexpected CallGenerator");
    1.19 +    return cg;
    1.20    }
    1.21  
    1.22    // Do not inline strict fp into non-strict code, or the reverse
    1.23 @@ -161,20 +163,27 @@
    1.24        WarmCallInfo scratch_ci;
    1.25        if (!UseOldInlining)
    1.26          scratch_ci.init(jvms, callee, profile, prof_factor);
    1.27 -      WarmCallInfo* ci = ilt->ok_to_inline(callee, jvms, profile, &scratch_ci);
    1.28 +      bool should_delay = false;
    1.29 +      WarmCallInfo* ci = ilt->ok_to_inline(callee, jvms, profile, &scratch_ci, should_delay);
    1.30        assert(ci != &scratch_ci, "do not let this pointer escape");
    1.31        bool allow_inline   = (ci != NULL && !ci->is_cold());
    1.32        bool require_inline = (allow_inline && ci->is_hot());
    1.33  
    1.34        if (allow_inline) {
    1.35          CallGenerator* cg = CallGenerator::for_inline(callee, expected_uses);
    1.36 -        if (require_inline && cg != NULL && should_delay_inlining(callee, jvms)) {
    1.37 +
    1.38 +        if (require_inline && cg != NULL) {
    1.39            // Delay the inlining of this method to give us the
    1.40            // opportunity to perform some high level optimizations
    1.41            // first.
    1.42 -          return CallGenerator::for_late_inline(callee, cg);
    1.43 +          if (should_delay_inlining(callee, jvms)) {
    1.44 +            assert(!delayed_forbidden, "strange");
    1.45 +            return CallGenerator::for_string_late_inline(callee, cg);
    1.46 +          } else if ((should_delay || AlwaysIncrementalInline) && !delayed_forbidden) {
    1.47 +            return CallGenerator::for_late_inline(callee, cg);
    1.48 +          }
    1.49          }
    1.50 -        if (cg == NULL) {
    1.51 +        if (cg == NULL || should_delay) {
    1.52            // Fall through.
    1.53          } else if (require_inline || !InlineWarmCalls) {
    1.54            return cg;

mercurial