1740 // (nophi means we must not create phis, because we already parsed here)
1741 assert(n != NULL, "");
1742 // Merge the inputs to the MergeMems
1743 MergeMemNode* m = merged_memory();
1744
1745 assert(control()->is_Region(), "must be merging to a region");
1746 RegionNode* r = control()->as_Region();
1747
1748 PhiNode* base = NULL;
1749 MergeMemNode* remerge = NULL;
1750 for (MergeMemStream mms(m, n); mms.next_non_empty2(); ) {
1751 Node *p = mms.force_memory();
1752 Node *q = mms.memory2();
1753 if (mms.is_empty() && nophi) {
1754 // Trouble: No new splits allowed after a loop body is parsed.
1755 // Instead, wire the new split into a MergeMem on the backedge.
1756 // The optimizer will sort it out, slicing the phi.
1757 if (remerge == NULL) {
1758 assert(base != NULL, "");
1759 assert(base->in(0) != NULL, "should not be xformed away");
1760 remerge = MergeMemNode::make(C, base->in(pnum));
1761 gvn().set_type(remerge, Type::MEMORY);
1762 base->set_req(pnum, remerge);
1763 }
1764 remerge->set_memory_at(mms.alias_idx(), q);
1765 continue;
1766 }
1767 assert(!q->is_MergeMem(), "");
1768 PhiNode* phi;
1769 if (p != q) {
1770 phi = ensure_memory_phi(mms.alias_idx(), nophi);
1771 } else {
1772 if (p->is_Phi() && p->as_Phi()->region() == r)
1773 phi = p->as_Phi();
1774 else
1775 phi = NULL;
1776 }
1777 // Insert q into local phi
1778 if (phi != NULL) {
1779 assert(phi->region() == r, "");
1780 p = phi;
2183
2184 // Clear out dead values from the debug info.
2185 kill_dead_locals();
2186
2187 // Clone the JVM State
2188 SafePointNode *sfpnt = new SafePointNode(parms, NULL);
2189
2190 // Capture memory state BEFORE a SafePoint. Since we can block at a
2191 // SafePoint we need our GC state to be safe; i.e. we need all our current
2192 // write barriers (card marks) to not float down after the SafePoint so we
2193 // must read raw memory. Likewise we need all oop stores to match the card
2194 // marks. If deopt can happen, we need ALL stores (we need the correct JVM
2195 // state on a deopt).
2196
2197 // We do not need to WRITE the memory state after a SafePoint. The control
2198 // edge will keep card-marks and oop-stores from floating up from below a
2199 // SafePoint and our true dependency added here will keep them from floating
2200 // down below a SafePoint.
2201
2202 // Clone the current memory state
2203 Node* mem = MergeMemNode::make(C, map()->memory());
2204
2205 mem = _gvn.transform(mem);
2206
2207 // Pass control through the safepoint
2208 sfpnt->init_req(TypeFunc::Control , control());
2209 // Fix edges normally used by a call
2210 sfpnt->init_req(TypeFunc::I_O , top() );
2211 sfpnt->init_req(TypeFunc::Memory , mem );
2212 sfpnt->init_req(TypeFunc::ReturnAdr, top() );
2213 sfpnt->init_req(TypeFunc::FramePtr , top() );
2214
2215 // Create a node for the polling address
2216 if( add_poll_param ) {
2217 Node *polladr = ConPNode::make(C, (address)os::get_polling_page());
2218 sfpnt->init_req(TypeFunc::Parms+0, _gvn.transform(polladr));
2219 }
2220
2221 // Fix up the JVM State edges
2222 add_safepoint_edges(sfpnt);
2223 Node *transformed_sfpnt = _gvn.transform(sfpnt);
2224 set_control(transformed_sfpnt);
2225
2226 // Provide an edge from root to safepoint. This makes the safepoint
2227 // appear useful until the parse has completed.
2228 if( OptoRemoveUseless && transformed_sfpnt->is_SafePoint() ) {
2229 assert(C->root() != NULL, "Expect parse is still valid");
2230 C->root()->add_prec(transformed_sfpnt);
2231 }
2232 }
2233
2234 #ifndef PRODUCT
2235 //------------------------show_parse_info--------------------------------------
2236 void Parse::show_parse_info() {
2237 InlineTree* ilt = NULL;
|
1740 // (nophi means we must not create phis, because we already parsed here)
1741 assert(n != NULL, "");
1742 // Merge the inputs to the MergeMems
1743 MergeMemNode* m = merged_memory();
1744
1745 assert(control()->is_Region(), "must be merging to a region");
1746 RegionNode* r = control()->as_Region();
1747
1748 PhiNode* base = NULL;
1749 MergeMemNode* remerge = NULL;
1750 for (MergeMemStream mms(m, n); mms.next_non_empty2(); ) {
1751 Node *p = mms.force_memory();
1752 Node *q = mms.memory2();
1753 if (mms.is_empty() && nophi) {
1754 // Trouble: No new splits allowed after a loop body is parsed.
1755 // Instead, wire the new split into a MergeMem on the backedge.
1756 // The optimizer will sort it out, slicing the phi.
1757 if (remerge == NULL) {
1758 assert(base != NULL, "");
1759 assert(base->in(0) != NULL, "should not be xformed away");
1760 remerge = MergeMemNode::make(base->in(pnum));
1761 gvn().set_type(remerge, Type::MEMORY);
1762 base->set_req(pnum, remerge);
1763 }
1764 remerge->set_memory_at(mms.alias_idx(), q);
1765 continue;
1766 }
1767 assert(!q->is_MergeMem(), "");
1768 PhiNode* phi;
1769 if (p != q) {
1770 phi = ensure_memory_phi(mms.alias_idx(), nophi);
1771 } else {
1772 if (p->is_Phi() && p->as_Phi()->region() == r)
1773 phi = p->as_Phi();
1774 else
1775 phi = NULL;
1776 }
1777 // Insert q into local phi
1778 if (phi != NULL) {
1779 assert(phi->region() == r, "");
1780 p = phi;
2183
2184 // Clear out dead values from the debug info.
2185 kill_dead_locals();
2186
2187 // Clone the JVM State
2188 SafePointNode *sfpnt = new SafePointNode(parms, NULL);
2189
2190 // Capture memory state BEFORE a SafePoint. Since we can block at a
2191 // SafePoint we need our GC state to be safe; i.e. we need all our current
2192 // write barriers (card marks) to not float down after the SafePoint so we
2193 // must read raw memory. Likewise we need all oop stores to match the card
2194 // marks. If deopt can happen, we need ALL stores (we need the correct JVM
2195 // state on a deopt).
2196
2197 // We do not need to WRITE the memory state after a SafePoint. The control
2198 // edge will keep card-marks and oop-stores from floating up from below a
2199 // SafePoint and our true dependency added here will keep them from floating
2200 // down below a SafePoint.
2201
2202 // Clone the current memory state
2203 Node* mem = MergeMemNode::make(map()->memory());
2204
2205 mem = _gvn.transform(mem);
2206
2207 // Pass control through the safepoint
2208 sfpnt->init_req(TypeFunc::Control , control());
2209 // Fix edges normally used by a call
2210 sfpnt->init_req(TypeFunc::I_O , top() );
2211 sfpnt->init_req(TypeFunc::Memory , mem );
2212 sfpnt->init_req(TypeFunc::ReturnAdr, top() );
2213 sfpnt->init_req(TypeFunc::FramePtr , top() );
2214
2215 // Create a node for the polling address
2216 if( add_poll_param ) {
2217 Node *polladr = ConPNode::make((address)os::get_polling_page());
2218 sfpnt->init_req(TypeFunc::Parms+0, _gvn.transform(polladr));
2219 }
2220
2221 // Fix up the JVM State edges
2222 add_safepoint_edges(sfpnt);
2223 Node *transformed_sfpnt = _gvn.transform(sfpnt);
2224 set_control(transformed_sfpnt);
2225
2226 // Provide an edge from root to safepoint. This makes the safepoint
2227 // appear useful until the parse has completed.
2228 if( OptoRemoveUseless && transformed_sfpnt->is_SafePoint() ) {
2229 assert(C->root() != NULL, "Expect parse is still valid");
2230 C->root()->add_prec(transformed_sfpnt);
2231 }
2232 }
2233
2234 #ifndef PRODUCT
2235 //------------------------show_parse_info--------------------------------------
2236 void Parse::show_parse_info() {
2237 InlineTree* ilt = NULL;
|