src/share/vm/opto/cfgnode.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 








  25 // Portions of code courtesy of Clifford Click
  26 
  27 // Optimization - Graph Style
  28 
  29 class Matcher;
  30 class Node;
  31 class   RegionNode;
  32 class   TypeNode;
  33 class     PhiNode;
  34 class   GotoNode;
  35 class   MultiNode;
  36 class     MultiBranchNode;
  37 class       IfNode;
  38 class       PCTableNode;
  39 class         JumpNode;
  40 class         CatchNode;
  41 class       NeverBranchNode;
  42 class   ProjNode;
  43 class     CProjNode;
  44 class       IfTrueNode;


 502 
 503 //------------------------------NeverBranchNode-------------------------------
 504 // The never-taken branch.  Used to give the appearance of exiting infinite
 505 // loops to those algorithms that like all paths to be reachable.  Encodes
 506 // empty.
 507 class NeverBranchNode : public MultiBranchNode {
 508 public:
 509   NeverBranchNode( Node *ctrl ) : MultiBranchNode(1) { init_req(0,ctrl); }
 510   virtual int Opcode() const;
 511   virtual bool pinned() const { return true; };
 512   virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
 513   virtual const Type *Value( PhaseTransform *phase ) const;
 514   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 515   virtual int required_outcnt() const { return 2; }
 516   virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { }
 517   virtual uint size(PhaseRegAlloc *ra_) const { return 0; }
 518 #ifndef PRODUCT
 519   virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 520 #endif
 521 };


   1 /*
   2  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_OPTO_CFGNODE_HPP
  26 #define SHARE_VM_OPTO_CFGNODE_HPP
  27 
  28 #include "opto/multnode.hpp"
  29 #include "opto/node.hpp"
  30 #include "opto/opcodes.hpp"
  31 #include "opto/type.hpp"
  32 
  33 // Portions of code courtesy of Clifford Click
  34 
  35 // Optimization - Graph Style
  36 
  37 class Matcher;
  38 class Node;
  39 class   RegionNode;
  40 class   TypeNode;
  41 class     PhiNode;
  42 class   GotoNode;
  43 class   MultiNode;
  44 class     MultiBranchNode;
  45 class       IfNode;
  46 class       PCTableNode;
  47 class         JumpNode;
  48 class         CatchNode;
  49 class       NeverBranchNode;
  50 class   ProjNode;
  51 class     CProjNode;
  52 class       IfTrueNode;


 510 
 511 //------------------------------NeverBranchNode-------------------------------
 512 // The never-taken branch.  Used to give the appearance of exiting infinite
 513 // loops to those algorithms that like all paths to be reachable.  Encodes
 514 // empty.
 515 class NeverBranchNode : public MultiBranchNode {
 516 public:
 517   NeverBranchNode( Node *ctrl ) : MultiBranchNode(1) { init_req(0,ctrl); }
 518   virtual int Opcode() const;
 519   virtual bool pinned() const { return true; };
 520   virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
 521   virtual const Type *Value( PhaseTransform *phase ) const;
 522   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 523   virtual int required_outcnt() const { return 2; }
 524   virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { }
 525   virtual uint size(PhaseRegAlloc *ra_) const { return 0; }
 526 #ifndef PRODUCT
 527   virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 528 #endif
 529 };
 530 
 531 #endif // SHARE_VM_OPTO_CFGNODE_HPP