src/share/vm/c1/c1_GraphBuilder.cpp

changeset 4154
c3e799c37717
parent 4106
7eca5de9e0b6
child 4203
fd1d564dd460
     1.1 --- a/src/share/vm/c1/c1_GraphBuilder.cpp	Fri Oct 05 13:37:08 2012 -0700
     1.2 +++ b/src/share/vm/c1/c1_GraphBuilder.cpp	Fri Oct 05 18:57:10 2012 -0700
     1.3 @@ -1682,6 +1682,12 @@
     1.4    ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder);
     1.5    ciInstanceKlass* actual_recv = callee_holder;
     1.6  
     1.7 +  CompileLog* log = compilation()->log();
     1.8 +  if (log != NULL)
     1.9 +      log->elem("call method='%d' instr='%s'",
    1.10 +                log->identify(target),
    1.11 +                Bytecodes::name(code));
    1.12 +
    1.13    // Some methods are obviously bindable without any type checks so
    1.14    // convert them directly to an invokespecial or invokestatic.
    1.15    if (target->is_loaded() && !target->is_abstract() && target->can_be_statically_bound()) {
    1.16 @@ -1826,6 +1832,7 @@
    1.17      }
    1.18      code = Bytecodes::_invokespecial;
    1.19    }
    1.20 +
    1.21    // check if we could do inlining
    1.22    if (!PatchALot && Inline && klass->is_loaded() &&
    1.23        (klass->is_initialized() || klass->is_interface() && target->holder()->is_initialized())
    1.24 @@ -2448,6 +2455,7 @@
    1.25  #endif
    1.26    _skip_block = false;
    1.27    assert(state() != NULL, "ValueStack missing!");
    1.28 +  CompileLog* log = compilation()->log();
    1.29    ciBytecodeStream s(method());
    1.30    s.reset_to_bci(bci);
    1.31    int prev_bci = bci;
    1.32 @@ -2466,6 +2474,9 @@
    1.33           (block_at(s.cur_bci()) == NULL || block_at(s.cur_bci()) == block())) {
    1.34      assert(state()->kind() == ValueStack::Parsing, "invalid state kind");
    1.35  
    1.36 +    if (log != NULL)
    1.37 +      log->set_context("bc code='%d' bci='%d'", (int)code, s.cur_bci());
    1.38 +
    1.39      // Check for active jsr during OSR compilation
    1.40      if (compilation()->is_osr_compile()
    1.41          && scope()->is_top_scope()
    1.42 @@ -2686,8 +2697,13 @@
    1.43        case Bytecodes::_breakpoint     : BAILOUT_("concurrent setting of breakpoint", NULL);
    1.44        default                         : ShouldNotReachHere(); break;
    1.45      }
    1.46 +
    1.47 +    if (log != NULL)
    1.48 +      log->clear_context(); // skip marker if nothing was printed
    1.49 +
    1.50      // save current bci to setup Goto at the end
    1.51      prev_bci = s.cur_bci();
    1.52 +
    1.53    }
    1.54    CHECK_BAILOUT_(NULL);
    1.55    // stop processing of this block (see try_inline_full)
    1.56 @@ -3667,7 +3683,7 @@
    1.57        INLINE_BAILOUT("total inlining greater than DesiredMethodLimit");
    1.58      }
    1.59      // printing
    1.60 -    print_inlining(callee, "");
    1.61 +    print_inlining(callee);
    1.62    }
    1.63  
    1.64    // NOTE: Bailouts from this point on, which occur at the
    1.65 @@ -4133,8 +4149,19 @@
    1.66  
    1.67  
    1.68  void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool success) {
    1.69 +  CompileLog* log = compilation()->log();
    1.70 +  if (log != NULL) {
    1.71 +    if (success) {
    1.72 +      if (msg != NULL)
    1.73 +        log->inline_success(msg);
    1.74 +      else
    1.75 +        log->inline_success("receiver is statically known");
    1.76 +    } else {
    1.77 +      log->inline_fail(msg);
    1.78 +    }
    1.79 +  }
    1.80 +
    1.81    if (!PrintInlining)  return;
    1.82 -  assert(msg != NULL, "must be");
    1.83    CompileTask::print_inlining(callee, scope()->level(), bci(), msg);
    1.84    if (success && CIPrintMethodCodes) {
    1.85      callee->print_codes();

mercurial