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

src/share/vm/opto/escape.cpp

Print this page

        

*** 106,123 **** add_node(C->top(), PointsToNode::JavaObject, PointsToNode::GlobalEscape,true); // Add ConP(#NULL) and ConN(#NULL) nodes. Node* oop_null = igvn->zerocon(T_OBJECT); _oop_null = oop_null->_idx; ! assert(_oop_null < C->unique(), "should be created already"); add_node(oop_null, PointsToNode::JavaObject, PointsToNode::NoEscape, true); if (UseCompressedOops) { Node* noop_null = igvn->zerocon(T_NARROWOOP); _noop_null = noop_null->_idx; ! assert(_noop_null < C->unique(), "should be created already"); add_node(noop_null, PointsToNode::JavaObject, PointsToNode::NoEscape, true); } } void ConnectionGraph::add_pointsto_edge(uint from_i, uint to_i) { PointsToNode *f = ptnode_adr(from_i); --- 106,125 ---- add_node(C->top(), PointsToNode::JavaObject, PointsToNode::GlobalEscape,true); // Add ConP(#NULL) and ConN(#NULL) nodes. Node* oop_null = igvn->zerocon(T_OBJECT); _oop_null = oop_null->_idx; ! assert(_oop_null < nodes_size(), "should be created already"); add_node(oop_null, PointsToNode::JavaObject, PointsToNode::NoEscape, true); if (UseCompressedOops) { Node* noop_null = igvn->zerocon(T_NARROWOOP); _noop_null = noop_null->_idx; ! assert(_noop_null < nodes_size(), "should be created already"); add_node(noop_null, PointsToNode::JavaObject, PointsToNode::NoEscape, true); + } else { + _noop_null = _oop_null; // Should be initialized } } void ConnectionGraph::add_pointsto_edge(uint from_i, uint to_i) { PointsToNode *f = ptnode_adr(from_i);
*** 172,181 **** --- 174,186 ---- add_edge(f, to_i, PointsToNode::FieldEdge); } void ConnectionGraph::set_escape_state(uint ni, PointsToNode::EscapeState es) { + // Don't change non-escaping state of NULL pointer. + if (ni == _noop_null || ni == _oop_null) + return; PointsToNode *npt = ptnode_adr(ni); PointsToNode::EscapeState old_es = npt->escape_state(); if (es > old_es) npt->set_escape_state(es); }
*** 229,240 **** if (pes > es) es = pes; } if (orig_es != es) { // cache the computed escape state ! assert(es != PointsToNode::UnknownEscape, "should have computed an escape state"); ! ptnode_adr(idx)->set_escape_state(es); } // orig_es could be PointsToNode::UnknownEscape return es; } VectorSet* ConnectionGraph::PointsTo(Node * n) { --- 234,245 ---- if (pes > es) es = pes; } if (orig_es != es) { // cache the computed escape state ! assert(es > orig_es, "should have computed an escape state"); ! set_escape_state(idx, es); } // orig_es could be PointsToNode::UnknownEscape return es; } VectorSet* ConnectionGraph::PointsTo(Node * n) {
*** 332,342 **** PointsToNode::EdgeType et = ptt->edge_type(e); if (et == PointsToNode::PointsToEdge) { add_pointsto_edge(ni, etgt); if(etgt == _phantom_object) { // Special case - field set outside (globally escaping). ! ptn->set_escape_state(PointsToNode::GlobalEscape); } } else if (et == PointsToNode::DeferredEdge) { deferred_edges->append(etgt); } else { assert(false,"invalid connection graph"); --- 337,347 ---- PointsToNode::EdgeType et = ptt->edge_type(e); if (et == PointsToNode::PointsToEdge) { add_pointsto_edge(ni, etgt); if(etgt == _phantom_object) { // Special case - field set outside (globally escaping). ! set_escape_state(ni, PointsToNode::GlobalEscape); } } else if (et == PointsToNode::DeferredEdge) { deferred_edges->append(etgt); } else { assert(false,"invalid connection graph");
*** 1684,1694 **** uint e_cnt = ptn->edge_count(); for (uint ei = 0; ei < e_cnt; ei++) { uint npi = ptn->edge_target(ei); PointsToNode *np = ptnode_adr(npi); if (np->escape_state() < PointsToNode::GlobalEscape) { ! np->set_escape_state(PointsToNode::GlobalEscape); worklist.push(npi); } } } --- 1689,1699 ---- uint e_cnt = ptn->edge_count(); for (uint ei = 0; ei < e_cnt; ei++) { uint npi = ptn->edge_target(ei); PointsToNode *np = ptnode_adr(npi); if (np->escape_state() < PointsToNode::GlobalEscape) { ! set_escape_state(npi, PointsToNode::GlobalEscape); worklist.push(npi); } } }
*** 1706,1716 **** uint e_cnt = ptn->edge_count(); for (uint ei = 0; ei < e_cnt; ei++) { uint npi = ptn->edge_target(ei); PointsToNode *np = ptnode_adr(npi); if (np->escape_state() < PointsToNode::ArgEscape) { ! np->set_escape_state(PointsToNode::ArgEscape); worklist.push(npi); } } } --- 1711,1721 ---- uint e_cnt = ptn->edge_count(); for (uint ei = 0; ei < e_cnt; ei++) { uint npi = ptn->edge_target(ei); PointsToNode *np = ptnode_adr(npi); if (np->escape_state() < PointsToNode::ArgEscape) { ! set_escape_state(npi, PointsToNode::ArgEscape); worklist.push(npi); } } }
*** 1722,1734 **** if (ptnode_adr(nk)->escape_state() == PointsToNode::NoEscape) worklist.push(nk); } // mark all nodes reachable from NoEscape nodes while(worklist.length() > 0) { ! PointsToNode* ptn = ptnode_adr(worklist.pop()); ! if (ptn->node_type() == PointsToNode::JavaObject) ! has_non_escaping_obj = true; // Non GlobalEscape Node* n = ptn->_node; if (n->is_Allocate() && ptn->_scalar_replaceable ) { // Push scalar replaceable allocations on alloc_worklist // for processing in split_unique_types(). alloc_worklist.append(n); --- 1727,1741 ---- if (ptnode_adr(nk)->escape_state() == PointsToNode::NoEscape) worklist.push(nk); } // mark all nodes reachable from NoEscape nodes while(worklist.length() > 0) { ! uint nk = worklist.pop(); ! PointsToNode* ptn = ptnode_adr(nk); ! if (ptn->node_type() == PointsToNode::JavaObject && ! !(nk == _noop_null || nk == _oop_null)) ! has_non_escaping_obj = true; // Non Escape Node* n = ptn->_node; if (n->is_Allocate() && ptn->_scalar_replaceable ) { // Push scalar replaceable allocations on alloc_worklist // for processing in split_unique_types(). alloc_worklist.append(n);
*** 1736,1754 **** uint e_cnt = ptn->edge_count(); for (uint ei = 0; ei < e_cnt; ei++) { uint npi = ptn->edge_target(ei); PointsToNode *np = ptnode_adr(npi); if (np->escape_state() < PointsToNode::NoEscape) { ! np->set_escape_state(PointsToNode::NoEscape); worklist.push(npi); } } } _collecting = false; assert(C->unique() == nodes_size(), "there should be no new ideal nodes during ConnectionGraph build"); if (EliminateLocks) { // Mark locks before changing ideal graph. int cnt = C->macro_count(); for( int i=0; i < cnt; i++ ) { Node *n = C->macro_node(i); --- 1743,1766 ---- uint e_cnt = ptn->edge_count(); for (uint ei = 0; ei < e_cnt; ei++) { uint npi = ptn->edge_target(ei); PointsToNode *np = ptnode_adr(npi); if (np->escape_state() < PointsToNode::NoEscape) { ! set_escape_state(npi, PointsToNode::NoEscape); worklist.push(npi); } } } _collecting = false; assert(C->unique() == nodes_size(), "there should be no new ideal nodes during ConnectionGraph build"); + assert(ptnode_adr(_oop_null)->escape_state() == PointsToNode::NoEscape, "sanity"); + if (UseCompressedOops) { + assert(ptnode_adr(_noop_null)->escape_state() == PointsToNode::NoEscape, "sanity"); + } + if (EliminateLocks) { // Mark locks before changing ideal graph. int cnt = C->macro_count(); for( int i=0; i < cnt; i++ ) { Node *n = C->macro_node(i);
src/share/vm/opto/escape.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File