hotspot/src/share/vm/opto/ifnode.cpp
changeset 10253 35b975b1e8f3
parent 9449 b2c921e1f46d
child 10258 10c77b8c8d3e
equal deleted inserted replaced
10252:0981ce1c3eef 10253:35b975b1e8f3
  1007   Node *idom = in(0);
  1007   Node *idom = in(0);
  1008   // Need opcode to decide which way 'this' test goes
  1008   // Need opcode to decide which way 'this' test goes
  1009   int prev_op = prev_dom->Opcode();
  1009   int prev_op = prev_dom->Opcode();
  1010   Node *top = igvn->C->top(); // Shortcut to top
  1010   Node *top = igvn->C->top(); // Shortcut to top
  1011 
  1011 
       
  1012   // Loop predicates may have depending checks which should not
       
  1013   // be skipped. For example, range check predicate has two checks
       
  1014   // for lower and upper bounds.
       
  1015   ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj();
       
  1016   if (PhaseIdealLoop::is_uncommon_trap_proj(unc_proj, Deoptimization::Reason_predicate))
       
  1017     prev_dom = idom;
       
  1018 
  1012   // Now walk the current IfNode's projections.
  1019   // Now walk the current IfNode's projections.
  1013   // Loop ends when 'this' has no more uses.
  1020   // Loop ends when 'this' has no more uses.
  1014   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; --i) {
  1021   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; --i) {
  1015     Node *ifp = last_out(i);     // Get IfTrue/IfFalse
  1022     Node *ifp = last_out(i);     // Get IfTrue/IfFalse
  1016     igvn->add_users_to_worklist(ifp);
  1023     igvn->add_users_to_worklist(ifp);
  1017     // Check which projection it is and set target.
  1024     // Check which projection it is and set target.
  1018     // Data-target is either the dominating projection of the same type
  1025     // Data-target is either the dominating projection of the same type
  1019     // or TOP if the dominating projection is of opposite type.
  1026     // or TOP if the dominating projection is of opposite type.
  1020     // Data-target will be used as the new control edge for the non-CFG
  1027     // Data-target will be used as the new control edge for the non-CFG
  1021     // nodes like Casts and Loads.
  1028     // nodes like Casts and Loads.
  1022     Node *data_target = (ifp->Opcode() == prev_op ) ? prev_dom : top;
  1029     Node *data_target = (ifp->Opcode() == prev_op) ? prev_dom : top;
  1023     // Control-target is just the If's immediate dominator or TOP.
  1030     // Control-target is just the If's immediate dominator or TOP.
  1024     Node *ctrl_target = (ifp->Opcode() == prev_op ) ?     idom : top;
  1031     Node *ctrl_target = (ifp->Opcode() == prev_op) ?     idom : top;
  1025 
  1032 
  1026     // For each child of an IfTrue/IfFalse projection, reroute.
  1033     // For each child of an IfTrue/IfFalse projection, reroute.
  1027     // Loop ends when projection has no more uses.
  1034     // Loop ends when projection has no more uses.
  1028     for (DUIterator_Last jmin, j = ifp->last_outs(jmin); j >= jmin; --j) {
  1035     for (DUIterator_Last jmin, j = ifp->last_outs(jmin); j >= jmin; --j) {
  1029       Node* s = ifp->last_out(j);   // Get child of IfTrue/IfFalse
  1036       Node* s = ifp->last_out(j);   // Get child of IfTrue/IfFalse