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

src/share/vm/opto/ifnode.cpp

Print this page
rev 5411 : 8024069: replace_in_map() should operate on parent maps
Summary: type information gets lost because replace_in_map() doesn't update parent maps
Reviewed-by:


1002   // Replace dominated IfNode
1003   dominated_by( prev_dom, igvn );
1004 
1005   // Must return either the original node (now dead) or a new node
1006   // (Do not return a top here, since that would break the uniqueness of top.)
1007   return new (phase->C) ConINode(TypeInt::ZERO);
1008 }
1009 
1010 //------------------------------dominated_by-----------------------------------
1011 void IfNode::dominated_by( Node *prev_dom, PhaseIterGVN *igvn ) {
1012   igvn->hash_delete(this);      // Remove self to prevent spurious V-N
1013   Node *idom = in(0);
1014   // Need opcode to decide which way 'this' test goes
1015   int prev_op = prev_dom->Opcode();
1016   Node *top = igvn->C->top(); // Shortcut to top
1017 
1018   // Loop predicates may have depending checks which should not
1019   // be skipped. For example, range check predicate has two checks
1020   // for lower and upper bounds.
1021   ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj();
1022   if (PhaseIdealLoop::is_uncommon_trap_proj(unc_proj, Deoptimization::Reason_predicate))
1023     prev_dom = idom;
1024 
1025   // Now walk the current IfNode's projections.
1026   // Loop ends when 'this' has no more uses.
1027   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; --i) {
1028     Node *ifp = last_out(i);     // Get IfTrue/IfFalse
1029     igvn->add_users_to_worklist(ifp);
1030     // Check which projection it is and set target.
1031     // Data-target is either the dominating projection of the same type
1032     // or TOP if the dominating projection is of opposite type.
1033     // Data-target will be used as the new control edge for the non-CFG
1034     // nodes like Casts and Loads.
1035     Node *data_target = (ifp->Opcode() == prev_op) ? prev_dom : top;
1036     // Control-target is just the If's immediate dominator or TOP.
1037     Node *ctrl_target = (ifp->Opcode() == prev_op) ?     idom : top;
1038 
1039     // For each child of an IfTrue/IfFalse projection, reroute.
1040     // Loop ends when projection has no more uses.
1041     for (DUIterator_Last jmin, j = ifp->last_outs(jmin); j >= jmin; --j) {
1042       Node* s = ifp->last_out(j);   // Get child of IfTrue/IfFalse




1002   // Replace dominated IfNode
1003   dominated_by( prev_dom, igvn );
1004 
1005   // Must return either the original node (now dead) or a new node
1006   // (Do not return a top here, since that would break the uniqueness of top.)
1007   return new (phase->C) ConINode(TypeInt::ZERO);
1008 }
1009 
1010 //------------------------------dominated_by-----------------------------------
1011 void IfNode::dominated_by( Node *prev_dom, PhaseIterGVN *igvn ) {
1012   igvn->hash_delete(this);      // Remove self to prevent spurious V-N
1013   Node *idom = in(0);
1014   // Need opcode to decide which way 'this' test goes
1015   int prev_op = prev_dom->Opcode();
1016   Node *top = igvn->C->top(); // Shortcut to top
1017 
1018   // Loop predicates may have depending checks which should not
1019   // be skipped. For example, range check predicate has two checks
1020   // for lower and upper bounds.
1021   ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj();
1022   if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate))
1023     prev_dom = idom;
1024 
1025   // Now walk the current IfNode's projections.
1026   // Loop ends when 'this' has no more uses.
1027   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; --i) {
1028     Node *ifp = last_out(i);     // Get IfTrue/IfFalse
1029     igvn->add_users_to_worklist(ifp);
1030     // Check which projection it is and set target.
1031     // Data-target is either the dominating projection of the same type
1032     // or TOP if the dominating projection is of opposite type.
1033     // Data-target will be used as the new control edge for the non-CFG
1034     // nodes like Casts and Loads.
1035     Node *data_target = (ifp->Opcode() == prev_op) ? prev_dom : top;
1036     // Control-target is just the If's immediate dominator or TOP.
1037     Node *ctrl_target = (ifp->Opcode() == prev_op) ?     idom : top;
1038 
1039     // For each child of an IfTrue/IfFalse projection, reroute.
1040     // Loop ends when projection has no more uses.
1041     for (DUIterator_Last jmin, j = ifp->last_outs(jmin); j >= jmin; --j) {
1042       Node* s = ifp->last_out(j);   // Get child of IfTrue/IfFalse


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