connode.hpp revision 196:d1605aabd0a1
180183Sjkh/* 280183Sjkh * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 380183Sjkh * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 480183Sjkh * 580183Sjkh * This code is free software; you can redistribute it and/or modify it 680183Sjkh * under the terms of the GNU General Public License version 2 only, as 780183Sjkh * published by the Free Software Foundation. 880183Sjkh * 980183Sjkh * This code is distributed in the hope that it will be useful, but WITHOUT 1080183Sjkh * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1180183Sjkh * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1280183Sjkh * version 2 for more details (a copy is included in the LICENSE file that 1380183Sjkh * accompanied this code). 1480183Sjkh * 1580183Sjkh * You should have received a copy of the GNU General Public License version 1680183Sjkh * 2 along with this work; if not, write to the Free Software Foundation, 1780183Sjkh * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1880183Sjkh * 1980183Sjkh * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2080183Sjkh * CA 95054 USA or visit www.sun.com if you need additional information or 2180183Sjkh * have any questions. 2280183Sjkh * 2380183Sjkh */ 2480183Sjkh 2580183Sjkhclass PhaseTransform; 26333006Sbennoclass MachNode; 27333006Sbenno 28333006Sbenno//------------------------------ConNode---------------------------------------- 29333006Sbenno// Simple constants 30333006Sbennoclass ConNode : public TypeNode { 31333006Sbennopublic: 32333006Sbenno ConNode( const Type *t ) : TypeNode(t,1) { 33333006Sbenno init_req(0, (Node*)Compile::current()->root()); 34333006Sbenno init_flags(Flag_is_Con); 35333006Sbenno } 36333006Sbenno virtual int Opcode() const; 37333006Sbenno virtual uint hash() const; 3880183Sjkh virtual const RegMask &out_RegMask() const { return RegMask::Empty; } 3980183Sjkh virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; } 40221466Snwhitehorn 41264995Snwhitehorn // Polymorphic factory method: 42264995Snwhitehorn static ConNode* make( Compile* C, const Type *t ); 43293831Ssmh}; 44264995Snwhitehorn 45264995Snwhitehorn//------------------------------ConINode--------------------------------------- 46264995Snwhitehorn// Simple integer constants 47264995Snwhitehornclass ConINode : public ConNode { 48264995Snwhitehornpublic: 49287635Sdteske ConINode( const TypeInt *t ) : ConNode(t) {} 50264995Snwhitehorn virtual int Opcode() const; 51264995Snwhitehorn 52264995Snwhitehorn // Factory method: 53333006Sbenno static ConINode* make( Compile* C, int con ) { 54264995Snwhitehorn return new (C, 1) ConINode( TypeInt::make(con) ); 5580183Sjkh } 5680183Sjkh 5780183Sjkh}; 5880183Sjkh 5980183Sjkh//------------------------------ConPNode--------------------------------------- 6080183Sjkh// Simple pointer constants 61287635Sdteskeclass ConPNode : public ConNode { 6280183Sjkhpublic: 6380183Sjkh ConPNode( const TypePtr *t ) : ConNode(t) {} 6480183Sjkh virtual int Opcode() const; 65287635Sdteske 66287635Sdteske // Factory methods: 6780183Sjkh static ConPNode* make( Compile *C ,address con ) { 68246283Shrs if (con == NULL) 69287635Sdteske return new (C, 1) ConPNode( TypePtr::NULL_PTR ) ; 70333006Sbenno else 71293223Sgjb return new (C, 1) ConPNode( TypeRawPtr::make(con) ); 72264995Snwhitehorn } 73333006Sbenno}; 74333006Sbenno 75333006Sbenno 76333006Sbenno//------------------------------ConNNode-------------------------------------- 77333006Sbenno// Simple narrow oop constants 78333006Sbennoclass ConNNode : public ConNode { 79333006Sbennopublic: 80333006Sbenno ConNNode( const TypeNarrowOop *t ) : ConNode(t) {} 81333006Sbenno virtual int Opcode() const; 82333006Sbenno}; 83333006Sbenno 84333006Sbenno 85333006Sbenno//------------------------------ConLNode--------------------------------------- 86333006Sbenno// Simple long constants 87333006Sbennoclass ConLNode : public ConNode { 88333006Sbennopublic: 89333006Sbenno ConLNode( const TypeLong *t ) : ConNode(t) {} 90333006Sbenno virtual int Opcode() const; 91333006Sbenno 92333006Sbenno // Factory method: 93333006Sbenno static ConLNode* make( Compile *C ,jlong con ) { 94333006Sbenno return new (C, 1) ConLNode( TypeLong::make(con) ); 95333006Sbenno } 96333006Sbenno 97333006Sbenno}; 98333006Sbenno 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 static Node* encode(PhaseTransform* phase, Node* value); 284 virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); 285}; 286 287//------------------------------DecodeN-------------------------------- 288// Converts a narrow oop into a real oop ptr. 289// Takes an extra argument which is the real heap base as a long which 290// may be useful for code generation in the backend. 291class DecodeNNode : public TypeNode { 292 public: 293 DecodeNNode(Node* value, const Type* type): 294 TypeNode(type, 2) { 295 init_class_id(Class_DecodeN); 296 init_req(0, NULL); 297 init_req(1, value); 298 } 299 virtual int Opcode() const; 300 virtual Node *Identity( PhaseTransform *phase ); 301 virtual const Type *Value( PhaseTransform *phase ) const; 302 virtual uint ideal_reg() const { return Op_RegP; } 303 304 static Node* decode(PhaseTransform* phase, Node* value); 305}; 306 307//------------------------------Conv2BNode------------------------------------- 308// Convert int/pointer to a Boolean. Map zero to zero, all else to 1. 309class Conv2BNode : public Node { 310public: 311 Conv2BNode( Node *i ) : Node(0,i) {} 312 virtual int Opcode() const; 313 virtual const Type *bottom_type() const { return TypeInt::BOOL; } 314 virtual Node *Identity( PhaseTransform *phase ); 315 virtual const Type *Value( PhaseTransform *phase ) const; 316 virtual uint ideal_reg() const { return Op_RegI; } 317}; 318 319// The conversions operations are all Alpha sorted. Please keep it that way! 320//------------------------------ConvD2FNode------------------------------------ 321// Convert double to float 322class ConvD2FNode : public Node { 323public: 324 ConvD2FNode( Node *in1 ) : Node(0,in1) {} 325 virtual int Opcode() const; 326 virtual const Type *bottom_type() const { return Type::FLOAT; } 327 virtual const Type *Value( PhaseTransform *phase ) const; 328 virtual Node *Identity( PhaseTransform *phase ); 329 virtual uint ideal_reg() const { return Op_RegF; } 330}; 331 332//------------------------------ConvD2INode------------------------------------ 333// Convert Double to Integer 334class ConvD2INode : public Node { 335public: 336 ConvD2INode( Node *in1 ) : Node(0,in1) {} 337 virtual int Opcode() const; 338 virtual const Type *bottom_type() const { return TypeInt::INT; } 339 virtual const Type *Value( PhaseTransform *phase ) const; 340 virtual Node *Identity( PhaseTransform *phase ); 341 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 342 virtual uint ideal_reg() const { return Op_RegI; } 343}; 344 345//------------------------------ConvD2LNode------------------------------------ 346// Convert Double to Long 347class ConvD2LNode : public Node { 348public: 349 ConvD2LNode( Node *dbl ) : Node(0,dbl) {} 350 virtual int Opcode() const; 351 virtual const Type *bottom_type() const { return TypeLong::LONG; } 352 virtual const Type *Value( PhaseTransform *phase ) const; 353 virtual Node *Identity( PhaseTransform *phase ); 354 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 355 virtual uint ideal_reg() const { return Op_RegL; } 356}; 357 358//------------------------------ConvF2DNode------------------------------------ 359// Convert Float to a Double. 360class ConvF2DNode : public Node { 361public: 362 ConvF2DNode( Node *in1 ) : Node(0,in1) {} 363 virtual int Opcode() const; 364 virtual const Type *bottom_type() const { return Type::DOUBLE; } 365 virtual const Type *Value( PhaseTransform *phase ) const; 366 virtual uint ideal_reg() const { return Op_RegD; } 367}; 368 369//------------------------------ConvF2INode------------------------------------ 370// Convert float to integer 371class ConvF2INode : public Node { 372public: 373 ConvF2INode( Node *in1 ) : Node(0,in1) {} 374 virtual int Opcode() const; 375 virtual const Type *bottom_type() const { return TypeInt::INT; } 376 virtual const Type *Value( PhaseTransform *phase ) const; 377 virtual Node *Identity( PhaseTransform *phase ); 378 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 379 virtual uint ideal_reg() const { return Op_RegI; } 380}; 381 382//------------------------------ConvF2LNode------------------------------------ 383// Convert float to long 384class ConvF2LNode : public Node { 385public: 386 ConvF2LNode( Node *in1 ) : Node(0,in1) {} 387 virtual int Opcode() const; 388 virtual const Type *bottom_type() const { return TypeLong::LONG; } 389 virtual const Type *Value( PhaseTransform *phase ) const; 390 virtual Node *Identity( PhaseTransform *phase ); 391 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 392 virtual uint ideal_reg() const { return Op_RegL; } 393}; 394 395//------------------------------ConvI2DNode------------------------------------ 396// Convert Integer to Double 397class ConvI2DNode : public Node { 398public: 399 ConvI2DNode( Node *in1 ) : Node(0,in1) {} 400 virtual int Opcode() const; 401 virtual const Type *bottom_type() const { return Type::DOUBLE; } 402 virtual const Type *Value( PhaseTransform *phase ) const; 403 virtual uint ideal_reg() const { return Op_RegD; } 404}; 405 406//------------------------------ConvI2FNode------------------------------------ 407// Convert Integer to Float 408class ConvI2FNode : public Node { 409public: 410 ConvI2FNode( Node *in1 ) : Node(0,in1) {} 411 virtual int Opcode() const; 412 virtual const Type *bottom_type() const { return Type::FLOAT; } 413 virtual const Type *Value( PhaseTransform *phase ) const; 414 virtual Node *Identity( PhaseTransform *phase ); 415 virtual uint ideal_reg() const { return Op_RegF; } 416}; 417 418//------------------------------ConvI2LNode------------------------------------ 419// Convert integer to long 420class ConvI2LNode : public TypeNode { 421public: 422 ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT) 423 : TypeNode(t, 2) 424 { init_req(1, in1); } 425 virtual int Opcode() const; 426 virtual const Type *Value( PhaseTransform *phase ) const; 427 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 428 virtual uint ideal_reg() const { return Op_RegL; } 429}; 430 431//------------------------------ConvL2DNode------------------------------------ 432// Convert Long to Double 433class ConvL2DNode : public Node { 434public: 435 ConvL2DNode( Node *in1 ) : Node(0,in1) {} 436 virtual int Opcode() const; 437 virtual const Type *bottom_type() const { return Type::DOUBLE; } 438 virtual const Type *Value( PhaseTransform *phase ) const; 439 virtual uint ideal_reg() const { return Op_RegD; } 440}; 441 442//------------------------------ConvL2FNode------------------------------------ 443// Convert Long to Float 444class ConvL2FNode : public Node { 445public: 446 ConvL2FNode( Node *in1 ) : Node(0,in1) {} 447 virtual int Opcode() const; 448 virtual const Type *bottom_type() const { return Type::FLOAT; } 449 virtual const Type *Value( PhaseTransform *phase ) const; 450 virtual uint ideal_reg() const { return Op_RegF; } 451}; 452 453//------------------------------ConvL2INode------------------------------------ 454// Convert long to integer 455class ConvL2INode : public Node { 456public: 457 ConvL2INode( Node *in1 ) : Node(0,in1) {} 458 virtual int Opcode() const; 459 virtual const Type *bottom_type() const { return TypeInt::INT; } 460 virtual Node *Identity( PhaseTransform *phase ); 461 virtual const Type *Value( PhaseTransform *phase ) const; 462 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 463 virtual uint ideal_reg() const { return Op_RegI; } 464}; 465 466//------------------------------CastX2PNode------------------------------------- 467// convert a machine-pointer-sized integer to a raw pointer 468class CastX2PNode : public Node { 469public: 470 CastX2PNode( Node *n ) : Node(NULL, n) {} 471 virtual int Opcode() const; 472 virtual const Type *Value( PhaseTransform *phase ) const; 473 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 474 virtual Node *Identity( PhaseTransform *phase ); 475 virtual uint ideal_reg() const { return Op_RegP; } 476 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } 477}; 478 479//------------------------------CastP2XNode------------------------------------- 480// Used in both 32-bit and 64-bit land. 481// Used for card-marks and unsafe pointer math. 482class CastP2XNode : public Node { 483public: 484 CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {} 485 virtual int Opcode() const; 486 virtual const Type *Value( PhaseTransform *phase ) const; 487 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 488 virtual Node *Identity( PhaseTransform *phase ); 489 virtual uint ideal_reg() const { return Op_RegX; } 490 virtual const Type *bottom_type() const { return TypeX_X; } 491 // Return false to keep node from moving away from an associated card mark. 492 virtual bool depends_only_on_test() const { return false; } 493}; 494 495//------------------------------MemMoveNode------------------------------------ 496// Memory to memory move. Inserted very late, after allocation. 497class MemMoveNode : public Node { 498public: 499 MemMoveNode( Node *dst, Node *src ) : Node(0,dst,src) {} 500 virtual int Opcode() const; 501}; 502 503//------------------------------ThreadLocalNode-------------------------------- 504// Ideal Node which returns the base of ThreadLocalStorage. 505class ThreadLocalNode : public Node { 506public: 507 ThreadLocalNode( ) : Node((Node*)Compile::current()->root()) {} 508 virtual int Opcode() const; 509 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM;} 510 virtual uint ideal_reg() const { return Op_RegP; } 511}; 512 513//------------------------------LoadReturnPCNode------------------------------- 514class LoadReturnPCNode: public Node { 515public: 516 LoadReturnPCNode(Node *c) : Node(c) { } 517 virtual int Opcode() const; 518 virtual uint ideal_reg() const { return Op_RegP; } 519}; 520 521 522//-----------------------------RoundFloatNode---------------------------------- 523class RoundFloatNode: public Node { 524public: 525 RoundFloatNode(Node* c, Node *in1): Node(c, in1) {} 526 virtual int Opcode() const; 527 virtual const Type *bottom_type() const { return Type::FLOAT; } 528 virtual uint ideal_reg() const { return Op_RegF; } 529 virtual Node *Identity( PhaseTransform *phase ); 530 virtual const Type *Value( PhaseTransform *phase ) const; 531}; 532 533 534//-----------------------------RoundDoubleNode--------------------------------- 535class RoundDoubleNode: public Node { 536public: 537 RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {} 538 virtual int Opcode() const; 539 virtual const Type *bottom_type() const { return Type::DOUBLE; } 540 virtual uint ideal_reg() const { return Op_RegD; } 541 virtual Node *Identity( PhaseTransform *phase ); 542 virtual const Type *Value( PhaseTransform *phase ) const; 543}; 544 545//------------------------------Opaque1Node------------------------------------ 546// A node to prevent unwanted optimizations. Allows constant folding. 547// Stops value-numbering, Ideal calls or Identity functions. 548class Opaque1Node : public Node { 549 virtual uint hash() const ; // { return NO_HASH; } 550 virtual uint cmp( const Node &n ) const; 551public: 552 Opaque1Node( Node *n ) : Node(0,n) {} 553 // Special version for the pre-loop to hold the original loop limit 554 // which is consumed by range check elimination. 555 Opaque1Node( Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {} 556 Node* original_loop_limit() { return req()==3 ? in(2) : NULL; } 557 virtual int Opcode() const; 558 virtual const Type *bottom_type() const { return TypeInt::INT; } 559 virtual Node *Identity( PhaseTransform *phase ); 560}; 561 562//------------------------------Opaque2Node------------------------------------ 563// A node to prevent unwanted optimizations. Allows constant folding. Stops 564// value-numbering, most Ideal calls or Identity functions. This Node is 565// specifically designed to prevent the pre-increment value of a loop trip 566// counter from being live out of the bottom of the loop (hence causing the 567// pre- and post-increment values both being live and thus requiring an extra 568// temp register and an extra move). If we "accidentally" optimize through 569// this kind of a Node, we'll get slightly pessimal, but correct, code. Thus 570// it's OK to be slightly sloppy on optimizations here. 571class Opaque2Node : public Node { 572 virtual uint hash() const ; // { return NO_HASH; } 573 virtual uint cmp( const Node &n ) const; 574public: 575 Opaque2Node( Node *n ) : Node(0,n) {} 576 virtual int Opcode() const; 577 virtual const Type *bottom_type() const { return TypeInt::INT; } 578}; 579 580//----------------------PartialSubtypeCheckNode-------------------------------- 581// The 2nd slow-half of a subtype check. Scan the subklass's 2ndary superklass 582// array for an instance of the superklass. Set a hidden internal cache on a 583// hit (cache is checked with exposed code in gen_subtype_check()). Return 584// not zero for a miss or zero for a hit. 585class PartialSubtypeCheckNode : public Node { 586public: 587 PartialSubtypeCheckNode(Node* c, Node* sub, Node* super) : Node(c,sub,super) {} 588 virtual int Opcode() const; 589 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } 590 virtual uint ideal_reg() const { return Op_RegP; } 591}; 592 593// 594class MoveI2FNode : public Node { 595 public: 596 MoveI2FNode( Node *value ) : Node(0,value) {} 597 virtual int Opcode() const; 598 virtual const Type *bottom_type() const { return Type::FLOAT; } 599 virtual uint ideal_reg() const { return Op_RegF; } 600 virtual const Type* Value( PhaseTransform *phase ) const; 601}; 602 603class MoveL2DNode : public Node { 604 public: 605 MoveL2DNode( Node *value ) : Node(0,value) {} 606 virtual int Opcode() const; 607 virtual const Type *bottom_type() const { return Type::DOUBLE; } 608 virtual uint ideal_reg() const { return Op_RegD; } 609 virtual const Type* Value( PhaseTransform *phase ) const; 610}; 611 612class MoveF2INode : public Node { 613 public: 614 MoveF2INode( Node *value ) : Node(0,value) {} 615 virtual int Opcode() const; 616 virtual const Type *bottom_type() const { return TypeInt::INT; } 617 virtual uint ideal_reg() const { return Op_RegI; } 618 virtual const Type* Value( PhaseTransform *phase ) const; 619}; 620 621class MoveD2LNode : public Node { 622 public: 623 MoveD2LNode( Node *value ) : Node(0,value) {} 624 virtual int Opcode() const; 625 virtual const Type *bottom_type() const { return TypeLong::LONG; } 626 virtual uint ideal_reg() const { return Op_RegL; } 627 virtual const Type* Value( PhaseTransform *phase ) const; 628}; 629