src/share/vm/opto/escape.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6991188_new Sdiff src/share/vm/opto

src/share/vm/opto/escape.cpp

Print this page




  68   if (print_state) {
  69     EscapeState es = escape_state();
  70     tty->print("%s %s ", esc_names[(int) es], _scalar_replaceable ? "":"NSR");
  71   }
  72   tty->print("[[");
  73   for (uint i = 0; i < edge_count(); i++) {
  74     tty->print(" %d%s", edge_target(i), edge_type_suffix[(int) edge_type(i)]);
  75   }
  76   tty->print("]]  ");
  77   if (_node == NULL)
  78     tty->print_cr("<null>");
  79   else
  80     _node->dump();
  81 }
  82 #endif
  83 
  84 ConnectionGraph::ConnectionGraph(Compile * C, PhaseIterGVN *igvn) :
  85   _nodes(C->comp_arena(), C->unique(), C->unique(), PointsToNode()),
  86   _processed(C->comp_arena()),
  87   _collecting(true),

  88   _compile(C),
  89   _igvn(igvn),
  90   _node_map(C->comp_arena()) {
  91 
  92   _phantom_object = C->top()->_idx,
  93   add_node(C->top(), PointsToNode::JavaObject, PointsToNode::GlobalEscape,true);
  94 
  95   // Add ConP(#NULL) and ConN(#NULL) nodes.
  96   Node* oop_null = igvn->zerocon(T_OBJECT);
  97   _oop_null = oop_null->_idx;
  98   assert(_oop_null < C->unique(), "should be created already");
  99   add_node(oop_null, PointsToNode::JavaObject, PointsToNode::NoEscape, true);
 100 
 101   if (UseCompressedOops) {
 102     Node* noop_null = igvn->zerocon(T_NARROWOOP);
 103     _noop_null = noop_null->_idx;
 104     assert(_noop_null < C->unique(), "should be created already");
 105     add_node(noop_null, PointsToNode::JavaObject, PointsToNode::NoEscape, true);
 106   }
 107 }
 108 
 109 void ConnectionGraph::add_pointsto_edge(uint from_i, uint to_i) {
 110   PointsToNode *f = ptnode_adr(from_i);
 111   PointsToNode *t = ptnode_adr(to_i);
 112 
 113   assert(f->node_type() != PointsToNode::UnknownType && t->node_type() != PointsToNode::UnknownType, "node types must be set");
 114   assert(f->node_type() == PointsToNode::LocalVar || f->node_type() == PointsToNode::Field, "invalid source of PointsTo edge");
 115   assert(t->node_type() == PointsToNode::JavaObject, "invalid destination of PointsTo edge");
 116   f->add_edge(to_i, PointsToNode::PointsToEdge);
 117 }
 118 
 119 void ConnectionGraph::add_deferred_edge(uint from_i, uint to_i) {
 120   PointsToNode *f = ptnode_adr(from_i);
 121   PointsToNode *t = ptnode_adr(to_i);
 122 
 123   assert(f->node_type() != PointsToNode::UnknownType && t->node_type() != PointsToNode::UnknownType, "node types must be set");
 124   assert(f->node_type() == PointsToNode::LocalVar || f->node_type() == PointsToNode::Field, "invalid source of Deferred edge");
 125   assert(t->node_type() == PointsToNode::LocalVar || t->node_type() == PointsToNode::Field, "invalid destination of Deferred edge");
 126   // don't add a self-referential edge, this can occur during removal of
 127   // deferred edges
 128   if (from_i != to_i)
 129     f->add_edge(to_i, PointsToNode::DeferredEdge);
 130 }
 131 
 132 int ConnectionGraph::address_offset(Node* adr, PhaseTransform *phase) {
 133   const Type *adr_type = phase->type(adr);
 134   if (adr->is_AddP() && adr_type->isa_oopptr() == NULL &&
 135       adr->in(AddPNode::Address)->is_Proj() &&
 136       adr->in(AddPNode::Address)->in(0)->is_Allocate()) {
 137     // We are computing a raw address for a store captured by an Initialize
 138     // compute an appropriate address type. AddP cases #3 and #5 (see below).
 139     int offs = (int)phase->find_intptr_t_con(adr->in(AddPNode::Offset), Type::OffsetBot);
 140     assert(offs != Type::OffsetBot ||
 141            adr->in(AddPNode::Address)->in(0)->is_AllocateArray(),
 142            "offset must be a constant or it is initialization of array");
 143     return offs;
 144   }
 145   const TypePtr *t_ptr = adr_type->isa_ptr();
 146   assert(t_ptr != NULL, "must be a pointer type");
 147   return t_ptr->offset();
 148 }
 149 
 150 void ConnectionGraph::add_field_edge(uint from_i, uint to_i, int offset) {
 151   PointsToNode *f = ptnode_adr(from_i);
 152   PointsToNode *t = ptnode_adr(to_i);
 153 
 154   assert(f->node_type() != PointsToNode::UnknownType && t->node_type() != PointsToNode::UnknownType, "node types must be set");
 155   assert(f->node_type() == PointsToNode::JavaObject, "invalid destination of Field edge");
 156   assert(t->node_type() == PointsToNode::Field, "invalid destination of Field edge");
 157   assert (t->offset() == -1 || t->offset() == offset, "conflicting field offsets");
 158   t->set_offset(offset);
 159 
 160   f->add_edge(to_i, PointsToNode::FieldEdge);
 161 }
 162 
 163 void ConnectionGraph::set_escape_state(uint ni, PointsToNode::EscapeState es) {
 164   PointsToNode *npt = ptnode_adr(ni);
 165   PointsToNode::EscapeState old_es = npt->escape_state();
 166   if (es > old_es)
 167     npt->set_escape_state(es);
 168 }
 169 
 170 void ConnectionGraph::add_node(Node *n, PointsToNode::NodeType nt,
 171                                PointsToNode::EscapeState es, bool done) {
 172   PointsToNode* ptadr = ptnode_adr(n->_idx);
 173   ptadr->_node = n;
 174   ptadr->set_node_type(nt);
 175 
 176   // inline set_escape_state(idx, es);
 177   PointsToNode::EscapeState old_es = ptadr->escape_state();
 178   if (es > old_es)
 179     ptadr->set_escape_state(es);
 180 


 978 //     7 Parm #memory
 979 //    10  ConI  "12"
 980 //    19  CheckCastPP   "Foo"
 981 //    20  AddP  _ 19 19 10  Foo+12  alias_index=4
 982 //    29  CheckCastPP   "Foo"  iid=24
 983 //    30  AddP  _ 29 29 10  Foo+12  alias_index=6  iid=24
 984 //
 985 //    40  StoreP  25  7   20   ... alias_index=4
 986 //    50  StoreP  35  7   30   ... alias_index=6
 987 //    60  StoreP  45  40  20   ... alias_index=4
 988 //    70  LoadP    _  50  30   ... alias_index=6
 989 //    80  Phi     75  40  60   Memory alias_index=4
 990 //   120  Phi     75  50  50   Memory alias_index=6
 991 //    90  LoadP    _ 120  30   ... alias_index=6
 992 //   100  LoadP    _  80  20   ... alias_index=4
 993 //
 994 void ConnectionGraph::split_unique_types(GrowableArray<Node *>  &alloc_worklist) {
 995   GrowableArray<Node *>  memnode_worklist;
 996   GrowableArray<PhiNode *>  orig_phis;
 997 
 998   PhaseGVN  *igvn = _igvn;
 999   uint new_index_start = (uint) _compile->num_alias_types();
1000   Arena* arena = Thread::current()->resource_area();
1001   VectorSet visited(arena);
1002   VectorSet ptset(arena);
1003 
1004 
1005   //  Phase 1:  Process possible allocations from alloc_worklist.
1006   //  Create instance types for the CheckCastPP for allocations where possible.
1007   //
1008   // (Note: don't forget to change the order of the second AddP node on
1009   //  the alloc_worklist if the order of the worklist processing is changed,
1010   //  see the comment in find_second_addp().)
1011   //
1012   while (alloc_worklist.length() != 0) {
1013     Node *n = alloc_worklist.pop();
1014     uint ni = n->_idx;
1015     const TypeOopPtr* tinst = NULL;
1016     if (n->is_Call()) {
1017       CallNode *alloc = n->as_Call();
1018       // copy escape information to call node


1514   // Initialize worklist
1515   if (C->root() != NULL) {
1516     worklist_init.push(C->root());
1517   }
1518 
1519   GrowableArray<int> cg_worklist;
1520   PhaseGVN* igvn = _igvn;
1521   bool has_allocations = false;
1522 
1523   // Push all useful nodes onto CG list and set their type.
1524   for( uint next = 0; next < worklist_init.size(); ++next ) {
1525     Node* n = worklist_init.at(next);
1526     record_for_escape_analysis(n, igvn);
1527     // Only allocations and java static calls results are checked
1528     // for an escape status. See process_call_result() below.
1529     if (n->is_Allocate() || n->is_CallStaticJava() &&
1530         ptnode_adr(n->_idx)->node_type() == PointsToNode::JavaObject) {
1531       has_allocations = true;
1532     }
1533     if(n->is_AddP()) {
1534       // Collect address nodes which directly reference an allocation.
1535       // Use them during stage 3 below to build initial connection graph
1536       // field edges. Other field edges could be added after StoreP/LoadP
1537       // nodes are processed during stage 4 below.
1538       Node* base = get_addp_base(n);
1539       if(base->is_Proj() && base->in(0)->is_Allocate()) {
1540         cg_worklist.append(n->_idx);
1541       }
1542     } else if (n->is_MergeMem()) {
1543       // Collect all MergeMem nodes to add memory slices for
1544       // scalar replaceable objects in split_unique_types().
1545       _mergemem_worklist.append(n->as_MergeMem());
1546     }
1547     for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
1548       Node* m = n->fast_out(i);   // Get user
1549       worklist_init.push(m);
1550     }
1551   }
1552 
1553   if (!has_allocations) {
1554     _collecting = false;
1555     return false; // Nothing to do.
1556   }
1557 
1558   // 2. First pass to create simple CG edges (doesn't require to walk CG).
1559   uint delayed_size = _delayed_worklist.size();
1560   for( uint next = 0; next < delayed_size; ++next ) {
1561     Node* n = _delayed_worklist.at(next);
1562     build_connection_graph(n, igvn);
1563   }
1564 
1565   // 3. Pass to create fields edges (Allocate -F-> AddP).

1566   uint cg_length = cg_worklist.length();
1567   for( uint next = 0; next < cg_length; ++next ) {
1568     int ni = cg_worklist.at(next);
1569     build_connection_graph(ptnode_adr(ni)->_node, igvn);






1570   }

1571 
1572   cg_worklist.clear();
1573   cg_worklist.append(_phantom_object);
1574 
1575   // 4. Build Connection Graph which need
1576   //    to walk the connection graph.

1577   for (uint ni = 0; ni < nodes_size(); ni++) {
1578     PointsToNode* ptn = ptnode_adr(ni);
1579     Node *n = ptn->_node;
1580     if (n != NULL) { // Call, AddP, LoadP, StoreP
1581       build_connection_graph(n, igvn);
1582       if (ptn->node_type() != PointsToNode::UnknownType)
1583         cg_worklist.append(n->_idx); // Collect CG nodes
1584     }
1585   }


























1586 
1587   Arena* arena = Thread::current()->resource_area();
1588   VectorSet ptset(arena);
1589   GrowableArray<uint>  deferred_edges;
1590   VectorSet visited(arena);
1591 
1592   // 5. Remove deferred edges from the graph and adjust
1593   //    escape state of nonescaping objects.
1594   cg_length = cg_worklist.length();
1595   for( uint next = 0; next < cg_length; ++next ) {
1596     int ni = cg_worklist.at(next);
1597     PointsToNode* ptn = ptnode_adr(ni);
1598     PointsToNode::NodeType nt = ptn->node_type();
1599     if (nt == PointsToNode::LocalVar || nt == PointsToNode::Field) {
1600       remove_deferred(ni, &deferred_edges, &visited);
1601       Node *n = ptn->_node;
1602       if (n->is_AddP()) {
1603         // Search for objects which are not scalar replaceable
1604         // and adjust their escape state.
1605         verify_escape_state(ni, ptset, igvn);
1606       }
1607     }
1608   }
1609 
1610   // 6. Propagate escape states.
1611   GrowableArray<int>  worklist;
1612   bool has_non_escaping_obj = false;
1613 
1614   // push all GlobalEscape nodes on the worklist




  68   if (print_state) {
  69     EscapeState es = escape_state();
  70     tty->print("%s %s ", esc_names[(int) es], _scalar_replaceable ? "":"NSR");
  71   }
  72   tty->print("[[");
  73   for (uint i = 0; i < edge_count(); i++) {
  74     tty->print(" %d%s", edge_target(i), edge_type_suffix[(int) edge_type(i)]);
  75   }
  76   tty->print("]]  ");
  77   if (_node == NULL)
  78     tty->print_cr("<null>");
  79   else
  80     _node->dump();
  81 }
  82 #endif
  83 
  84 ConnectionGraph::ConnectionGraph(Compile * C, PhaseIterGVN *igvn) :
  85   _nodes(C->comp_arena(), C->unique(), C->unique(), PointsToNode()),
  86   _processed(C->comp_arena()),
  87   _collecting(true),
  88   _progress(false),
  89   _compile(C),
  90   _igvn(igvn),
  91   _node_map(C->comp_arena()) {
  92 
  93   _phantom_object = C->top()->_idx,
  94   add_node(C->top(), PointsToNode::JavaObject, PointsToNode::GlobalEscape,true);
  95 
  96   // Add ConP(#NULL) and ConN(#NULL) nodes.
  97   Node* oop_null = igvn->zerocon(T_OBJECT);
  98   _oop_null = oop_null->_idx;
  99   assert(_oop_null < C->unique(), "should be created already");
 100   add_node(oop_null, PointsToNode::JavaObject, PointsToNode::NoEscape, true);
 101 
 102   if (UseCompressedOops) {
 103     Node* noop_null = igvn->zerocon(T_NARROWOOP);
 104     _noop_null = noop_null->_idx;
 105     assert(_noop_null < C->unique(), "should be created already");
 106     add_node(noop_null, PointsToNode::JavaObject, PointsToNode::NoEscape, true);
 107   }
 108 }
 109 
 110 void ConnectionGraph::add_pointsto_edge(uint from_i, uint to_i) {
 111   PointsToNode *f = ptnode_adr(from_i);
 112   PointsToNode *t = ptnode_adr(to_i);
 113 
 114   assert(f->node_type() != PointsToNode::UnknownType && t->node_type() != PointsToNode::UnknownType, "node types must be set");
 115   assert(f->node_type() == PointsToNode::LocalVar || f->node_type() == PointsToNode::Field, "invalid source of PointsTo edge");
 116   assert(t->node_type() == PointsToNode::JavaObject, "invalid destination of PointsTo edge");
 117   add_edge(f, to_i, PointsToNode::PointsToEdge);
 118 }
 119 
 120 void ConnectionGraph::add_deferred_edge(uint from_i, uint to_i) {
 121   PointsToNode *f = ptnode_adr(from_i);
 122   PointsToNode *t = ptnode_adr(to_i);
 123 
 124   assert(f->node_type() != PointsToNode::UnknownType && t->node_type() != PointsToNode::UnknownType, "node types must be set");
 125   assert(f->node_type() == PointsToNode::LocalVar || f->node_type() == PointsToNode::Field, "invalid source of Deferred edge");
 126   assert(t->node_type() == PointsToNode::LocalVar || t->node_type() == PointsToNode::Field, "invalid destination of Deferred edge");
 127   // don't add a self-referential edge, this can occur during removal of
 128   // deferred edges
 129   if (from_i != to_i)
 130     add_edge(f, to_i, PointsToNode::DeferredEdge);
 131 }
 132 
 133 int ConnectionGraph::address_offset(Node* adr, PhaseTransform *phase) {
 134   const Type *adr_type = phase->type(adr);
 135   if (adr->is_AddP() && adr_type->isa_oopptr() == NULL &&
 136       adr->in(AddPNode::Address)->is_Proj() &&
 137       adr->in(AddPNode::Address)->in(0)->is_Allocate()) {
 138     // We are computing a raw address for a store captured by an Initialize
 139     // compute an appropriate address type. AddP cases #3 and #5 (see below).
 140     int offs = (int)phase->find_intptr_t_con(adr->in(AddPNode::Offset), Type::OffsetBot);
 141     assert(offs != Type::OffsetBot ||
 142            adr->in(AddPNode::Address)->in(0)->is_AllocateArray(),
 143            "offset must be a constant or it is initialization of array");
 144     return offs;
 145   }
 146   const TypePtr *t_ptr = adr_type->isa_ptr();
 147   assert(t_ptr != NULL, "must be a pointer type");
 148   return t_ptr->offset();
 149 }
 150 
 151 void ConnectionGraph::add_field_edge(uint from_i, uint to_i, int offset) {
 152   PointsToNode *f = ptnode_adr(from_i);
 153   PointsToNode *t = ptnode_adr(to_i);
 154 
 155   assert(f->node_type() != PointsToNode::UnknownType && t->node_type() != PointsToNode::UnknownType, "node types must be set");
 156   assert(f->node_type() == PointsToNode::JavaObject, "invalid destination of Field edge");
 157   assert(t->node_type() == PointsToNode::Field, "invalid destination of Field edge");
 158   assert (t->offset() == -1 || t->offset() == offset, "conflicting field offsets");
 159   t->set_offset(offset);
 160 
 161   add_edge(f, to_i, PointsToNode::FieldEdge);
 162 }
 163 
 164 void ConnectionGraph::set_escape_state(uint ni, PointsToNode::EscapeState es) {
 165   PointsToNode *npt = ptnode_adr(ni);
 166   PointsToNode::EscapeState old_es = npt->escape_state();
 167   if (es > old_es)
 168     npt->set_escape_state(es);
 169 }
 170 
 171 void ConnectionGraph::add_node(Node *n, PointsToNode::NodeType nt,
 172                                PointsToNode::EscapeState es, bool done) {
 173   PointsToNode* ptadr = ptnode_adr(n->_idx);
 174   ptadr->_node = n;
 175   ptadr->set_node_type(nt);
 176 
 177   // inline set_escape_state(idx, es);
 178   PointsToNode::EscapeState old_es = ptadr->escape_state();
 179   if (es > old_es)
 180     ptadr->set_escape_state(es);
 181 


 979 //     7 Parm #memory
 980 //    10  ConI  "12"
 981 //    19  CheckCastPP   "Foo"
 982 //    20  AddP  _ 19 19 10  Foo+12  alias_index=4
 983 //    29  CheckCastPP   "Foo"  iid=24
 984 //    30  AddP  _ 29 29 10  Foo+12  alias_index=6  iid=24
 985 //
 986 //    40  StoreP  25  7   20   ... alias_index=4
 987 //    50  StoreP  35  7   30   ... alias_index=6
 988 //    60  StoreP  45  40  20   ... alias_index=4
 989 //    70  LoadP    _  50  30   ... alias_index=6
 990 //    80  Phi     75  40  60   Memory alias_index=4
 991 //   120  Phi     75  50  50   Memory alias_index=6
 992 //    90  LoadP    _ 120  30   ... alias_index=6
 993 //   100  LoadP    _  80  20   ... alias_index=4
 994 //
 995 void ConnectionGraph::split_unique_types(GrowableArray<Node *>  &alloc_worklist) {
 996   GrowableArray<Node *>  memnode_worklist;
 997   GrowableArray<PhiNode *>  orig_phis;
 998 
 999   PhaseIterGVN  *igvn = _igvn;
1000   uint new_index_start = (uint) _compile->num_alias_types();
1001   Arena* arena = Thread::current()->resource_area();
1002   VectorSet visited(arena);
1003   VectorSet ptset(arena);
1004 
1005 
1006   //  Phase 1:  Process possible allocations from alloc_worklist.
1007   //  Create instance types for the CheckCastPP for allocations where possible.
1008   //
1009   // (Note: don't forget to change the order of the second AddP node on
1010   //  the alloc_worklist if the order of the worklist processing is changed,
1011   //  see the comment in find_second_addp().)
1012   //
1013   while (alloc_worklist.length() != 0) {
1014     Node *n = alloc_worklist.pop();
1015     uint ni = n->_idx;
1016     const TypeOopPtr* tinst = NULL;
1017     if (n->is_Call()) {
1018       CallNode *alloc = n->as_Call();
1019       // copy escape information to call node


1515   // Initialize worklist
1516   if (C->root() != NULL) {
1517     worklist_init.push(C->root());
1518   }
1519 
1520   GrowableArray<int> cg_worklist;
1521   PhaseGVN* igvn = _igvn;
1522   bool has_allocations = false;
1523 
1524   // Push all useful nodes onto CG list and set their type.
1525   for( uint next = 0; next < worklist_init.size(); ++next ) {
1526     Node* n = worklist_init.at(next);
1527     record_for_escape_analysis(n, igvn);
1528     // Only allocations and java static calls results are checked
1529     // for an escape status. See process_call_result() below.
1530     if (n->is_Allocate() || n->is_CallStaticJava() &&
1531         ptnode_adr(n->_idx)->node_type() == PointsToNode::JavaObject) {
1532       has_allocations = true;
1533     }
1534     if(n->is_AddP()) {
1535       // Collect address nodes. Use them during stage 3 below
1536       // to build initial connection graph field edges.




1537       cg_worklist.append(n->_idx);

1538     } else if (n->is_MergeMem()) {
1539       // Collect all MergeMem nodes to add memory slices for
1540       // scalar replaceable objects in split_unique_types().
1541       _mergemem_worklist.append(n->as_MergeMem());
1542     }
1543     for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
1544       Node* m = n->fast_out(i);   // Get user
1545       worklist_init.push(m);
1546     }
1547   }
1548 
1549   if (!has_allocations) {
1550     _collecting = false;
1551     return false; // Nothing to do.
1552   }
1553 
1554   // 2. First pass to create simple CG edges (doesn't require to walk CG).
1555   uint delayed_size = _delayed_worklist.size();
1556   for( uint next = 0; next < delayed_size; ++next ) {
1557     Node* n = _delayed_worklist.at(next);
1558     build_connection_graph(n, igvn);
1559   }
1560 
1561   // 3. Pass to create initial fields edges (JavaObject -F-> AddP)
1562   //    to reduce number of iterations during stage 4 below.
1563   uint cg_length = cg_worklist.length();
1564   for( uint next = 0; next < cg_length; ++next ) {
1565     int ni = cg_worklist.at(next);
1566     Node* n = ptnode_adr(ni)->_node;
1567     Node* base = get_addp_base(n);
1568     if (base->is_Proj())
1569       base = base->in(0);
1570     PointsToNode::NodeType nt = ptnode_adr(base->_idx)->node_type();
1571     if (nt == PointsToNode::JavaObject) {
1572       build_connection_graph(n, igvn);
1573     }
1574   }
1575 
1576   cg_worklist.clear();
1577   cg_worklist.append(_phantom_object);
1578 
1579   // 4. Build Connection Graph which need
1580   //    to walk the connection graph.
1581   _progress = false;
1582   for (uint ni = 0; ni < nodes_size(); ni++) {
1583     PointsToNode* ptn = ptnode_adr(ni);
1584     Node *n = ptn->_node;
1585     if (n != NULL) { // Call, AddP, LoadP, StoreP
1586       build_connection_graph(n, igvn);
1587       if (ptn->node_type() != PointsToNode::UnknownType)
1588         cg_worklist.append(n->_idx); // Collect CG nodes
1589     }
1590   }
1591   // After IGVN user nodes may have smaller _idx than
1592   // their inputs so they will be processed first in
1593   // previous loop. Because of that not all Graph
1594   // edges will be created. Walk over interesting
1595   // nodes again until no new edges are created.
1596   // Set limit on iterations.
1597   cg_length = cg_worklist.length();
1598   int iterations = 0;
1599   while(_progress && (iterations++ < 10)) {
1600     _progress = false;
1601     for( uint next = 0; next < cg_length; ++next ) {
1602       int ni = cg_worklist.at(next);
1603       PointsToNode* ptn = ptnode_adr(ni);
1604       DEBUG_ONLY(PointsToNode::NodeType nt = ptn->node_type());
1605       Node* n = ptn->_node;
1606       assert(n != NULL && nt != PointsToNode::UnknownType, "should be known node");
1607       build_connection_graph(n, igvn);
1608     }
1609   }
1610   if (iterations >= 10) {
1611     // Possible infinit build_connection_graph loop.
1612     // Retry compilation without escape analysis.
1613     C->record_failure(C2Compiler::retry_no_escape_analysis());
1614     _collecting = false;
1615     return false;
1616   }
1617 
1618   Arena* arena = Thread::current()->resource_area();
1619   VectorSet ptset(arena);
1620   GrowableArray<uint>  deferred_edges;
1621   VectorSet visited(arena);
1622 
1623   // 5. Remove deferred edges from the graph and adjust
1624   //    escape state of nonescaping objects.

1625   for( uint next = 0; next < cg_length; ++next ) {
1626     int ni = cg_worklist.at(next);
1627     PointsToNode* ptn = ptnode_adr(ni);
1628     PointsToNode::NodeType nt = ptn->node_type();
1629     if (nt == PointsToNode::LocalVar || nt == PointsToNode::Field) {
1630       remove_deferred(ni, &deferred_edges, &visited);
1631       Node *n = ptn->_node;
1632       if (n->is_AddP()) {
1633         // Search for objects which are not scalar replaceable
1634         // and adjust their escape state.
1635         verify_escape_state(ni, ptset, igvn);
1636       }
1637     }
1638   }
1639 
1640   // 6. Propagate escape states.
1641   GrowableArray<int>  worklist;
1642   bool has_non_escaping_obj = false;
1643 
1644   // push all GlobalEscape nodes on the worklist


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