Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/opto/connode.hpp
32285 views
/*1* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_VM_OPTO_CONNODE_HPP25#define SHARE_VM_OPTO_CONNODE_HPP2627#include "opto/node.hpp"28#include "opto/opcodes.hpp"29#include "opto/type.hpp"3031class PhaseTransform;32class MachNode;3334//------------------------------ConNode----------------------------------------35// Simple constants36class ConNode : public TypeNode {37public:38ConNode( const Type *t ) : TypeNode(t->remove_speculative(),1) {39init_req(0, (Node*)Compile::current()->root());40init_flags(Flag_is_Con);41}42virtual int Opcode() const;43virtual uint hash() const;44virtual const RegMask &out_RegMask() const { return RegMask::Empty; }45virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; }4647// Polymorphic factory method:48static ConNode* make( Compile* C, const Type *t );49};5051//------------------------------ConINode---------------------------------------52// Simple integer constants53class ConINode : public ConNode {54public:55ConINode( const TypeInt *t ) : ConNode(t) {}56virtual int Opcode() const;5758// Factory method:59static ConINode* make( Compile* C, int con ) {60return new (C) ConINode( TypeInt::make(con) );61}6263};6465//------------------------------ConPNode---------------------------------------66// Simple pointer constants67class ConPNode : public ConNode {68public:69ConPNode( const TypePtr *t ) : ConNode(t) {}70virtual int Opcode() const;7172// Factory methods:73static ConPNode* make( Compile *C ,address con ) {74if (con == NULL)75return new (C) ConPNode( TypePtr::NULL_PTR ) ;76else77return new (C) ConPNode( TypeRawPtr::make(con) );78}79};808182//------------------------------ConNNode--------------------------------------83// Simple narrow oop constants84class ConNNode : public ConNode {85public:86ConNNode( const TypeNarrowOop *t ) : ConNode(t) {}87virtual int Opcode() const;88};8990//------------------------------ConNKlassNode---------------------------------91// Simple narrow klass constants92class ConNKlassNode : public ConNode {93public:94ConNKlassNode( const TypeNarrowKlass *t ) : ConNode(t) {}95virtual int Opcode() const;96};979899//------------------------------ConLNode---------------------------------------100// Simple long constants101class ConLNode : public ConNode {102public:103ConLNode( const TypeLong *t ) : ConNode(t) {}104virtual int Opcode() const;105106// Factory method:107static ConLNode* make( Compile *C ,jlong con ) {108return new (C) ConLNode( TypeLong::make(con) );109}110111};112113//------------------------------ConFNode---------------------------------------114// Simple float constants115class ConFNode : public ConNode {116public:117ConFNode( const TypeF *t ) : ConNode(t) {}118virtual int Opcode() const;119120// Factory method:121static ConFNode* make( Compile *C, float con ) {122return new (C) ConFNode( TypeF::make(con) );123}124125};126127//------------------------------ConDNode---------------------------------------128// Simple double constants129class ConDNode : public ConNode {130public:131ConDNode( const TypeD *t ) : ConNode(t) {}132virtual int Opcode() const;133134// Factory method:135static ConDNode* make( Compile *C, double con ) {136return new (C) ConDNode( TypeD::make(con) );137}138139};140141//------------------------------BinaryNode-------------------------------------142// Place holder for the 2 conditional inputs to a CMove. CMove needs 4143// inputs: the Bool (for the lt/gt/eq/ne bits), the flags (result of some144// compare), and the 2 values to select between. The Matcher requires a145// binary tree so we break it down like this:146// (CMove (Binary bol cmp) (Binary src1 src2))147class BinaryNode : public Node {148public:149BinaryNode( Node *n1, Node *n2 ) : Node(0,n1,n2) { }150virtual int Opcode() const;151virtual uint ideal_reg() const { return 0; }152};153154//------------------------------CMoveNode--------------------------------------155// Conditional move156class CMoveNode : public TypeNode {157public:158enum { Control, // When is it safe to do this cmove?159Condition, // Condition controlling the cmove160IfFalse, // Value if condition is false161IfTrue }; // Value if condition is true162CMoveNode( Node *bol, Node *left, Node *right, const Type *t ) : TypeNode(t,4)163{164init_class_id(Class_CMove);165// all inputs are nullified in Node::Node(int)166// init_req(Control,NULL);167init_req(Condition,bol);168init_req(IfFalse,left);169init_req(IfTrue,right);170}171virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);172virtual const Type *Value( PhaseTransform *phase ) const;173virtual Node *Identity( PhaseTransform *phase );174static CMoveNode *make( Compile *C, Node *c, Node *bol, Node *left, Node *right, const Type *t );175// Helper function to spot cmove graph shapes176static Node *is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f, BoolNode *b );177};178179//------------------------------CMoveDNode-------------------------------------180class CMoveDNode : public CMoveNode {181public:182CMoveDNode( Node *bol, Node *left, Node *right, const Type* t) : CMoveNode(bol,left,right,t){}183virtual int Opcode() const;184virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);185};186187//------------------------------CMoveFNode-------------------------------------188class CMoveFNode : public CMoveNode {189public:190CMoveFNode( Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) {}191virtual int Opcode() const;192virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);193};194195//------------------------------CMoveINode-------------------------------------196class CMoveINode : public CMoveNode {197public:198CMoveINode( Node *bol, Node *left, Node *right, const TypeInt *ti ) : CMoveNode(bol,left,right,ti){}199virtual int Opcode() const;200virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);201};202203//------------------------------CMoveLNode-------------------------------------204class CMoveLNode : public CMoveNode {205public:206CMoveLNode(Node *bol, Node *left, Node *right, const TypeLong *tl ) : CMoveNode(bol,left,right,tl){}207virtual int Opcode() const;208};209210//------------------------------CMovePNode-------------------------------------211class CMovePNode : public CMoveNode {212public:213CMovePNode( Node *c, Node *bol, Node *left, Node *right, const TypePtr* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); }214virtual int Opcode() const;215};216217//------------------------------CMoveNNode-------------------------------------218class CMoveNNode : public CMoveNode {219public:220CMoveNNode( Node *c, Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); }221virtual int Opcode() const;222};223224//------------------------------ConstraintCastNode-----------------------------225// cast to a different range226class ConstraintCastNode: public TypeNode {227public:228ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) {229init_class_id(Class_ConstraintCast);230init_req(1, n);231}232virtual Node *Identity( PhaseTransform *phase );233virtual const Type *Value( PhaseTransform *phase ) const;234virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);235virtual int Opcode() const;236virtual uint ideal_reg() const = 0;237virtual Node *Ideal_DU_postCCP( PhaseCCP * );238};239240//------------------------------CastIINode-------------------------------------241// cast integer to integer (different range)242class CastIINode: public ConstraintCastNode {243private:244// Can this node be removed post CCP or does it carry a required dependency?245const bool _carry_dependency;246// Is this node dependent on a range check?247const bool _range_check_dependency;248249protected:250virtual uint cmp( const Node &n ) const;251virtual uint size_of() const;252253public:254CastIINode(Node *n, const Type *t, bool carry_dependency = false, bool range_check_dependency = false)255: ConstraintCastNode(n,t), _carry_dependency(carry_dependency), _range_check_dependency(range_check_dependency) {256init_class_id(Class_CastII);257}258virtual int Opcode() const;259virtual uint ideal_reg() const { return Op_RegI; }260virtual Node *Identity( PhaseTransform *phase );261virtual const Type *Value( PhaseTransform *phase ) const;262virtual Node *Ideal_DU_postCCP( PhaseCCP * );263const bool has_range_check() {264#ifdef _LP64265return _range_check_dependency;266#else267assert(!_range_check_dependency, "Should not have range check dependency");268return false;269#endif270}271#ifndef PRODUCT272virtual void dump_spec(outputStream *st) const;273#endif274};275276//------------------------------CastPPNode-------------------------------------277// cast pointer to pointer (different type)278class CastPPNode: public ConstraintCastNode {279public:280CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {}281virtual int Opcode() const;282virtual uint ideal_reg() const { return Op_RegP; }283};284285//------------------------------CheckCastPPNode--------------------------------286// for _checkcast, cast pointer to pointer (different type), without JOIN,287class CheckCastPPNode: public TypeNode {288public:289CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) {290init_class_id(Class_CheckCastPP);291init_req(0, c);292init_req(1, n);293}294295virtual Node *Identity( PhaseTransform *phase );296virtual const Type *Value( PhaseTransform *phase ) const;297virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);298virtual int Opcode() const;299virtual uint ideal_reg() const { return Op_RegP; }300};301302303//------------------------------EncodeNarrowPtr--------------------------------304class EncodeNarrowPtrNode : public TypeNode {305protected:306EncodeNarrowPtrNode(Node* value, const Type* type):307TypeNode(type, 2) {308init_class_id(Class_EncodeNarrowPtr);309init_req(0, NULL);310init_req(1, value);311}312public:313virtual uint ideal_reg() const { return Op_RegN; }314};315316//------------------------------EncodeP--------------------------------317// Encodes an oop pointers into its compressed form318// Takes an extra argument which is the real heap base as a long which319// may be useful for code generation in the backend.320class EncodePNode : public EncodeNarrowPtrNode {321public:322EncodePNode(Node* value, const Type* type):323EncodeNarrowPtrNode(value, type) {324init_class_id(Class_EncodeP);325}326virtual int Opcode() const;327virtual Node *Identity( PhaseTransform *phase );328virtual const Type *Value( PhaseTransform *phase ) const;329};330331//------------------------------EncodePKlass--------------------------------332// Encodes a klass pointer into its compressed form333// Takes an extra argument which is the real heap base as a long which334// may be useful for code generation in the backend.335class EncodePKlassNode : public EncodeNarrowPtrNode {336public:337EncodePKlassNode(Node* value, const Type* type):338EncodeNarrowPtrNode(value, type) {339init_class_id(Class_EncodePKlass);340}341virtual int Opcode() const;342virtual Node *Identity( PhaseTransform *phase );343virtual const Type *Value( PhaseTransform *phase ) const;344};345346//------------------------------DecodeNarrowPtr--------------------------------347class DecodeNarrowPtrNode : public TypeNode {348protected:349DecodeNarrowPtrNode(Node* value, const Type* type):350TypeNode(type, 2) {351init_class_id(Class_DecodeNarrowPtr);352init_req(0, NULL);353init_req(1, value);354}355public:356virtual uint ideal_reg() const { return Op_RegP; }357};358359//------------------------------DecodeN--------------------------------360// Converts a narrow oop into a real oop ptr.361// Takes an extra argument which is the real heap base as a long which362// may be useful for code generation in the backend.363class DecodeNNode : public DecodeNarrowPtrNode {364public:365DecodeNNode(Node* value, const Type* type):366DecodeNarrowPtrNode(value, type) {367init_class_id(Class_DecodeN);368}369virtual int Opcode() const;370virtual const Type *Value( PhaseTransform *phase ) const;371virtual Node *Identity( PhaseTransform *phase );372};373374//------------------------------DecodeNKlass--------------------------------375// Converts a narrow klass pointer into a real klass ptr.376// Takes an extra argument which is the real heap base as a long which377// may be useful for code generation in the backend.378class DecodeNKlassNode : public DecodeNarrowPtrNode {379public:380DecodeNKlassNode(Node* value, const Type* type):381DecodeNarrowPtrNode(value, type) {382init_class_id(Class_DecodeNKlass);383}384virtual int Opcode() const;385virtual const Type *Value( PhaseTransform *phase ) const;386virtual Node *Identity( PhaseTransform *phase );387};388389//------------------------------Conv2BNode-------------------------------------390// Convert int/pointer to a Boolean. Map zero to zero, all else to 1.391class Conv2BNode : public Node {392public:393Conv2BNode( Node *i ) : Node(0,i) {}394virtual int Opcode() const;395virtual const Type *bottom_type() const { return TypeInt::BOOL; }396virtual Node *Identity( PhaseTransform *phase );397virtual const Type *Value( PhaseTransform *phase ) const;398virtual uint ideal_reg() const { return Op_RegI; }399};400401// The conversions operations are all Alpha sorted. Please keep it that way!402//------------------------------ConvD2FNode------------------------------------403// Convert double to float404class ConvD2FNode : public Node {405public:406ConvD2FNode( Node *in1 ) : Node(0,in1) {}407virtual int Opcode() const;408virtual const Type *bottom_type() const { return Type::FLOAT; }409virtual const Type *Value( PhaseTransform *phase ) const;410virtual Node *Identity( PhaseTransform *phase );411virtual uint ideal_reg() const { return Op_RegF; }412};413414//------------------------------ConvD2INode------------------------------------415// Convert Double to Integer416class ConvD2INode : public Node {417public:418ConvD2INode( Node *in1 ) : Node(0,in1) {}419virtual int Opcode() const;420virtual const Type *bottom_type() const { return TypeInt::INT; }421virtual const Type *Value( PhaseTransform *phase ) const;422virtual Node *Identity( PhaseTransform *phase );423virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);424virtual uint ideal_reg() const { return Op_RegI; }425};426427//------------------------------ConvD2LNode------------------------------------428// Convert Double to Long429class ConvD2LNode : public Node {430public:431ConvD2LNode( Node *dbl ) : Node(0,dbl) {}432virtual int Opcode() const;433virtual const Type *bottom_type() const { return TypeLong::LONG; }434virtual const Type *Value( PhaseTransform *phase ) const;435virtual Node *Identity( PhaseTransform *phase );436virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);437virtual uint ideal_reg() const { return Op_RegL; }438};439440//------------------------------ConvF2DNode------------------------------------441// Convert Float to a Double.442class ConvF2DNode : public Node {443public:444ConvF2DNode( Node *in1 ) : Node(0,in1) {}445virtual int Opcode() const;446virtual const Type *bottom_type() const { return Type::DOUBLE; }447virtual const Type *Value( PhaseTransform *phase ) const;448virtual uint ideal_reg() const { return Op_RegD; }449};450451//------------------------------ConvF2INode------------------------------------452// Convert float to integer453class ConvF2INode : public Node {454public:455ConvF2INode( Node *in1 ) : Node(0,in1) {}456virtual int Opcode() const;457virtual const Type *bottom_type() const { return TypeInt::INT; }458virtual const Type *Value( PhaseTransform *phase ) const;459virtual Node *Identity( PhaseTransform *phase );460virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);461virtual uint ideal_reg() const { return Op_RegI; }462};463464//------------------------------ConvF2LNode------------------------------------465// Convert float to long466class ConvF2LNode : public Node {467public:468ConvF2LNode( Node *in1 ) : Node(0,in1) {}469virtual int Opcode() const;470virtual const Type *bottom_type() const { return TypeLong::LONG; }471virtual const Type *Value( PhaseTransform *phase ) const;472virtual Node *Identity( PhaseTransform *phase );473virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);474virtual uint ideal_reg() const { return Op_RegL; }475};476477//------------------------------ConvI2DNode------------------------------------478// Convert Integer to Double479class ConvI2DNode : public Node {480public:481ConvI2DNode( Node *in1 ) : Node(0,in1) {}482virtual int Opcode() const;483virtual const Type *bottom_type() const { return Type::DOUBLE; }484virtual const Type *Value( PhaseTransform *phase ) const;485virtual uint ideal_reg() const { return Op_RegD; }486};487488//------------------------------ConvI2FNode------------------------------------489// Convert Integer to Float490class ConvI2FNode : public Node {491public:492ConvI2FNode( Node *in1 ) : Node(0,in1) {}493virtual int Opcode() const;494virtual const Type *bottom_type() const { return Type::FLOAT; }495virtual const Type *Value( PhaseTransform *phase ) const;496virtual Node *Identity( PhaseTransform *phase );497virtual uint ideal_reg() const { return Op_RegF; }498};499500//------------------------------ConvI2LNode------------------------------------501// Convert integer to long502class ConvI2LNode : public TypeNode {503public:504ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT)505: TypeNode(t, 2)506{ init_req(1, in1); }507virtual int Opcode() const;508virtual const Type *Value( PhaseTransform *phase ) const;509virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);510virtual uint ideal_reg() const { return Op_RegL; }511};512513//------------------------------ConvL2DNode------------------------------------514// Convert Long to Double515class ConvL2DNode : public Node {516public:517ConvL2DNode( Node *in1 ) : Node(0,in1) {}518virtual int Opcode() const;519virtual const Type *bottom_type() const { return Type::DOUBLE; }520virtual const Type *Value( PhaseTransform *phase ) const;521virtual uint ideal_reg() const { return Op_RegD; }522};523524//------------------------------ConvL2FNode------------------------------------525// Convert Long to Float526class ConvL2FNode : public Node {527public:528ConvL2FNode( Node *in1 ) : Node(0,in1) {}529virtual int Opcode() const;530virtual const Type *bottom_type() const { return Type::FLOAT; }531virtual const Type *Value( PhaseTransform *phase ) const;532virtual uint ideal_reg() const { return Op_RegF; }533};534535//------------------------------ConvL2INode------------------------------------536// Convert long to integer537class ConvL2INode : public Node {538public:539ConvL2INode( Node *in1 ) : Node(0,in1) {}540virtual int Opcode() const;541virtual const Type *bottom_type() const { return TypeInt::INT; }542virtual Node *Identity( PhaseTransform *phase );543virtual const Type *Value( PhaseTransform *phase ) const;544virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);545virtual uint ideal_reg() const { return Op_RegI; }546};547548//------------------------------CastX2PNode-------------------------------------549// convert a machine-pointer-sized integer to a raw pointer550class CastX2PNode : public Node {551public:552CastX2PNode( Node *n ) : Node(NULL, n) {}553virtual int Opcode() const;554virtual const Type *Value( PhaseTransform *phase ) const;555virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);556virtual Node *Identity( PhaseTransform *phase );557virtual uint ideal_reg() const { return Op_RegP; }558virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }559};560561//------------------------------CastP2XNode-------------------------------------562// Used in both 32-bit and 64-bit land.563// Used for card-marks and unsafe pointer math.564class CastP2XNode : public Node {565public:566CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}567virtual int Opcode() const;568virtual const Type *Value( PhaseTransform *phase ) const;569virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);570virtual Node *Identity( PhaseTransform *phase );571virtual uint ideal_reg() const { return Op_RegX; }572virtual const Type *bottom_type() const { return TypeX_X; }573// Return false to keep node from moving away from an associated card mark.574virtual bool depends_only_on_test() const { return false; }575};576577//------------------------------ThreadLocalNode--------------------------------578// Ideal Node which returns the base of ThreadLocalStorage.579class ThreadLocalNode : public Node {580public:581ThreadLocalNode( ) : Node((Node*)Compile::current()->root()) {}582virtual int Opcode() const;583virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM;}584virtual uint ideal_reg() const { return Op_RegP; }585};586587//------------------------------LoadReturnPCNode-------------------------------588class LoadReturnPCNode: public Node {589public:590LoadReturnPCNode(Node *c) : Node(c) { }591virtual int Opcode() const;592virtual uint ideal_reg() const { return Op_RegP; }593};594595596//-----------------------------RoundFloatNode----------------------------------597class RoundFloatNode: public Node {598public:599RoundFloatNode(Node* c, Node *in1): Node(c, in1) {}600virtual int Opcode() const;601virtual const Type *bottom_type() const { return Type::FLOAT; }602virtual uint ideal_reg() const { return Op_RegF; }603virtual Node *Identity( PhaseTransform *phase );604virtual const Type *Value( PhaseTransform *phase ) const;605};606607608//-----------------------------RoundDoubleNode---------------------------------609class RoundDoubleNode: public Node {610public:611RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {}612virtual int Opcode() const;613virtual const Type *bottom_type() const { return Type::DOUBLE; }614virtual uint ideal_reg() const { return Op_RegD; }615virtual Node *Identity( PhaseTransform *phase );616virtual const Type *Value( PhaseTransform *phase ) const;617};618619//------------------------------Opaque1Node------------------------------------620// A node to prevent unwanted optimizations. Allows constant folding.621// Stops value-numbering, Ideal calls or Identity functions.622class Opaque1Node : public Node {623virtual uint hash() const ; // { return NO_HASH; }624virtual uint cmp( const Node &n ) const;625public:626Opaque1Node( Compile* C, Node *n ) : Node(0,n) {627// Put it on the Macro nodes list to removed during macro nodes expansion.628init_flags(Flag_is_macro);629C->add_macro_node(this);630}631// Special version for the pre-loop to hold the original loop limit632// which is consumed by range check elimination.633Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {634// Put it on the Macro nodes list to removed during macro nodes expansion.635init_flags(Flag_is_macro);636C->add_macro_node(this);637}638Node* original_loop_limit() { return req()==3 ? in(2) : NULL; }639virtual int Opcode() const;640virtual const Type *bottom_type() const { return TypeInt::INT; }641virtual Node *Identity( PhaseTransform *phase );642};643644//------------------------------Opaque2Node------------------------------------645// A node to prevent unwanted optimizations. Allows constant folding. Stops646// value-numbering, most Ideal calls or Identity functions. This Node is647// specifically designed to prevent the pre-increment value of a loop trip648// counter from being live out of the bottom of the loop (hence causing the649// pre- and post-increment values both being live and thus requiring an extra650// temp register and an extra move). If we "accidentally" optimize through651// this kind of a Node, we'll get slightly pessimal, but correct, code. Thus652// it's OK to be slightly sloppy on optimizations here.653class Opaque2Node : public Node {654virtual uint hash() const ; // { return NO_HASH; }655virtual uint cmp( const Node &n ) const;656public:657Opaque2Node( Compile* C, Node *n ) : Node(0,n) {658// Put it on the Macro nodes list to removed during macro nodes expansion.659init_flags(Flag_is_macro);660C->add_macro_node(this);661}662virtual int Opcode() const;663virtual const Type *bottom_type() const { return TypeInt::INT; }664};665666//------------------------------Opaque3Node------------------------------------667// A node to prevent unwanted optimizations. Will be optimized only during668// macro nodes expansion.669class Opaque3Node : public Opaque2Node {670int _opt; // what optimization it was used for671public:672enum { RTM_OPT };673Opaque3Node(Compile* C, Node *n, int opt) : Opaque2Node(C, n), _opt(opt) {}674virtual int Opcode() const;675bool rtm_opt() const { return (_opt == RTM_OPT); }676};677678//------------------------------ProfileBooleanNode-------------------------------679// A node represents value profile for a boolean during parsing.680// Once parsing is over, the node goes away (during IGVN).681// It is used to override branch frequencies from MDO (see has_injected_profile in parse2.cpp).682class ProfileBooleanNode : public Node {683uint _false_cnt;684uint _true_cnt;685bool _consumed;686bool _delay_removal;687virtual uint hash() const ; // { return NO_HASH; }688virtual uint cmp( const Node &n ) const;689public:690ProfileBooleanNode(Node *n, uint false_cnt, uint true_cnt) : Node(0, n),691_false_cnt(false_cnt), _true_cnt(true_cnt), _delay_removal(true), _consumed(false) {}692693uint false_count() const { return _false_cnt; }694uint true_count() const { return _true_cnt; }695696void consume() { _consumed = true; }697698virtual int Opcode() const;699virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);700virtual Node *Identity(PhaseTransform *phase);701virtual const Type *bottom_type() const { return TypeInt::BOOL; }702};703704//----------------------PartialSubtypeCheckNode--------------------------------705// The 2nd slow-half of a subtype check. Scan the subklass's 2ndary superklass706// array for an instance of the superklass. Set a hidden internal cache on a707// hit (cache is checked with exposed code in gen_subtype_check()). Return708// not zero for a miss or zero for a hit.709class PartialSubtypeCheckNode : public Node {710public:711PartialSubtypeCheckNode(Node* c, Node* sub, Node* super) : Node(c,sub,super) {}712virtual int Opcode() const;713virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }714virtual uint ideal_reg() const { return Op_RegP; }715};716717//718class MoveI2FNode : public Node {719public:720MoveI2FNode( Node *value ) : Node(0,value) {}721virtual int Opcode() const;722virtual const Type *bottom_type() const { return Type::FLOAT; }723virtual uint ideal_reg() const { return Op_RegF; }724virtual const Type* Value( PhaseTransform *phase ) const;725};726727class MoveL2DNode : public Node {728public:729MoveL2DNode( Node *value ) : Node(0,value) {}730virtual int Opcode() const;731virtual const Type *bottom_type() const { return Type::DOUBLE; }732virtual uint ideal_reg() const { return Op_RegD; }733virtual const Type* Value( PhaseTransform *phase ) const;734};735736class MoveF2INode : public Node {737public:738MoveF2INode( Node *value ) : Node(0,value) {}739virtual int Opcode() const;740virtual const Type *bottom_type() const { return TypeInt::INT; }741virtual uint ideal_reg() const { return Op_RegI; }742virtual const Type* Value( PhaseTransform *phase ) const;743};744745class MoveD2LNode : public Node {746public:747MoveD2LNode( Node *value ) : Node(0,value) {}748virtual int Opcode() const;749virtual const Type *bottom_type() const { return TypeLong::LONG; }750virtual uint ideal_reg() const { return Op_RegL; }751virtual const Type* Value( PhaseTransform *phase ) const;752};753754//---------- CountBitsNode -----------------------------------------------------755class CountBitsNode : public Node {756public:757CountBitsNode(Node* in1) : Node(0, in1) {}758const Type* bottom_type() const { return TypeInt::INT; }759virtual uint ideal_reg() const { return Op_RegI; }760};761762//---------- CountLeadingZerosINode --------------------------------------------763// Count leading zeros (0-bit count starting from MSB) of an integer.764class CountLeadingZerosINode : public CountBitsNode {765public:766CountLeadingZerosINode(Node* in1) : CountBitsNode(in1) {}767virtual int Opcode() const;768virtual const Type* Value(PhaseTransform* phase) const;769};770771//---------- CountLeadingZerosLNode --------------------------------------------772// Count leading zeros (0-bit count starting from MSB) of a long.773class CountLeadingZerosLNode : public CountBitsNode {774public:775CountLeadingZerosLNode(Node* in1) : CountBitsNode(in1) {}776virtual int Opcode() const;777virtual const Type* Value(PhaseTransform* phase) const;778};779780//---------- CountTrailingZerosINode -------------------------------------------781// Count trailing zeros (0-bit count starting from LSB) of an integer.782class CountTrailingZerosINode : public CountBitsNode {783public:784CountTrailingZerosINode(Node* in1) : CountBitsNode(in1) {}785virtual int Opcode() const;786virtual const Type* Value(PhaseTransform* phase) const;787};788789//---------- CountTrailingZerosLNode -------------------------------------------790// Count trailing zeros (0-bit count starting from LSB) of a long.791class CountTrailingZerosLNode : public CountBitsNode {792public:793CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {}794virtual int Opcode() const;795virtual const Type* Value(PhaseTransform* phase) const;796};797798//---------- PopCountINode -----------------------------------------------------799// Population count (bit count) of an integer.800class PopCountINode : public CountBitsNode {801public:802PopCountINode(Node* in1) : CountBitsNode(in1) {}803virtual int Opcode() const;804};805806//---------- PopCountLNode -----------------------------------------------------807// Population count (bit count) of a long.808class PopCountLNode : public CountBitsNode {809public:810PopCountLNode(Node* in1) : CountBitsNode(in1) {}811virtual int Opcode() const;812};813814#endif // SHARE_VM_OPTO_CONNODE_HPP815816817