< prev index next >

src/hotspot/share/opto/escape.cpp

Print this page




 124   GrowableArray<JavaObjectNode*> non_escaped_worklist;
 125   GrowableArray<FieldNode*>      oop_fields_worklist;
 126   DEBUG_ONLY( GrowableArray<Node*> addp_worklist; )
 127 
 128   { Compile::TracePhase tp("connectionGraph", &Phase::timers[Phase::_t_connectionGraph]);
 129 
 130   // 1. Populate Connection Graph (CG) with PointsTo nodes.
 131   ideal_nodes.map(C->live_nodes(), NULL);  // preallocate space
 132   // Initialize worklist
 133   if (C->root() != NULL) {
 134     ideal_nodes.push(C->root());
 135   }
 136   // Processed ideal nodes are unique on ideal_nodes list
 137   // but several ideal nodes are mapped to the phantom_obj.
 138   // To avoid duplicated entries on the following worklists
 139   // add the phantom_obj only once to them.
 140   ptnodes_worklist.append(phantom_obj);
 141   java_objects_worklist.append(phantom_obj);
 142   for( uint next = 0; next < ideal_nodes.size(); ++next ) {
 143     Node* n = ideal_nodes.at(next);










 144     // Create PointsTo nodes and add them to Connection Graph. Called
 145     // only once per ideal node since ideal_nodes is Unique_Node list.
 146     add_node_to_connection_graph(n, &delayed_worklist);
 147     PointsToNode* ptn = ptnode_adr(n->_idx);
 148     if (ptn != NULL && ptn != phantom_obj) {
 149       ptnodes_worklist.append(ptn);
 150       if (ptn->is_JavaObject()) {
 151         java_objects_worklist.append(ptn->as_JavaObject());
 152         if ((n->is_Allocate() || n->is_CallStaticJava()) &&
 153             (ptn->escape_state() < PointsToNode::GlobalEscape)) {
 154           // Only allocations and java static calls results are interesting.
 155           non_escaped_worklist.append(ptn->as_JavaObject());
 156         }
 157       } else if (ptn->is_Field() && ptn->as_Field()->is_oop()) {
 158         oop_fields_worklist.append(ptn->as_Field());
 159       }
 160     }
 161     if (n->is_MergeMem()) {
 162       // Collect all MergeMem nodes to add memory slices for
 163       // scalar replaceable objects in split_unique_types().




 124   GrowableArray<JavaObjectNode*> non_escaped_worklist;
 125   GrowableArray<FieldNode*>      oop_fields_worklist;
 126   DEBUG_ONLY( GrowableArray<Node*> addp_worklist; )
 127 
 128   { Compile::TracePhase tp("connectionGraph", &Phase::timers[Phase::_t_connectionGraph]);
 129 
 130   // 1. Populate Connection Graph (CG) with PointsTo nodes.
 131   ideal_nodes.map(C->live_nodes(), NULL);  // preallocate space
 132   // Initialize worklist
 133   if (C->root() != NULL) {
 134     ideal_nodes.push(C->root());
 135   }
 136   // Processed ideal nodes are unique on ideal_nodes list
 137   // but several ideal nodes are mapped to the phantom_obj.
 138   // To avoid duplicated entries on the following worklists
 139   // add the phantom_obj only once to them.
 140   ptnodes_worklist.append(phantom_obj);
 141   java_objects_worklist.append(phantom_obj);
 142   for( uint next = 0; next < ideal_nodes.size(); ++next ) {
 143     Node* n = ideal_nodes.at(next);
 144     if ((n->Opcode() == Op_LoadX || n->Opcode() == Op_StoreX) &&
 145         !n->in(MemNode::Address)->is_AddP() &&
 146         _igvn->type(n->in(MemNode::Address))->isa_oopptr()) {
 147       // Load/Store at mark work address is at offset 0 so has no AddP which confuses EA
 148       Node* addp = new AddPNode(n->in(MemNode::Address), n->in(MemNode::Address), _igvn->MakeConX(0));
 149       _igvn->register_new_node_with_optimizer(addp);
 150       _igvn->replace_input_of(n, MemNode::Address, addp);
 151       ideal_nodes.push(addp);
 152       _nodes.at_put_grow(addp->_idx, NULL, NULL);
 153     }
 154     // Create PointsTo nodes and add them to Connection Graph. Called
 155     // only once per ideal node since ideal_nodes is Unique_Node list.
 156     add_node_to_connection_graph(n, &delayed_worklist);
 157     PointsToNode* ptn = ptnode_adr(n->_idx);
 158     if (ptn != NULL && ptn != phantom_obj) {
 159       ptnodes_worklist.append(ptn);
 160       if (ptn->is_JavaObject()) {
 161         java_objects_worklist.append(ptn->as_JavaObject());
 162         if ((n->is_Allocate() || n->is_CallStaticJava()) &&
 163             (ptn->escape_state() < PointsToNode::GlobalEscape)) {
 164           // Only allocations and java static calls results are interesting.
 165           non_escaped_worklist.append(ptn->as_JavaObject());
 166         }
 167       } else if (ptn->is_Field() && ptn->as_Field()->is_oop()) {
 168         oop_fields_worklist.append(ptn->as_Field());
 169       }
 170     }
 171     if (n->is_MergeMem()) {
 172       // Collect all MergeMem nodes to add memory slices for
 173       // scalar replaceable objects in split_unique_types().


< prev index next >