connode.hpp revision 1472:c18cbe5936b8
1/*
2 * Copyright (c) 1997, 2009, 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
25class PhaseTransform;
26class MachNode;
27
28//------------------------------ConNode----------------------------------------
29// Simple constants
30class ConNode : public TypeNode {
31public:
32  ConNode( const Type *t ) : TypeNode(t,1) {
33    init_req(0, (Node*)Compile::current()->root());
34    init_flags(Flag_is_Con);
35  }
36  virtual int  Opcode() const;
37  virtual uint hash() const;
38  virtual const RegMask &out_RegMask() const { return RegMask::Empty; }
39  virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; }
40
41  // Polymorphic factory method:
42  static ConNode* make( Compile* C, const Type *t );
43};
44
45//------------------------------ConINode---------------------------------------
46// Simple integer constants
47class ConINode : public ConNode {
48public:
49  ConINode( const TypeInt *t ) : ConNode(t) {}
50  virtual int Opcode() const;
51
52  // Factory method:
53  static ConINode* make( Compile* C, int con ) {
54    return new (C, 1) ConINode( TypeInt::make(con) );
55  }
56
57};
58
59//------------------------------ConPNode---------------------------------------
60// Simple pointer constants
61class ConPNode : public ConNode {
62public:
63  ConPNode( const TypePtr *t ) : ConNode(t) {}
64  virtual int Opcode() const;
65
66  // Factory methods:
67  static ConPNode* make( Compile *C ,address con ) {
68    if (con == NULL)
69      return new (C, 1) ConPNode( TypePtr::NULL_PTR ) ;
70    else
71      return new (C, 1) ConPNode( TypeRawPtr::make(con) );
72  }
73};
74
75
76//------------------------------ConNNode--------------------------------------
77// Simple narrow oop constants
78class ConNNode : public ConNode {
79public:
80  ConNNode( const TypeNarrowOop *t ) : ConNode(t) {}
81  virtual int Opcode() const;
82};
83
84
85//------------------------------ConLNode---------------------------------------
86// Simple long constants
87class ConLNode : public ConNode {
88public:
89  ConLNode( const TypeLong *t ) : ConNode(t) {}
90  virtual int Opcode() const;
91
92  // Factory method:
93  static ConLNode* make( Compile *C ,jlong con ) {
94    return new (C, 1) ConLNode( TypeLong::make(con) );
95  }
96
97};
98
99//------------------------------ConFNode---------------------------------------
100// Simple float constants
101class ConFNode : public ConNode {
102public:
103  ConFNode( const TypeF *t ) : ConNode(t) {}
104  virtual int Opcode() const;
105
106  // Factory method:
107  static ConFNode* make( Compile *C, float con  ) {
108    return new (C, 1) ConFNode( TypeF::make(con) );
109  }
110
111};
112
113//------------------------------ConDNode---------------------------------------
114// Simple double constants
115class ConDNode : public ConNode {
116public:
117  ConDNode( const TypeD *t ) : ConNode(t) {}
118  virtual int Opcode() const;
119
120  // Factory method:
121  static ConDNode* make( Compile *C, double con ) {
122    return new (C, 1) ConDNode( TypeD::make(con) );
123  }
124
125};
126
127//------------------------------BinaryNode-------------------------------------
128// Place holder for the 2 conditional inputs to a CMove.  CMove needs 4
129// inputs: the Bool (for the lt/gt/eq/ne bits), the flags (result of some
130// compare), and the 2 values to select between.  The Matcher requires a
131// binary tree so we break it down like this:
132//     (CMove (Binary bol cmp) (Binary src1 src2))
133class BinaryNode : public Node {
134public:
135  BinaryNode( Node *n1, Node *n2 ) : Node(0,n1,n2) { }
136  virtual int Opcode() const;
137  virtual uint ideal_reg() const { return 0; }
138};
139
140//------------------------------CMoveNode--------------------------------------
141// Conditional move
142class CMoveNode : public TypeNode {
143public:
144  enum { Control,               // When is it safe to do this cmove?
145         Condition,             // Condition controlling the cmove
146         IfFalse,               // Value if condition is false
147         IfTrue };              // Value if condition is true
148  CMoveNode( Node *bol, Node *left, Node *right, const Type *t ) : TypeNode(t,4)
149  {
150    init_class_id(Class_CMove);
151    // all inputs are nullified in Node::Node(int)
152    // init_req(Control,NULL);
153    init_req(Condition,bol);
154    init_req(IfFalse,left);
155    init_req(IfTrue,right);
156  }
157  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
158  virtual const Type *Value( PhaseTransform *phase ) const;
159  virtual Node *Identity( PhaseTransform *phase );
160  static CMoveNode *make( Compile *C, Node *c, Node *bol, Node *left, Node *right, const Type *t );
161  // Helper function to spot cmove graph shapes
162  static Node *is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f, BoolNode *b );
163};
164
165//------------------------------CMoveDNode-------------------------------------
166class CMoveDNode : public CMoveNode {
167public:
168  CMoveDNode( Node *bol, Node *left, Node *right, const Type* t) : CMoveNode(bol,left,right,t){}
169  virtual int Opcode() const;
170  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
171};
172
173//------------------------------CMoveFNode-------------------------------------
174class CMoveFNode : public CMoveNode {
175public:
176  CMoveFNode( Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) {}
177  virtual int Opcode() const;
178  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
179};
180
181//------------------------------CMoveINode-------------------------------------
182class CMoveINode : public CMoveNode {
183public:
184  CMoveINode( Node *bol, Node *left, Node *right, const TypeInt *ti ) : CMoveNode(bol,left,right,ti){}
185  virtual int Opcode() const;
186  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
187};
188
189//------------------------------CMoveLNode-------------------------------------
190class CMoveLNode : public CMoveNode {
191public:
192  CMoveLNode(Node *bol, Node *left, Node *right, const TypeLong *tl ) : CMoveNode(bol,left,right,tl){}
193  virtual int Opcode() const;
194};
195
196//------------------------------CMovePNode-------------------------------------
197class CMovePNode : public CMoveNode {
198public:
199  CMovePNode( Node *c, Node *bol, Node *left, Node *right, const TypePtr* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); }
200  virtual int Opcode() const;
201};
202
203//------------------------------CMoveNNode-------------------------------------
204class CMoveNNode : public CMoveNode {
205public:
206  CMoveNNode( Node *c, Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); }
207  virtual int Opcode() const;
208};
209
210//------------------------------ConstraintCastNode-----------------------------
211// cast to a different range
212class ConstraintCastNode: public TypeNode {
213public:
214  ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) {
215    init_class_id(Class_ConstraintCast);
216    init_req(1, n);
217  }
218  virtual Node *Identity( PhaseTransform *phase );
219  virtual const Type *Value( PhaseTransform *phase ) const;
220  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
221  virtual int Opcode() const;
222  virtual uint ideal_reg() const = 0;
223  virtual Node *Ideal_DU_postCCP( PhaseCCP * );
224};
225
226//------------------------------CastIINode-------------------------------------
227// cast integer to integer (different range)
228class CastIINode: public ConstraintCastNode {
229public:
230  CastIINode (Node *n, const Type *t ): ConstraintCastNode(n,t) {}
231  virtual int Opcode() const;
232  virtual uint ideal_reg() const { return Op_RegI; }
233};
234
235//------------------------------CastPPNode-------------------------------------
236// cast pointer to pointer (different type)
237class CastPPNode: public ConstraintCastNode {
238public:
239  CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {}
240  virtual int Opcode() const;
241  virtual uint ideal_reg() const { return Op_RegP; }
242  virtual Node *Ideal_DU_postCCP( PhaseCCP * );
243};
244
245//------------------------------CheckCastPPNode--------------------------------
246// for _checkcast, cast pointer to pointer (different type), without JOIN,
247class CheckCastPPNode: public TypeNode {
248public:
249  CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) {
250    init_class_id(Class_CheckCastPP);
251    init_req(0, c);
252    init_req(1, n);
253  }
254
255  virtual Node *Identity( PhaseTransform *phase );
256  virtual const Type *Value( PhaseTransform *phase ) const;
257  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
258  virtual int   Opcode() const;
259  virtual uint  ideal_reg() const { return Op_RegP; }
260  // No longer remove CheckCast after CCP as it gives me a place to hang
261  // the proper address type - which is required to compute anti-deps.
262  //virtual Node *Ideal_DU_postCCP( PhaseCCP * );
263};
264
265
266//------------------------------EncodeP--------------------------------
267// Encodes an oop pointers into its compressed form
268// Takes an extra argument which is the real heap base as a long which
269// may be useful for code generation in the backend.
270class EncodePNode : public TypeNode {
271 public:
272  EncodePNode(Node* value, const Type* type):
273    TypeNode(type, 2) {
274    init_class_id(Class_EncodeP);
275    init_req(0, NULL);
276    init_req(1, value);
277  }
278  virtual int Opcode() const;
279  virtual Node *Identity( PhaseTransform *phase );
280  virtual const Type *Value( PhaseTransform *phase ) const;
281  virtual uint  ideal_reg() const { return Op_RegN; }
282
283  virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
284};
285
286//------------------------------DecodeN--------------------------------
287// Converts a narrow oop into a real oop ptr.
288// Takes an extra argument which is the real heap base as a long which
289// may be useful for code generation in the backend.
290class DecodeNNode : public TypeNode {
291 public:
292  DecodeNNode(Node* value, const Type* type):
293    TypeNode(type, 2) {
294    init_class_id(Class_DecodeN);
295    init_req(0, NULL);
296    init_req(1, value);
297  }
298  virtual int Opcode() const;
299  virtual Node *Identity( PhaseTransform *phase );
300  virtual const Type *Value( PhaseTransform *phase ) const;
301  virtual uint  ideal_reg() const { return Op_RegP; }
302};
303
304//------------------------------Conv2BNode-------------------------------------
305// Convert int/pointer to a Boolean.  Map zero to zero, all else to 1.
306class Conv2BNode : public Node {
307public:
308  Conv2BNode( Node *i ) : Node(0,i) {}
309  virtual int Opcode() const;
310  virtual const Type *bottom_type() const { return TypeInt::BOOL; }
311  virtual Node *Identity( PhaseTransform *phase );
312  virtual const Type *Value( PhaseTransform *phase ) const;
313  virtual uint  ideal_reg() const { return Op_RegI; }
314};
315
316// The conversions operations are all Alpha sorted.  Please keep it that way!
317//------------------------------ConvD2FNode------------------------------------
318// Convert double to float
319class ConvD2FNode : public Node {
320public:
321  ConvD2FNode( Node *in1 ) : Node(0,in1) {}
322  virtual int Opcode() const;
323  virtual const Type *bottom_type() const { return Type::FLOAT; }
324  virtual const Type *Value( PhaseTransform *phase ) const;
325  virtual Node *Identity( PhaseTransform *phase );
326  virtual uint  ideal_reg() const { return Op_RegF; }
327};
328
329//------------------------------ConvD2INode------------------------------------
330// Convert Double to Integer
331class ConvD2INode : public Node {
332public:
333  ConvD2INode( Node *in1 ) : Node(0,in1) {}
334  virtual int Opcode() const;
335  virtual const Type *bottom_type() const { return TypeInt::INT; }
336  virtual const Type *Value( PhaseTransform *phase ) const;
337  virtual Node *Identity( PhaseTransform *phase );
338  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
339  virtual uint  ideal_reg() const { return Op_RegI; }
340};
341
342//------------------------------ConvD2LNode------------------------------------
343// Convert Double to Long
344class ConvD2LNode : public Node {
345public:
346  ConvD2LNode( Node *dbl ) : Node(0,dbl) {}
347  virtual int Opcode() const;
348  virtual const Type *bottom_type() const { return TypeLong::LONG; }
349  virtual const Type *Value( PhaseTransform *phase ) const;
350  virtual Node *Identity( PhaseTransform *phase );
351  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
352  virtual uint ideal_reg() const { return Op_RegL; }
353};
354
355//------------------------------ConvF2DNode------------------------------------
356// Convert Float to a Double.
357class ConvF2DNode : public Node {
358public:
359  ConvF2DNode( Node *in1 ) : Node(0,in1) {}
360  virtual int Opcode() const;
361  virtual const Type *bottom_type() const { return Type::DOUBLE; }
362  virtual const Type *Value( PhaseTransform *phase ) const;
363  virtual uint  ideal_reg() const { return Op_RegD; }
364};
365
366//------------------------------ConvF2INode------------------------------------
367// Convert float to integer
368class ConvF2INode : public Node {
369public:
370  ConvF2INode( Node *in1 ) : Node(0,in1) {}
371  virtual int Opcode() const;
372  virtual const Type *bottom_type() const { return TypeInt::INT; }
373  virtual const Type *Value( PhaseTransform *phase ) const;
374  virtual Node *Identity( PhaseTransform *phase );
375  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
376  virtual uint  ideal_reg() const { return Op_RegI; }
377};
378
379//------------------------------ConvF2LNode------------------------------------
380// Convert float to long
381class ConvF2LNode : public Node {
382public:
383  ConvF2LNode( Node *in1 ) : Node(0,in1) {}
384  virtual int Opcode() const;
385  virtual const Type *bottom_type() const { return TypeLong::LONG; }
386  virtual const Type *Value( PhaseTransform *phase ) const;
387  virtual Node *Identity( PhaseTransform *phase );
388  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
389  virtual uint  ideal_reg() const { return Op_RegL; }
390};
391
392//------------------------------ConvI2DNode------------------------------------
393// Convert Integer to Double
394class ConvI2DNode : public Node {
395public:
396  ConvI2DNode( Node *in1 ) : Node(0,in1) {}
397  virtual int Opcode() const;
398  virtual const Type *bottom_type() const { return Type::DOUBLE; }
399  virtual const Type *Value( PhaseTransform *phase ) const;
400  virtual uint  ideal_reg() const { return Op_RegD; }
401};
402
403//------------------------------ConvI2FNode------------------------------------
404// Convert Integer to Float
405class ConvI2FNode : public Node {
406public:
407  ConvI2FNode( Node *in1 ) : Node(0,in1) {}
408  virtual int Opcode() const;
409  virtual const Type *bottom_type() const { return Type::FLOAT; }
410  virtual const Type *Value( PhaseTransform *phase ) const;
411  virtual Node *Identity( PhaseTransform *phase );
412  virtual uint  ideal_reg() const { return Op_RegF; }
413};
414
415//------------------------------ConvI2LNode------------------------------------
416// Convert integer to long
417class ConvI2LNode : public TypeNode {
418public:
419  ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT)
420    : TypeNode(t, 2)
421  { init_req(1, in1); }
422  virtual int Opcode() const;
423  virtual const Type *Value( PhaseTransform *phase ) const;
424  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
425  virtual uint  ideal_reg() const { return Op_RegL; }
426};
427
428//------------------------------ConvL2DNode------------------------------------
429// Convert Long to Double
430class ConvL2DNode : public Node {
431public:
432  ConvL2DNode( Node *in1 ) : Node(0,in1) {}
433  virtual int Opcode() const;
434  virtual const Type *bottom_type() const { return Type::DOUBLE; }
435  virtual const Type *Value( PhaseTransform *phase ) const;
436  virtual uint ideal_reg() const { return Op_RegD; }
437};
438
439//------------------------------ConvL2FNode------------------------------------
440// Convert Long to Float
441class ConvL2FNode : public Node {
442public:
443  ConvL2FNode( Node *in1 ) : Node(0,in1) {}
444  virtual int Opcode() const;
445  virtual const Type *bottom_type() const { return Type::FLOAT; }
446  virtual const Type *Value( PhaseTransform *phase ) const;
447  virtual uint  ideal_reg() const { return Op_RegF; }
448};
449
450//------------------------------ConvL2INode------------------------------------
451// Convert long to integer
452class ConvL2INode : public Node {
453public:
454  ConvL2INode( Node *in1 ) : Node(0,in1) {}
455  virtual int Opcode() const;
456  virtual const Type *bottom_type() const { return TypeInt::INT; }
457  virtual Node *Identity( PhaseTransform *phase );
458  virtual const Type *Value( PhaseTransform *phase ) const;
459  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
460  virtual uint  ideal_reg() const { return Op_RegI; }
461};
462
463//------------------------------CastX2PNode-------------------------------------
464// convert a machine-pointer-sized integer to a raw pointer
465class CastX2PNode : public Node {
466public:
467  CastX2PNode( Node *n ) : Node(NULL, n) {}
468  virtual int Opcode() const;
469  virtual const Type *Value( PhaseTransform *phase ) const;
470  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
471  virtual Node *Identity( PhaseTransform *phase );
472  virtual uint ideal_reg() const { return Op_RegP; }
473  virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
474};
475
476//------------------------------CastP2XNode-------------------------------------
477// Used in both 32-bit and 64-bit land.
478// Used for card-marks and unsafe pointer math.
479class CastP2XNode : public Node {
480public:
481  CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}
482  virtual int Opcode() const;
483  virtual const Type *Value( PhaseTransform *phase ) const;
484  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
485  virtual Node *Identity( PhaseTransform *phase );
486  virtual uint ideal_reg() const { return Op_RegX; }
487  virtual const Type *bottom_type() const { return TypeX_X; }
488  // Return false to keep node from moving away from an associated card mark.
489  virtual bool depends_only_on_test() const { return false; }
490};
491
492//------------------------------MemMoveNode------------------------------------
493// Memory to memory move.  Inserted very late, after allocation.
494class MemMoveNode : public Node {
495public:
496  MemMoveNode( Node *dst, Node *src ) : Node(0,dst,src) {}
497  virtual int Opcode() const;
498};
499
500//------------------------------ThreadLocalNode--------------------------------
501// Ideal Node which returns the base of ThreadLocalStorage.
502class ThreadLocalNode : public Node {
503public:
504  ThreadLocalNode( ) : Node((Node*)Compile::current()->root()) {}
505  virtual int Opcode() const;
506  virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM;}
507  virtual uint ideal_reg() const { return Op_RegP; }
508};
509
510//------------------------------LoadReturnPCNode-------------------------------
511class LoadReturnPCNode: public Node {
512public:
513  LoadReturnPCNode(Node *c) : Node(c) { }
514  virtual int Opcode() const;
515  virtual uint ideal_reg() const { return Op_RegP; }
516};
517
518
519//-----------------------------RoundFloatNode----------------------------------
520class RoundFloatNode: public Node {
521public:
522  RoundFloatNode(Node* c, Node *in1): Node(c, in1) {}
523  virtual int   Opcode() const;
524  virtual const Type *bottom_type() const { return Type::FLOAT; }
525  virtual uint  ideal_reg() const { return Op_RegF; }
526  virtual Node *Identity( PhaseTransform *phase );
527  virtual const Type *Value( PhaseTransform *phase ) const;
528};
529
530
531//-----------------------------RoundDoubleNode---------------------------------
532class RoundDoubleNode: public Node {
533public:
534  RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {}
535  virtual int   Opcode() const;
536  virtual const Type *bottom_type() const { return Type::DOUBLE; }
537  virtual uint  ideal_reg() const { return Op_RegD; }
538  virtual Node *Identity( PhaseTransform *phase );
539  virtual const Type *Value( PhaseTransform *phase ) const;
540};
541
542//------------------------------Opaque1Node------------------------------------
543// A node to prevent unwanted optimizations.  Allows constant folding.
544// Stops value-numbering, Ideal calls or Identity functions.
545class Opaque1Node : public Node {
546  virtual uint hash() const ;                  // { return NO_HASH; }
547  virtual uint cmp( const Node &n ) const;
548public:
549  Opaque1Node( Compile* C, Node *n ) : Node(0,n) {
550    // Put it on the Macro nodes list to removed during macro nodes expansion.
551    init_flags(Flag_is_macro);
552    C->add_macro_node(this);
553  }
554  // Special version for the pre-loop to hold the original loop limit
555  // which is consumed by range check elimination.
556  Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {
557    // Put it on the Macro nodes list to removed during macro nodes expansion.
558    init_flags(Flag_is_macro);
559    C->add_macro_node(this);
560  }
561  Node* original_loop_limit() { return req()==3 ? in(2) : NULL; }
562  virtual int Opcode() const;
563  virtual const Type *bottom_type() const { return TypeInt::INT; }
564  virtual Node *Identity( PhaseTransform *phase );
565};
566
567//------------------------------Opaque2Node------------------------------------
568// A node to prevent unwanted optimizations.  Allows constant folding.  Stops
569// value-numbering, most Ideal calls or Identity functions.  This Node is
570// specifically designed to prevent the pre-increment value of a loop trip
571// counter from being live out of the bottom of the loop (hence causing the
572// pre- and post-increment values both being live and thus requiring an extra
573// temp register and an extra move).  If we "accidentally" optimize through
574// this kind of a Node, we'll get slightly pessimal, but correct, code.  Thus
575// it's OK to be slightly sloppy on optimizations here.
576class Opaque2Node : public Node {
577  virtual uint hash() const ;                  // { return NO_HASH; }
578  virtual uint cmp( const Node &n ) const;
579public:
580  Opaque2Node( Compile* C, Node *n ) : Node(0,n) {
581    // Put it on the Macro nodes list to removed during macro nodes expansion.
582    init_flags(Flag_is_macro);
583    C->add_macro_node(this);
584  }
585  virtual int Opcode() const;
586  virtual const Type *bottom_type() const { return TypeInt::INT; }
587};
588
589//----------------------PartialSubtypeCheckNode--------------------------------
590// The 2nd slow-half of a subtype check.  Scan the subklass's 2ndary superklass
591// array for an instance of the superklass.  Set a hidden internal cache on a
592// hit (cache is checked with exposed code in gen_subtype_check()).  Return
593// not zero for a miss or zero for a hit.
594class PartialSubtypeCheckNode : public Node {
595public:
596  PartialSubtypeCheckNode(Node* c, Node* sub, Node* super) : Node(c,sub,super) {}
597  virtual int Opcode() const;
598  virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
599  virtual uint ideal_reg() const { return Op_RegP; }
600};
601
602//
603class MoveI2FNode : public Node {
604 public:
605  MoveI2FNode( Node *value ) : Node(0,value) {}
606  virtual int Opcode() const;
607  virtual const Type *bottom_type() const { return Type::FLOAT; }
608  virtual uint ideal_reg() const { return Op_RegF; }
609  virtual const Type* Value( PhaseTransform *phase ) const;
610};
611
612class MoveL2DNode : public Node {
613 public:
614  MoveL2DNode( Node *value ) : Node(0,value) {}
615  virtual int Opcode() const;
616  virtual const Type *bottom_type() const { return Type::DOUBLE; }
617  virtual uint ideal_reg() const { return Op_RegD; }
618  virtual const Type* Value( PhaseTransform *phase ) const;
619};
620
621class MoveF2INode : public Node {
622 public:
623  MoveF2INode( Node *value ) : Node(0,value) {}
624  virtual int Opcode() const;
625  virtual const Type *bottom_type() const { return TypeInt::INT; }
626  virtual uint ideal_reg() const { return Op_RegI; }
627  virtual const Type* Value( PhaseTransform *phase ) const;
628};
629
630class MoveD2LNode : public Node {
631 public:
632  MoveD2LNode( Node *value ) : Node(0,value) {}
633  virtual int Opcode() const;
634  virtual const Type *bottom_type() const { return TypeLong::LONG; }
635  virtual uint ideal_reg() const { return Op_RegL; }
636  virtual const Type* Value( PhaseTransform *phase ) const;
637};
638
639//---------- CountBitsNode -----------------------------------------------------
640class CountBitsNode : public Node {
641public:
642  CountBitsNode(Node* in1) : Node(0, in1) {}
643  const Type* bottom_type() const { return TypeInt::INT; }
644  virtual uint ideal_reg() const { return Op_RegI; }
645};
646
647//---------- CountLeadingZerosINode --------------------------------------------
648// Count leading zeros (0-bit count starting from MSB) of an integer.
649class CountLeadingZerosINode : public CountBitsNode {
650public:
651  CountLeadingZerosINode(Node* in1) : CountBitsNode(in1) {}
652  virtual int Opcode() const;
653  virtual const Type* Value(PhaseTransform* phase) const;
654};
655
656//---------- CountLeadingZerosLNode --------------------------------------------
657// Count leading zeros (0-bit count starting from MSB) of a long.
658class CountLeadingZerosLNode : public CountBitsNode {
659public:
660  CountLeadingZerosLNode(Node* in1) : CountBitsNode(in1) {}
661  virtual int Opcode() const;
662  virtual const Type* Value(PhaseTransform* phase) const;
663};
664
665//---------- CountTrailingZerosINode -------------------------------------------
666// Count trailing zeros (0-bit count starting from LSB) of an integer.
667class CountTrailingZerosINode : public CountBitsNode {
668public:
669  CountTrailingZerosINode(Node* in1) : CountBitsNode(in1) {}
670  virtual int Opcode() const;
671  virtual const Type* Value(PhaseTransform* phase) const;
672};
673
674//---------- CountTrailingZerosLNode -------------------------------------------
675// Count trailing zeros (0-bit count starting from LSB) of a long.
676class CountTrailingZerosLNode : public CountBitsNode {
677public:
678  CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {}
679  virtual int Opcode() const;
680  virtual const Type* Value(PhaseTransform* phase) const;
681};
682
683//---------- PopCountINode -----------------------------------------------------
684// Population count (bit count) of an integer.
685class PopCountINode : public CountBitsNode {
686public:
687  PopCountINode(Node* in1) : CountBitsNode(in1) {}
688  virtual int Opcode() const;
689};
690
691//---------- PopCountLNode -----------------------------------------------------
692// Population count (bit count) of a long.
693class PopCountLNode : public CountBitsNode {
694public:
695  PopCountLNode(Node* in1) : CountBitsNode(in1) {}
696  virtual int Opcode() const;
697};
698