src/share/vm/opto/phaseX.cpp

changeset 8945
3b6372514697
parent 8940
eb9e617d6f64
child 9013
18366fa39fe0
     1.1 --- a/src/share/vm/opto/phaseX.cpp	Fri Oct 21 20:34:04 2016 +0300
     1.2 +++ b/src/share/vm/opto/phaseX.cpp	Fri Oct 28 22:36:23 2016 +0000
     1.3 @@ -481,6 +481,8 @@
     1.4    uint current_idx = 0; // The current new node ID. Incremented after every assignment.
     1.5    for (uint i = 0; i < _useful.size(); i++) {
     1.6      Node* n = _useful.at(i);
     1.7 +    // Sanity check that fails if we ever decide to execute this phase after EA
     1.8 +    assert(!n->is_Phi() || n->as_Phi()->inst_mem_id() == -1, "should not be linked to data Phi");
     1.9      const Type* type = gvn->type_or_null(n);
    1.10      new_type_array.map(current_idx, type);
    1.11  
    1.12 @@ -1378,6 +1380,18 @@
    1.13      i -= num_edges;    // we deleted 1 or more copies of this edge
    1.14    }
    1.15  
    1.16 +  // Search for instance field data PhiNodes in the same region pointing to the old
    1.17 +  // memory PhiNode and update their instance memory ids to point to the new node.
    1.18 +  if (old->is_Phi() && old->as_Phi()->type()->has_memory() && old->in(0) != NULL) {
    1.19 +    Node* region = old->in(0);
    1.20 +    for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) {
    1.21 +      PhiNode* phi = region->fast_out(i)->isa_Phi();
    1.22 +      if (phi != NULL && phi->inst_mem_id() == (int)old->_idx) {
    1.23 +        phi->set_inst_mem_id((int)nn->_idx);
    1.24 +      }
    1.25 +    }
    1.26 +  }
    1.27 +
    1.28    // Smash all inputs to 'old', isolating him completely
    1.29    Node *temp = new (C) Node(1);
    1.30    temp->init_req(0,nn);     // Add a use to nn to prevent him from dying

mercurial