hotspot/src/share/vm/opto/cfgnode.hpp

Print this page
rev 611 : Merge
   1 #ifdef USE_PRAGMA_IDENT_HDR
   2 #pragma ident "@(#)cfgnode.hpp  1.117 07/10/23 13:12:52 JVM"
   3 #endif
   4 /*
   5  * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  


  96 // jump projection for node that produces multiple control-flow paths
  97 class JProjNode : public ProjNode {
  98  public:
  99   JProjNode( Node* ctrl, uint idx ) : ProjNode(ctrl,idx) {}
 100   virtual int Opcode() const;
 101   virtual bool  is_CFG() const { return true; }
 102   virtual uint  hash() const { return NO_HASH; }  // CFG nodes do not hash
 103   virtual const Node* is_block_proj() const { return in(0); }
 104   virtual const RegMask& out_RegMask() const;
 105   virtual uint  ideal_reg() const { return 0; }
 106 };  
 107 
 108 //------------------------------PhiNode----------------------------------------
 109 // PhiNodes merge values from different Control paths.  Slot 0 points to the
 110 // controlling RegionNode.  Other slots map 1-for-1 with incoming control flow
 111 // paths to the RegionNode.  For speed reasons (to avoid another pass) we 
 112 // can turn PhiNodes into copys in-place by NULL'ing out their RegionNode 
 113 // input in slot 0.
 114 class PhiNode : public TypeNode {
 115   const TypePtr* const _adr_type; // non-null only for Type::MEMORY nodes.




 116   // Size is bigger to hold the _adr_type field.
 117   virtual uint hash() const;    // Check the type
 118   virtual uint cmp( const Node &n ) const;
 119   virtual uint size_of() const { return sizeof(*this); }
 120 
 121   // Determine a unique non-trivial input, if any.
 122   // Ignore casts if it helps.  Return NULL on failure.
 123   Node* unique_input(PhaseTransform *phase);
 124   // Determine if CMoveNode::is_cmove_id can be used at this join point.
 125   Node* is_cmove_id(PhaseTransform* phase, int true_path);
 126 
 127 public:
 128   // Node layout (parallels RegionNode):
 129   enum { Region,                // Control input is the Phi's region.
 130          Input                  // Input values are [1..len)
 131   };
 132 
 133   PhiNode( Node *r, const Type *t, const TypePtr* at = NULL )
 134     : TypeNode(t,r->req()), _adr_type(at) {








 135     init_class_id(Class_Phi);
 136     init_req(0, r);
 137     verify_adr_type();
 138   }
 139   // create a new phi with in edges matching r and set (initially) to x
 140   static PhiNode* make( Node* r, Node* x );
 141   // extra type arguments override the new phi's bottom_type and adr_type
 142   static PhiNode* make( Node* r, Node* x, const Type *t, const TypePtr* at = NULL );
 143   // create a new phi with narrowed memory type
 144   PhiNode* slice_memory(const TypePtr* adr_type) const;

 145   // like make(r, x), but does not initialize the in edges to x
 146   static PhiNode* make_blank( Node* r, Node* x );
 147 
 148   // Accessors
 149   RegionNode* region() const { Node* r = in(Region); assert(!r || r->is_Region(), ""); return (RegionNode*)r; }
 150 
 151   Node* is_copy() const {
 152     // The node is a real phi if _in[0] is a Region node.
 153     DEBUG_ONLY(const Node* r = _in[Region];)
 154     assert(r != NULL && r->is_Region(), "Not valid control");
 155     return NULL;  // not a copy!
 156   }
 157 






 158   // Check for a simple dead loop.
 159   enum LoopSafety { Safe = 0, Unsafe, UnsafeLoop };
 160   LoopSafety simple_data_loop_check(Node *in) const;
 161   // Is it unsafe data loop? It becomes a dead loop if this phi node removed.
 162   bool is_unsafe_data_reference(Node *in) const;
 163   int  is_diamond_phi() const;
 164   virtual int Opcode() const;
 165   virtual bool pinned() const { return in(0) != 0; }
 166   virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; }












 167   virtual const Type *Value( PhaseTransform *phase ) const;
 168   virtual Node *Identity( PhaseTransform *phase );
 169   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 170   virtual const RegMask &out_RegMask() const;
 171   virtual const RegMask &in_RegMask(uint) const;
 172 #ifndef PRODUCT
 173   virtual void dump_spec(outputStream *st) const;
 174 #endif
 175 #ifdef ASSERT
 176   void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
 177   void verify_adr_type(bool recursive = false) const;
 178 #else //ASSERT
 179   void verify_adr_type(bool recursive = false) const {}
 180 #endif //ASSERT
 181 };
 182 
 183 //------------------------------GotoNode---------------------------------------
 184 // GotoNodes perform direct branches.
 185 class GotoNode : public Node {
 186 public:


 204 class CProjNode : public ProjNode {
 205 public:
 206   CProjNode( Node *ctrl, uint idx ) : ProjNode(ctrl,idx) {}
 207   virtual int Opcode() const;
 208   virtual bool  is_CFG() const { return true; }
 209   virtual uint hash() const { return NO_HASH; }  // CFG nodes do not hash
 210   virtual const Node *is_block_proj() const { return in(0); }
 211   virtual const RegMask &out_RegMask() const;
 212   virtual uint ideal_reg() const { return 0; }
 213 }; 
 214 
 215 //---------------------------MultiBranchNode-----------------------------------
 216 // This class defines a MultiBranchNode, a MultiNode which yields multiple
 217 // control values. These are distinguished from other types of MultiNodes 
 218 // which yield multiple values, but control is always and only projection #0.
 219 class MultiBranchNode : public MultiNode {
 220 public:
 221   MultiBranchNode( uint required ) : MultiNode(required) {
 222     init_class_id(Class_MultiBranch);
 223   }


 224 };
 225 
 226 //------------------------------IfNode-----------------------------------------
 227 // Output selected Control, based on a boolean test
 228 class IfNode : public MultiBranchNode {
 229   // Size is bigger to hold the probability field.  However, _prob does not
 230   // change the semantics so it does not appear in the hash & cmp functions.
 231   virtual uint size_of() const { return sizeof(*this); }
 232 public:
 233 
 234   // Degrees of branch prediction probability by order of magnitude:
 235   // PROB_UNLIKELY_1e(N) is a 1 in 1eN chance.
 236   // PROB_LIKELY_1e(N) is a 1 - PROB_UNLIKELY_1e(N)
 237 #define PROB_UNLIKELY_MAG(N)    (1e- ## N ## f)
 238 #define PROB_LIKELY_MAG(N)      (1.0f-PROB_UNLIKELY_MAG(N))
 239 
 240   // Maximum and minimum branch prediction probabilties 
 241   // 1 in 1,000,000 (magnitude 6)
 242   //
 243   // Although PROB_NEVER == PROB_MIN and PROB_ALWAYS == PROB_MAX


 293   //     likelihood of FP clipping failure
 294   //     likelihood of catching an exception from a try block
 295   //     likelihood of null check failure if a null has NOT been seen before
 296   //
 297   // Magic manifest probabilities such as 0.83, 0.7, ... can be found in 
 298   // gen_subtype_check() and catch_inline_exceptions().
 299 
 300   float _prob;                  // Probability of true path being taken.
 301   float _fcnt;                  // Frequency counter
 302   IfNode( Node *control, Node *b, float p, float fcnt )
 303     : MultiBranchNode(2), _prob(p), _fcnt(fcnt) {
 304     init_class_id(Class_If);
 305     init_req(0,control);
 306     init_req(1,b);
 307   }
 308   virtual int Opcode() const;
 309   virtual bool pinned() const { return true; }
 310   virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
 311   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 312   virtual const Type *Value( PhaseTransform *phase ) const;

 313   virtual const RegMask &out_RegMask() const;
 314   void dominated_by(Node* prev_dom, PhaseIterGVN* igvn);
 315   int is_range_check(Node* &range, Node* &index, jint &offset);
 316   Node* fold_compares(PhaseGVN* phase);
 317   static Node* up_one_dom(Node* curr, bool linear_only = false);
 318 
 319   // Takes the type of val and filters it through the test represented
 320   // by if_proj and returns a more refined type if one is produced.
 321   // Returns NULL is it couldn't improve the type.
 322   static const TypeInt* filtered_int_type(PhaseGVN* phase, Node* val, Node* if_proj);
 323 
 324 #ifndef PRODUCT
 325   virtual void dump_spec(outputStream *st) const;
 326 #endif
 327 };
 328 
 329 class IfTrueNode : public CProjNode {
 330 public:
 331   IfTrueNode( IfNode *ifnode ) : CProjNode(ifnode,1) {
 332     init_class_id(Class_IfTrue);


 351 // implement switch statements and exception-handling capabilities.
 352 // Undefined behavior if passed-in index is not inside the table.
 353 class PCTableNode : public MultiBranchNode {
 354   virtual uint hash() const;    // Target count; table size
 355   virtual uint cmp( const Node &n ) const;
 356   virtual uint size_of() const { return sizeof(*this); }
 357 
 358 public:
 359   const uint _size;             // Number of targets
 360 
 361   PCTableNode( Node *ctrl, Node *idx, uint size ) : MultiBranchNode(2), _size(size) {
 362     init_class_id(Class_PCTable);
 363     init_req(0, ctrl);
 364     init_req(1, idx);
 365   }
 366   virtual int Opcode() const;
 367   virtual const Type *Value( PhaseTransform *phase ) const;
 368   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 369   virtual const Type *bottom_type() const;
 370   virtual bool pinned() const { return true; }

 371 };
 372 
 373 //------------------------------JumpNode---------------------------------------
 374 // Indirect branch.  Uses PCTable above to implement a switch statement.
 375 // It emits as a table load and local branch.  
 376 class JumpNode : public PCTableNode {
 377 public:
 378   JumpNode( Node* control, Node* switch_val, uint size) : PCTableNode(control, switch_val, size) {
 379     init_class_id(Class_Jump);
 380   }
 381   virtual int   Opcode() const;
 382   virtual const RegMask& out_RegMask() const;
 383   virtual const Node* is_block_proj() const { return this; }
 384 };
 385 
 386 class JumpProjNode : public JProjNode {
 387   virtual uint hash() const;
 388   virtual uint cmp( const Node &n ) const;
 389   virtual uint size_of() const { return sizeof(*this); }
 390   


 464     init_req(0, control);
 465     init_req(1, i_o);
 466   }
 467   virtual int Opcode() const;
 468   virtual Node *Identity( PhaseTransform *phase );
 469   virtual bool pinned() const { return true; }
 470   uint match_edge(uint idx) const { return 0; }
 471   virtual uint ideal_reg() const { return Op_RegP; }
 472 };
 473 
 474 //------------------------------NeverBranchNode-------------------------------
 475 // The never-taken branch.  Used to give the appearance of exiting infinite
 476 // loops to those algorithms that like all paths to be reachable.  Encodes
 477 // empty.
 478 class NeverBranchNode : public MultiBranchNode {
 479 public:
 480   NeverBranchNode( Node *ctrl ) : MultiBranchNode(1) { init_req(0,ctrl); }
 481   virtual int Opcode() const;
 482   virtual bool pinned() const { return true; };
 483   virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
 484 


 485   virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { }
 486   virtual uint size(PhaseRegAlloc *ra_) const { return 0; }
 487 #ifndef PRODUCT
 488   virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 489 #endif
 490 };
 491 
   1 #ifdef USE_PRAGMA_IDENT_HDR
   2 #pragma ident "@(#)cfgnode.hpp  1.117 07/10/23 13:12:52 JVM"
   3 #endif
   4 /*
   5  * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  


  96 // jump projection for node that produces multiple control-flow paths
  97 class JProjNode : public ProjNode {
  98  public:
  99   JProjNode( Node* ctrl, uint idx ) : ProjNode(ctrl,idx) {}
 100   virtual int Opcode() const;
 101   virtual bool  is_CFG() const { return true; }
 102   virtual uint  hash() const { return NO_HASH; }  // CFG nodes do not hash
 103   virtual const Node* is_block_proj() const { return in(0); }
 104   virtual const RegMask& out_RegMask() const;
 105   virtual uint  ideal_reg() const { return 0; }
 106 };  
 107 
 108 //------------------------------PhiNode----------------------------------------
 109 // PhiNodes merge values from different Control paths.  Slot 0 points to the
 110 // controlling RegionNode.  Other slots map 1-for-1 with incoming control flow
 111 // paths to the RegionNode.  For speed reasons (to avoid another pass) we 
 112 // can turn PhiNodes into copys in-place by NULL'ing out their RegionNode 
 113 // input in slot 0.
 114 class PhiNode : public TypeNode {
 115   const TypePtr* const _adr_type; // non-null only for Type::MEMORY nodes.
 116   const int _inst_id;     // Instance id of the memory slice.
 117   const int _inst_index;  // Alias index of the instance memory slice.
 118   // Array elements references have the same alias_idx but different offset.
 119   const int _inst_offset; // Offset of the instance memory slice.
 120   // Size is bigger to hold the _adr_type field.
 121   virtual uint hash() const;    // Check the type
 122   virtual uint cmp( const Node &n ) const;
 123   virtual uint size_of() const { return sizeof(*this); }
 124 



 125   // Determine if CMoveNode::is_cmove_id can be used at this join point.
 126   Node* is_cmove_id(PhaseTransform* phase, int true_path);
 127 
 128 public:
 129   // Node layout (parallels RegionNode):
 130   enum { Region,                // Control input is the Phi's region.
 131          Input                  // Input values are [1..len)
 132   };
 133 
 134   PhiNode( Node *r, const Type *t, const TypePtr* at = NULL,
 135            const int iid = TypeOopPtr::InstanceTop,
 136            const int iidx = Compile::AliasIdxTop,
 137            const int ioffs = Type::OffsetTop )
 138     : TypeNode(t,r->req()),
 139       _adr_type(at),
 140       _inst_id(iid),
 141       _inst_index(iidx),
 142       _inst_offset(ioffs)
 143   {
 144     init_class_id(Class_Phi);
 145     init_req(0, r);
 146     verify_adr_type();
 147   }
 148   // create a new phi with in edges matching r and set (initially) to x
 149   static PhiNode* make( Node* r, Node* x );
 150   // extra type arguments override the new phi's bottom_type and adr_type
 151   static PhiNode* make( Node* r, Node* x, const Type *t, const TypePtr* at = NULL );
 152   // create a new phi with narrowed memory type
 153   PhiNode* slice_memory(const TypePtr* adr_type) const;
 154   PhiNode* split_out_instance(const TypePtr* at, PhaseIterGVN *igvn) const;
 155   // like make(r, x), but does not initialize the in edges to x
 156   static PhiNode* make_blank( Node* r, Node* x );
 157 
 158   // Accessors
 159   RegionNode* region() const { Node* r = in(Region); assert(!r || r->is_Region(), ""); return (RegionNode*)r; }
 160 
 161   Node* is_copy() const {
 162     // The node is a real phi if _in[0] is a Region node.
 163     DEBUG_ONLY(const Node* r = _in[Region];)
 164     assert(r != NULL && r->is_Region(), "Not valid control");
 165     return NULL;  // not a copy!
 166   }
 167 
 168   bool is_tripcount() const;
 169 
 170   // Determine a unique non-trivial input, if any.
 171   // Ignore casts if it helps.  Return NULL on failure.
 172   Node* unique_input(PhaseTransform *phase);
 173 
 174   // Check for a simple dead loop.
 175   enum LoopSafety { Safe = 0, Unsafe, UnsafeLoop };
 176   LoopSafety simple_data_loop_check(Node *in) const;
 177   // Is it unsafe data loop? It becomes a dead loop if this phi node removed.
 178   bool is_unsafe_data_reference(Node *in) const;
 179   int  is_diamond_phi() const;
 180   virtual int Opcode() const;
 181   virtual bool pinned() const { return in(0) != 0; }
 182   virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; }
 183 
 184   const int inst_id()     const { return _inst_id; }
 185   const int inst_index()  const { return _inst_index; }
 186   const int inst_offset() const { return _inst_offset; }
 187   bool is_same_inst_field(const Type* tp, int id, int index, int offset) {
 188     return type()->basic_type() == tp->basic_type() &&
 189            inst_id()     == id     &&
 190            inst_index()  == index  &&
 191            inst_offset() == offset &&
 192            type()->higher_equal(tp);
 193   }
 194 
 195   virtual const Type *Value( PhaseTransform *phase ) const;
 196   virtual Node *Identity( PhaseTransform *phase );
 197   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 198   virtual const RegMask &out_RegMask() const;
 199   virtual const RegMask &in_RegMask(uint) const;
 200 #ifndef PRODUCT
 201   virtual void dump_spec(outputStream *st) const;
 202 #endif
 203 #ifdef ASSERT
 204   void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
 205   void verify_adr_type(bool recursive = false) const;
 206 #else //ASSERT
 207   void verify_adr_type(bool recursive = false) const {}
 208 #endif //ASSERT
 209 };
 210 
 211 //------------------------------GotoNode---------------------------------------
 212 // GotoNodes perform direct branches.
 213 class GotoNode : public Node {
 214 public:


 232 class CProjNode : public ProjNode {
 233 public:
 234   CProjNode( Node *ctrl, uint idx ) : ProjNode(ctrl,idx) {}
 235   virtual int Opcode() const;
 236   virtual bool  is_CFG() const { return true; }
 237   virtual uint hash() const { return NO_HASH; }  // CFG nodes do not hash
 238   virtual const Node *is_block_proj() const { return in(0); }
 239   virtual const RegMask &out_RegMask() const;
 240   virtual uint ideal_reg() const { return 0; }
 241 }; 
 242 
 243 //---------------------------MultiBranchNode-----------------------------------
 244 // This class defines a MultiBranchNode, a MultiNode which yields multiple
 245 // control values. These are distinguished from other types of MultiNodes 
 246 // which yield multiple values, but control is always and only projection #0.
 247 class MultiBranchNode : public MultiNode {
 248 public:
 249   MultiBranchNode( uint required ) : MultiNode(required) {
 250     init_class_id(Class_MultiBranch);
 251   }
 252   // returns required number of users to be well formed.
 253   virtual int required_outcnt() const = 0;
 254 };
 255 
 256 //------------------------------IfNode-----------------------------------------
 257 // Output selected Control, based on a boolean test
 258 class IfNode : public MultiBranchNode {
 259   // Size is bigger to hold the probability field.  However, _prob does not
 260   // change the semantics so it does not appear in the hash & cmp functions.
 261   virtual uint size_of() const { return sizeof(*this); }
 262 public:
 263 
 264   // Degrees of branch prediction probability by order of magnitude:
 265   // PROB_UNLIKELY_1e(N) is a 1 in 1eN chance.
 266   // PROB_LIKELY_1e(N) is a 1 - PROB_UNLIKELY_1e(N)
 267 #define PROB_UNLIKELY_MAG(N)    (1e- ## N ## f)
 268 #define PROB_LIKELY_MAG(N)      (1.0f-PROB_UNLIKELY_MAG(N))
 269 
 270   // Maximum and minimum branch prediction probabilties 
 271   // 1 in 1,000,000 (magnitude 6)
 272   //
 273   // Although PROB_NEVER == PROB_MIN and PROB_ALWAYS == PROB_MAX


 323   //     likelihood of FP clipping failure
 324   //     likelihood of catching an exception from a try block
 325   //     likelihood of null check failure if a null has NOT been seen before
 326   //
 327   // Magic manifest probabilities such as 0.83, 0.7, ... can be found in 
 328   // gen_subtype_check() and catch_inline_exceptions().
 329 
 330   float _prob;                  // Probability of true path being taken.
 331   float _fcnt;                  // Frequency counter
 332   IfNode( Node *control, Node *b, float p, float fcnt )
 333     : MultiBranchNode(2), _prob(p), _fcnt(fcnt) {
 334     init_class_id(Class_If);
 335     init_req(0,control);
 336     init_req(1,b);
 337   }
 338   virtual int Opcode() const;
 339   virtual bool pinned() const { return true; }
 340   virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
 341   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 342   virtual const Type *Value( PhaseTransform *phase ) const;
 343   virtual int required_outcnt() const { return 2; }
 344   virtual const RegMask &out_RegMask() const;
 345   void dominated_by(Node* prev_dom, PhaseIterGVN* igvn);
 346   int is_range_check(Node* &range, Node* &index, jint &offset);
 347   Node* fold_compares(PhaseGVN* phase);
 348   static Node* up_one_dom(Node* curr, bool linear_only = false);
 349 
 350   // Takes the type of val and filters it through the test represented
 351   // by if_proj and returns a more refined type if one is produced.
 352   // Returns NULL is it couldn't improve the type.
 353   static const TypeInt* filtered_int_type(PhaseGVN* phase, Node* val, Node* if_proj);
 354 
 355 #ifndef PRODUCT
 356   virtual void dump_spec(outputStream *st) const;
 357 #endif
 358 };
 359 
 360 class IfTrueNode : public CProjNode {
 361 public:
 362   IfTrueNode( IfNode *ifnode ) : CProjNode(ifnode,1) {
 363     init_class_id(Class_IfTrue);


 382 // implement switch statements and exception-handling capabilities.
 383 // Undefined behavior if passed-in index is not inside the table.
 384 class PCTableNode : public MultiBranchNode {
 385   virtual uint hash() const;    // Target count; table size
 386   virtual uint cmp( const Node &n ) const;
 387   virtual uint size_of() const { return sizeof(*this); }
 388 
 389 public:
 390   const uint _size;             // Number of targets
 391 
 392   PCTableNode( Node *ctrl, Node *idx, uint size ) : MultiBranchNode(2), _size(size) {
 393     init_class_id(Class_PCTable);
 394     init_req(0, ctrl);
 395     init_req(1, idx);
 396   }
 397   virtual int Opcode() const;
 398   virtual const Type *Value( PhaseTransform *phase ) const;
 399   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 400   virtual const Type *bottom_type() const;
 401   virtual bool pinned() const { return true; }
 402   virtual int required_outcnt() const { return _size; }
 403 };
 404 
 405 //------------------------------JumpNode---------------------------------------
 406 // Indirect branch.  Uses PCTable above to implement a switch statement.
 407 // It emits as a table load and local branch.  
 408 class JumpNode : public PCTableNode {
 409 public:
 410   JumpNode( Node* control, Node* switch_val, uint size) : PCTableNode(control, switch_val, size) {
 411     init_class_id(Class_Jump);
 412   }
 413   virtual int   Opcode() const;
 414   virtual const RegMask& out_RegMask() const;
 415   virtual const Node* is_block_proj() const { return this; }
 416 };
 417 
 418 class JumpProjNode : public JProjNode {
 419   virtual uint hash() const;
 420   virtual uint cmp( const Node &n ) const;
 421   virtual uint size_of() const { return sizeof(*this); }
 422   


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