< prev index next >

src/hotspot/share/opto/idealKit.cpp

Print this page
@@ -46,11 +46,10 @@
    _delay_all_transforms = delay_all_transforms;
    _var_ct = 0;
    _cvstate = nullptr;
    // We can go memory state free or else we need the entire memory state
    assert(_initial_memory == nullptr || _initial_memory->Opcode() == Op_MergeMem, "memory must be pre-split");
-   assert(!_gvn.is_IterGVN(), "IdealKit can't be used during Optimize phase");
    int init_size = 5;
    _pending_cvstates = new (C->node_arena()) GrowableArray<Node*>(C->node_arena(), init_size, 0, 0);
    DEBUG_ONLY(_state = new (C->node_arena()) GrowableArray<int>(C->node_arena(), init_size, 0, 0));
    if (!has_declarations) {
       declarations_done();

@@ -78,14 +77,17 @@
        bol = Bool(CmpI(left, right), relop);
      } else {
        assert(left->bottom_type()->isa_long() != nullptr, "what else?");
        bol = Bool(CmpL(left, right), relop);
      }
- 
    } else {
      bol = Bool(CmpP(left, right), relop);
    }
+   if_then(bol, prob, cnt, push_new_state);
+ }
+ 
+ void IdealKit::if_then(Node* bol, float prob, float cnt, bool push_new_state) {
    // Delay gvn.transform on if-nodes until construction is finished
    // to prevent a constant bool input from discarding a control output.
    IfNode* iff = delay_transform(new IfNode(ctrl(), bol, prob, cnt))->as_If();
    Node* then  = IfTrue(iff);
    Node* elsen = IfFalse(iff);

@@ -294,20 +296,20 @@
  Node* IdealKit::transform(Node* n) {
    if (_delay_all_transforms) {
      return delay_transform(n);
    } else {
      n = gvn().transform(n);
-     C->record_for_igvn(n);
+     gvn().record_for_igvn(n);
      return n;
    }
  }
  
  //-----------------------------delay_transform-----------------------------------
  Node* IdealKit::delay_transform(Node* n) {
    // Delay transform until IterativeGVN
    gvn().set_type(n, n->bottom_type());
-   C->record_for_igvn(n);
+   gvn().record_for_igvn(n);
    return n;
  }
  
  //-----------------------------new_cvstate-----------------------------------
  Node* IdealKit::new_cvstate() {

@@ -523,12 +525,12 @@
    set_memory(mem, adr_idx);
  
    assert(C->alias_type(call->adr_type()) == C->alias_type(adr_type),
           "call node must be constructed correctly");
    Node* res = nullptr;
-   if (slow_call_type->range()->cnt() > TypeFunc::Parms) {
-     assert(slow_call_type->range()->cnt() == TypeFunc::Parms+1, "only one return value");
+   if (slow_call_type->range_sig()->cnt() > TypeFunc::Parms) {
+     assert(slow_call_type->range_sig()->cnt() == TypeFunc::Parms+1, "only one return value");
      res = transform(new ProjNode(call, TypeFunc::Parms));
    }
    return res;
  }
  
< prev index next >