Print this page
rev 2240 : [mq]: code-review-comments-tom

Split Close
Expand all
Collapse all
          --- old/src/share/vm/opto/compile.cpp
          +++ new/src/share/vm/opto/compile.cpp
↓ open down ↓ 621 lines elided ↑ open up ↑
 622  622    PhaseGVN gvn(node_arena(), estimated_size);
 623  623    set_initial_gvn(&gvn);
 624  624  
 625  625    { // Scope for timing the parser
 626  626      TracePhase t3("parse", &_t_parser, true);
 627  627  
 628  628      // Put top into the hash table ASAP.
 629  629      initial_gvn()->transform_no_reclaim(top());
 630  630  
 631  631      // Set up tf(), start(), and find a CallGenerator.
 632      -    CallGenerator* cg;
      632 +    CallGenerator* cg = NULL;
 633  633      if (is_osr_compilation()) {
 634  634        const TypeTuple *domain = StartOSRNode::osr_domain();
 635  635        const TypeTuple *range = TypeTuple::make_range(method()->signature());
 636  636        init_tf(TypeFunc::make(domain, range));
 637  637        StartNode* s = new (this, 2) StartOSRNode(root(), domain);
 638  638        initial_gvn()->set_type_bottom(s);
 639  639        init_start(s);
 640  640        cg = CallGenerator::for_osr(method(), entry_bci());
 641  641      } else {
 642  642        // Normal case.
 643  643        init_tf(TypeFunc::make(method()));
 644  644        StartNode* s = new (this, 2) StartNode(root(), tf()->domain());
 645  645        initial_gvn()->set_type_bottom(s);
 646  646        init_start(s);
 647      -      float past_uses = method()->interpreter_invocation_count();
 648      -      float expected_uses = past_uses;
 649      -      cg = CallGenerator::for_inline(method(), expected_uses);
      647 +      if (method()->intrinsic_id() == vmIntrinsics::_Reference_get && UseG1GC) {
      648 +        // With java.lang.ref.reference.get() we must go through the
      649 +        // intrinsic when G1 is enabled - even when get() is the root
      650 +        // method of the compile - so that, if necessary, the value in
      651 +        // the referent field of the reference object gets recorded by
      652 +        // the pre-barrier code.
      653 +        // Specifically, if G1 is enabled, the value in the referent
      654 +        // field is recorded by the G1 SATB pre barrier. This will
      655 +        // result in the referent being marked live and the reference
      656 +        // object removed from the list of discovered references during
      657 +        // reference processing.
      658 +        cg = find_intrinsic(method(), false);
      659 +      }
      660 +      if (cg == NULL) {
      661 +        float past_uses = method()->interpreter_invocation_count();
      662 +        float expected_uses = past_uses;
      663 +        cg = CallGenerator::for_inline(method(), expected_uses);
      664 +      }
 650  665      }
 651  666      if (failing())  return;
 652  667      if (cg == NULL) {
 653  668        record_method_not_compilable_all_tiers("cannot parse method");
 654  669        return;
 655  670      }
 656  671      JVMState* jvms = build_start_state(start(), tf());
 657  672      if ((jvms = cg->generate(jvms)) == NULL) {
 658  673        record_method_not_compilable("method parse failed");
 659  674        return;
↓ open down ↓ 2465 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX