hotspot/src/share/vm/opto/ifnode.cpp
changeset 32084 7743e6943cdf
parent 31132 328ac96a30d6
child 32732 9f4cf1523072
equal deleted inserted replaced
32083:1796911eb140 32084:7743e6943cdf
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
  1599   }
  1599   }
  1600   // no progress
  1600   // no progress
  1601   return this;
  1601   return this;
  1602 }
  1602 }
  1603 
  1603 
       
  1604 #ifndef PRODUCT
       
  1605 //-------------------------------related---------------------------------------
       
  1606 // An IfProjNode's related node set consists of its input (an IfNode) including
       
  1607 // the IfNode's condition, plus all of its outputs at level 1. In compact mode,
       
  1608 // the restrictions for IfNode apply (see IfNode::rel).
       
  1609 void IfProjNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
       
  1610   Node* ifNode = this->in(0);
       
  1611   in_rel->append(ifNode);
       
  1612   if (compact) {
       
  1613     ifNode->collect_nodes(in_rel, 3, false, true);
       
  1614   } else {
       
  1615     ifNode->collect_nodes_in_all_data(in_rel, false);
       
  1616   }
       
  1617   this->collect_nodes(out_rel, -1, false, false);
       
  1618 }
       
  1619 
  1604 //------------------------------dump_spec--------------------------------------
  1620 //------------------------------dump_spec--------------------------------------
  1605 #ifndef PRODUCT
       
  1606 void IfNode::dump_spec(outputStream *st) const {
  1621 void IfNode::dump_spec(outputStream *st) const {
  1607   st->print("P=%f, C=%f",_prob,_fcnt);
  1622   st->print("P=%f, C=%f",_prob,_fcnt);
       
  1623 }
       
  1624 
       
  1625 //-------------------------------related---------------------------------------
       
  1626 // For an IfNode, the set of related output nodes is just the output nodes till
       
  1627 // depth 2, i.e, the IfTrue/IfFalse projection nodes plus the nodes they refer.
       
  1628 // The related input nodes contain no control nodes, but all data nodes
       
  1629 // pertaining to the condition. In compact mode, the input nodes are collected
       
  1630 // up to a depth of 3.
       
  1631 void IfNode::related(GrowableArray <Node *> *in_rel, GrowableArray <Node *> *out_rel, bool compact) const {
       
  1632   if (compact) {
       
  1633     this->collect_nodes(in_rel, 3, false, true);
       
  1634   } else {
       
  1635     this->collect_nodes_in_all_data(in_rel, false);
       
  1636   }
       
  1637   this->collect_nodes(out_rel, -2, false, false);
  1608 }
  1638 }
  1609 #endif
  1639 #endif
  1610 
  1640 
  1611 //------------------------------idealize_test----------------------------------
  1641 //------------------------------idealize_test----------------------------------
  1612 // Try to canonicalize tests better.  Peek at the Cmp/Bool/If sequence and
  1642 // Try to canonicalize tests better.  Peek at the Cmp/Bool/If sequence and