src/share/vm/opto/cfgnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8136457 Sdiff src/share/vm/opto

src/share/vm/opto/cfgnode.cpp

Print this page
rev 7539 : 8011858: Use Compile::live_nodes() instead of Compile::unique() in appropriate places
Reviewed-by: kvn, vlivanov
Contributed-by: vlad.ureche@gmail.com


 774           t->isa_oopptr() && !t->is_oopptr()->is_known_instance() &&
 775           t->is_oopptr()->cast_to_exactness(true)
 776            ->is_oopptr()->cast_to_ptr_type(t_oop->ptr())
 777            ->is_oopptr()->cast_to_instance_id(t_oop->instance_id()) == t_oop),
 778          "bottom or raw memory required");
 779 
 780   // Check if an appropriate node already exists.
 781   Node *region = in(0);
 782   for (DUIterator_Fast kmax, k = region->fast_outs(kmax); k < kmax; k++) {
 783     Node* use = region->fast_out(k);
 784     if( use->is_Phi()) {
 785       PhiNode *phi2 = use->as_Phi();
 786       if (phi2->type() == Type::MEMORY && phi2->adr_type() == at) {
 787         return phi2;
 788       }
 789     }
 790   }
 791   Compile *C = igvn->C;
 792   Arena *a = Thread::current()->resource_area();
 793   Node_Array node_map = new Node_Array(a);
 794   Node_Stack stack(a, C->unique() >> 4);
 795   PhiNode *nphi = slice_memory(at);
 796   igvn->register_new_node_with_optimizer( nphi );
 797   node_map.map(_idx, nphi);
 798   stack.push((Node *)this, 1);
 799   while(!stack.is_empty()) {
 800     PhiNode *ophi = stack.node()->as_Phi();
 801     uint i = stack.index();
 802     assert(i >= 1, "not control edge");
 803     stack.pop();
 804     nphi = node_map[ophi->_idx]->as_Phi();
 805     for (; i < ophi->req(); i++) {
 806       Node *in = ophi->in(i);
 807       if (in == NULL || igvn->type(in) == Type::TOP)
 808         continue;
 809       Node *opt = MemNode::optimize_simple_memory_chain(in, t_oop, NULL, igvn);
 810       PhiNode *optphi = opt->is_Phi() ? opt->as_Phi() : NULL;
 811       if (optphi != NULL && optphi->adr_type() == TypePtr::BOTTOM) {
 812         opt = node_map[optphi->_idx];
 813         if (opt == NULL) {
 814           stack.push(ophi, i);




 774           t->isa_oopptr() && !t->is_oopptr()->is_known_instance() &&
 775           t->is_oopptr()->cast_to_exactness(true)
 776            ->is_oopptr()->cast_to_ptr_type(t_oop->ptr())
 777            ->is_oopptr()->cast_to_instance_id(t_oop->instance_id()) == t_oop),
 778          "bottom or raw memory required");
 779 
 780   // Check if an appropriate node already exists.
 781   Node *region = in(0);
 782   for (DUIterator_Fast kmax, k = region->fast_outs(kmax); k < kmax; k++) {
 783     Node* use = region->fast_out(k);
 784     if( use->is_Phi()) {
 785       PhiNode *phi2 = use->as_Phi();
 786       if (phi2->type() == Type::MEMORY && phi2->adr_type() == at) {
 787         return phi2;
 788       }
 789     }
 790   }
 791   Compile *C = igvn->C;
 792   Arena *a = Thread::current()->resource_area();
 793   Node_Array node_map = new Node_Array(a);
 794   Node_Stack stack(a, C->live_nodes() >> 4);
 795   PhiNode *nphi = slice_memory(at);
 796   igvn->register_new_node_with_optimizer( nphi );
 797   node_map.map(_idx, nphi);
 798   stack.push((Node *)this, 1);
 799   while(!stack.is_empty()) {
 800     PhiNode *ophi = stack.node()->as_Phi();
 801     uint i = stack.index();
 802     assert(i >= 1, "not control edge");
 803     stack.pop();
 804     nphi = node_map[ophi->_idx]->as_Phi();
 805     for (; i < ophi->req(); i++) {
 806       Node *in = ophi->in(i);
 807       if (in == NULL || igvn->type(in) == Type::TOP)
 808         continue;
 809       Node *opt = MemNode::optimize_simple_memory_chain(in, t_oop, NULL, igvn);
 810       PhiNode *optphi = opt->is_Phi() ? opt->as_Phi() : NULL;
 811       if (optphi != NULL && optphi->adr_type() == TypePtr::BOTTOM) {
 812         opt = node_map[optphi->_idx];
 813         if (opt == NULL) {
 814           stack.push(ophi, i);


src/share/vm/opto/cfgnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File