Path: blob/jdk8u272-b10-aarch32-20201026/hotspot/src/share/vm/opto/connode.hpp
83404 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; }283virtual Node *Ideal_DU_postCCP( PhaseCCP * );284};285286//------------------------------CheckCastPPNode--------------------------------287// for _checkcast, cast pointer to pointer (different type), without JOIN,288class CheckCastPPNode: public TypeNode {289public:290CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) {291init_class_id(Class_CheckCastPP);292init_req(0, c);293init_req(1, n);294}295296virtual Node *Identity( PhaseTransform *phase );297virtual const Type *Value( PhaseTransform *phase ) const;298virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);299virtual int Opcode() const;300virtual uint ideal_reg() const { return Op_RegP; }301// No longer remove CheckCast after CCP as it gives me a place to hang302// the proper address type - which is required to compute anti-deps.303//virtual Node *Ideal_DU_postCCP( PhaseCCP * );304};305306307//------------------------------EncodeNarrowPtr--------------------------------308class EncodeNarrowPtrNode : public TypeNode {309protected:310EncodeNarrowPtrNode(Node* value, const Type* type):311TypeNode(type, 2) {312init_class_id(Class_EncodeNarrowPtr);313init_req(0, NULL);314init_req(1, value);315}316public:317virtual uint ideal_reg() const { return Op_RegN; }318virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );319};320321//------------------------------EncodeP--------------------------------322// Encodes an oop pointers into its compressed form323// Takes an extra argument which is the real heap base as a long which324// may be useful for code generation in the backend.325class EncodePNode : public EncodeNarrowPtrNode {326public:327EncodePNode(Node* value, const Type* type):328EncodeNarrowPtrNode(value, type) {329init_class_id(Class_EncodeP);330}331virtual int Opcode() const;332virtual Node *Identity( PhaseTransform *phase );333virtual const Type *Value( PhaseTransform *phase ) const;334};335336//------------------------------EncodePKlass--------------------------------337// Encodes a klass pointer into its compressed form338// Takes an extra argument which is the real heap base as a long which339// may be useful for code generation in the backend.340class EncodePKlassNode : public EncodeNarrowPtrNode {341public:342EncodePKlassNode(Node* value, const Type* type):343EncodeNarrowPtrNode(value, type) {344init_class_id(Class_EncodePKlass);345}346virtual int Opcode() const;347virtual Node *Identity( PhaseTransform *phase );348virtual const Type *Value( PhaseTransform *phase ) const;349};350351//------------------------------DecodeNarrowPtr--------------------------------352class DecodeNarrowPtrNode : public TypeNode {353protected:354DecodeNarrowPtrNode(Node* value, const Type* type):355TypeNode(type, 2) {356init_class_id(Class_DecodeNarrowPtr);357init_req(0, NULL);358init_req(1, value);359}360public:361virtual uint ideal_reg() const { return Op_RegP; }362};363364//------------------------------DecodeN--------------------------------365// Converts a narrow oop into a real oop ptr.366// Takes an extra argument which is the real heap base as a long which367// may be useful for code generation in the backend.368class DecodeNNode : public DecodeNarrowPtrNode {369public:370DecodeNNode(Node* value, const Type* type):371DecodeNarrowPtrNode(value, type) {372init_class_id(Class_DecodeN);373}374virtual int Opcode() const;375virtual const Type *Value( PhaseTransform *phase ) const;376virtual Node *Identity( PhaseTransform *phase );377};378379//------------------------------DecodeNKlass--------------------------------380// Converts a narrow klass pointer into a real klass ptr.381// Takes an extra argument which is the real heap base as a long which382// may be useful for code generation in the backend.383class DecodeNKlassNode : public DecodeNarrowPtrNode {384public:385DecodeNKlassNode(Node* value, const Type* type):386DecodeNarrowPtrNode(value, type) {387init_class_id(Class_DecodeNKlass);388}389virtual int Opcode() const;390virtual const Type *Value( PhaseTransform *phase ) const;391virtual Node *Identity( PhaseTransform *phase );392};393394//------------------------------Conv2BNode-------------------------------------395// Convert int/pointer to a Boolean. Map zero to zero, all else to 1.396class Conv2BNode : public Node {397public:398Conv2BNode( Node *i ) : Node(0,i) {}399virtual int Opcode() const;400virtual const Type *bottom_type() const { return TypeInt::BOOL; }401virtual Node *Identity( PhaseTransform *phase );402virtual const Type *Value( PhaseTransform *phase ) const;403virtual uint ideal_reg() const { return Op_RegI; }404};405406// The conversions operations are all Alpha sorted. Please keep it that way!407//------------------------------ConvD2FNode------------------------------------408// Convert double to float409class ConvD2FNode : public Node {410public:411ConvD2FNode( Node *in1 ) : Node(0,in1) {}412virtual int Opcode() const;413virtual const Type *bottom_type() const { return Type::FLOAT; }414virtual const Type *Value( PhaseTransform *phase ) const;415virtual Node *Identity( PhaseTransform *phase );416virtual uint ideal_reg() const { return Op_RegF; }417};418419//------------------------------ConvD2INode------------------------------------420// Convert Double to Integer421class ConvD2INode : public Node {422public:423ConvD2INode( Node *in1 ) : Node(0,in1) {}424virtual int Opcode() const;425virtual const Type *bottom_type() const { return TypeInt::INT; }426virtual const Type *Value( PhaseTransform *phase ) const;427virtual Node *Identity( PhaseTransform *phase );428virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);429virtual uint ideal_reg() const { return Op_RegI; }430};431432//------------------------------ConvD2LNode------------------------------------433// Convert Double to Long434class ConvD2LNode : public Node {435public:436ConvD2LNode( Node *dbl ) : Node(0,dbl) {}437virtual int Opcode() const;438virtual const Type *bottom_type() const { return TypeLong::LONG; }439virtual const Type *Value( PhaseTransform *phase ) const;440virtual Node *Identity( PhaseTransform *phase );441virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);442virtual uint ideal_reg() const { return Op_RegL; }443};444445//------------------------------ConvF2DNode------------------------------------446// Convert Float to a Double.447class ConvF2DNode : public Node {448public:449ConvF2DNode( Node *in1 ) : Node(0,in1) {}450virtual int Opcode() const;451virtual const Type *bottom_type() const { return Type::DOUBLE; }452virtual const Type *Value( PhaseTransform *phase ) const;453virtual uint ideal_reg() const { return Op_RegD; }454};455456//------------------------------ConvF2INode------------------------------------457// Convert float to integer458class ConvF2INode : public Node {459public:460ConvF2INode( Node *in1 ) : Node(0,in1) {}461virtual int Opcode() const;462virtual const Type *bottom_type() const { return TypeInt::INT; }463virtual const Type *Value( PhaseTransform *phase ) const;464virtual Node *Identity( PhaseTransform *phase );465virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);466virtual uint ideal_reg() const { return Op_RegI; }467};468469//------------------------------ConvF2LNode------------------------------------470// Convert float to long471class ConvF2LNode : public Node {472public:473ConvF2LNode( Node *in1 ) : Node(0,in1) {}474virtual int Opcode() const;475virtual const Type *bottom_type() const { return TypeLong::LONG; }476virtual const Type *Value( PhaseTransform *phase ) const;477virtual Node *Identity( PhaseTransform *phase );478virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);479virtual uint ideal_reg() const { return Op_RegL; }480};481482//------------------------------ConvI2DNode------------------------------------483// Convert Integer to Double484class ConvI2DNode : public Node {485public:486ConvI2DNode( Node *in1 ) : Node(0,in1) {}487virtual int Opcode() const;488virtual const Type *bottom_type() const { return Type::DOUBLE; }489virtual const Type *Value( PhaseTransform *phase ) const;490virtual uint ideal_reg() const { return Op_RegD; }491};492493//------------------------------ConvI2FNode------------------------------------494// Convert Integer to Float495class ConvI2FNode : public Node {496public:497ConvI2FNode( Node *in1 ) : Node(0,in1) {}498virtual int Opcode() const;499virtual const Type *bottom_type() const { return Type::FLOAT; }500virtual const Type *Value( PhaseTransform *phase ) const;501virtual Node *Identity( PhaseTransform *phase );502virtual uint ideal_reg() const { return Op_RegF; }503};504505//------------------------------ConvI2LNode------------------------------------506// Convert integer to long507class ConvI2LNode : public TypeNode {508public:509ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT)510: TypeNode(t, 2)511{ init_req(1, in1); }512virtual int Opcode() const;513virtual const Type *Value( PhaseTransform *phase ) const;514virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);515virtual uint ideal_reg() const { return Op_RegL; }516};517518//------------------------------ConvL2DNode------------------------------------519// Convert Long to Double520class ConvL2DNode : public Node {521public:522ConvL2DNode( Node *in1 ) : Node(0,in1) {}523virtual int Opcode() const;524virtual const Type *bottom_type() const { return Type::DOUBLE; }525virtual const Type *Value( PhaseTransform *phase ) const;526virtual uint ideal_reg() const { return Op_RegD; }527};528529//------------------------------ConvL2FNode------------------------------------530// Convert Long to Float531class ConvL2FNode : public Node {532public:533ConvL2FNode( Node *in1 ) : Node(0,in1) {}534virtual int Opcode() const;535virtual const Type *bottom_type() const { return Type::FLOAT; }536virtual const Type *Value( PhaseTransform *phase ) const;537virtual uint ideal_reg() const { return Op_RegF; }538};539540//------------------------------ConvL2INode------------------------------------541// Convert long to integer542class ConvL2INode : public Node {543public:544ConvL2INode( Node *in1 ) : Node(0,in1) {}545virtual int Opcode() const;546virtual const Type *bottom_type() const { return TypeInt::INT; }547virtual Node *Identity( PhaseTransform *phase );548virtual const Type *Value( PhaseTransform *phase ) const;549virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);550virtual uint ideal_reg() const { return Op_RegI; }551};552553//------------------------------CastX2PNode-------------------------------------554// convert a machine-pointer-sized integer to a raw pointer555class CastX2PNode : public Node {556public:557CastX2PNode( Node *n ) : Node(NULL, n) {}558virtual int Opcode() const;559virtual const Type *Value( PhaseTransform *phase ) const;560virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);561virtual Node *Identity( PhaseTransform *phase );562virtual uint ideal_reg() const { return Op_RegP; }563virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }564};565566//------------------------------CastP2XNode-------------------------------------567// Used in both 32-bit and 64-bit land.568// Used for card-marks and unsafe pointer math.569class CastP2XNode : public Node {570public:571CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}572virtual int Opcode() const;573virtual const Type *Value( PhaseTransform *phase ) const;574virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);575virtual Node *Identity( PhaseTransform *phase );576virtual uint ideal_reg() const { return Op_RegX; }577virtual const Type *bottom_type() const { return TypeX_X; }578// Return false to keep node from moving away from an associated card mark.579virtual bool depends_only_on_test() const { return false; }580};581582//------------------------------ThreadLocalNode--------------------------------583// Ideal Node which returns the base of ThreadLocalStorage.584class ThreadLocalNode : public Node {585public:586ThreadLocalNode( ) : Node((Node*)Compile::current()->root()) {}587virtual int Opcode() const;588virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM;}589virtual uint ideal_reg() const { return Op_RegP; }590};591592//------------------------------LoadReturnPCNode-------------------------------593class LoadReturnPCNode: public Node {594public:595LoadReturnPCNode(Node *c) : Node(c) { }596virtual int Opcode() const;597virtual uint ideal_reg() const { return Op_RegP; }598};599600601//-----------------------------RoundFloatNode----------------------------------602class RoundFloatNode: public Node {603public:604RoundFloatNode(Node* c, Node *in1): Node(c, in1) {}605virtual int Opcode() const;606virtual const Type *bottom_type() const { return Type::FLOAT; }607virtual uint ideal_reg() const { return Op_RegF; }608virtual Node *Identity( PhaseTransform *phase );609virtual const Type *Value( PhaseTransform *phase ) const;610};611612613//-----------------------------RoundDoubleNode---------------------------------614class RoundDoubleNode: public Node {615public:616RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {}617virtual int Opcode() const;618virtual const Type *bottom_type() const { return Type::DOUBLE; }619virtual uint ideal_reg() const { return Op_RegD; }620virtual Node *Identity( PhaseTransform *phase );621virtual const Type *Value( PhaseTransform *phase ) const;622};623624//------------------------------Opaque1Node------------------------------------625// A node to prevent unwanted optimizations. Allows constant folding.626// Stops value-numbering, Ideal calls or Identity functions.627class Opaque1Node : public Node {628virtual uint hash() const ; // { return NO_HASH; }629virtual uint cmp( const Node &n ) const;630public:631Opaque1Node( Compile* C, Node *n ) : Node(0,n) {632// Put it on the Macro nodes list to removed during macro nodes expansion.633init_flags(Flag_is_macro);634C->add_macro_node(this);635}636// Special version for the pre-loop to hold the original loop limit637// which is consumed by range check elimination.638Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {639// Put it on the Macro nodes list to removed during macro nodes expansion.640init_flags(Flag_is_macro);641C->add_macro_node(this);642}643Node* original_loop_limit() { return req()==3 ? in(2) : NULL; }644virtual int Opcode() const;645virtual const Type *bottom_type() const { return TypeInt::INT; }646virtual Node *Identity( PhaseTransform *phase );647};648649//------------------------------Opaque2Node------------------------------------650// A node to prevent unwanted optimizations. Allows constant folding. Stops651// value-numbering, most Ideal calls or Identity functions. This Node is652// specifically designed to prevent the pre-increment value of a loop trip653// counter from being live out of the bottom of the loop (hence causing the654// pre- and post-increment values both being live and thus requiring an extra655// temp register and an extra move). If we "accidentally" optimize through656// this kind of a Node, we'll get slightly pessimal, but correct, code. Thus657// it's OK to be slightly sloppy on optimizations here.658class Opaque2Node : public Node {659virtual uint hash() const ; // { return NO_HASH; }660virtual uint cmp( const Node &n ) const;661public:662Opaque2Node( Compile* C, Node *n ) : Node(0,n) {663// Put it on the Macro nodes list to removed during macro nodes expansion.664init_flags(Flag_is_macro);665C->add_macro_node(this);666}667virtual int Opcode() const;668virtual const Type *bottom_type() const { return TypeInt::INT; }669};670671//------------------------------Opaque3Node------------------------------------672// A node to prevent unwanted optimizations. Will be optimized only during673// macro nodes expansion.674class Opaque3Node : public Opaque2Node {675int _opt; // what optimization it was used for676public:677enum { RTM_OPT };678Opaque3Node(Compile* C, Node *n, int opt) : Opaque2Node(C, n), _opt(opt) {}679virtual int Opcode() const;680bool rtm_opt() const { return (_opt == RTM_OPT); }681};682683//------------------------------ProfileBooleanNode-------------------------------684// A node represents value profile for a boolean during parsing.685// Once parsing is over, the node goes away (during IGVN).686// It is used to override branch frequencies from MDO (see has_injected_profile in parse2.cpp).687class ProfileBooleanNode : public Node {688uint _false_cnt;689uint _true_cnt;690bool _consumed;691bool _delay_removal;692virtual uint hash() const ; // { return NO_HASH; }693virtual uint cmp( const Node &n ) const;694public:695ProfileBooleanNode(Node *n, uint false_cnt, uint true_cnt) : Node(0, n),696_false_cnt(false_cnt), _true_cnt(true_cnt), _delay_removal(true), _consumed(false) {}697698uint false_count() const { return _false_cnt; }699uint true_count() const { return _true_cnt; }700701void consume() { _consumed = true; }702703virtual int Opcode() const;704virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);705virtual Node *Identity(PhaseTransform *phase);706virtual const Type *bottom_type() const { return TypeInt::BOOL; }707};708709//----------------------PartialSubtypeCheckNode--------------------------------710// The 2nd slow-half of a subtype check. Scan the subklass's 2ndary superklass711// array for an instance of the superklass. Set a hidden internal cache on a712// hit (cache is checked with exposed code in gen_subtype_check()). Return713// not zero for a miss or zero for a hit.714class PartialSubtypeCheckNode : public Node {715public:716PartialSubtypeCheckNode(Node* c, Node* sub, Node* super) : Node(c,sub,super) {}717virtual int Opcode() const;718virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }719virtual uint ideal_reg() const { return Op_RegP; }720};721722//723class MoveI2FNode : public Node {724public:725MoveI2FNode( Node *value ) : Node(0,value) {}726virtual int Opcode() const;727virtual const Type *bottom_type() const { return Type::FLOAT; }728virtual uint ideal_reg() const { return Op_RegF; }729virtual const Type* Value( PhaseTransform *phase ) const;730};731732class MoveL2DNode : public Node {733public:734MoveL2DNode( Node *value ) : Node(0,value) {}735virtual int Opcode() const;736virtual const Type *bottom_type() const { return Type::DOUBLE; }737virtual uint ideal_reg() const { return Op_RegD; }738virtual const Type* Value( PhaseTransform *phase ) const;739};740741class MoveF2INode : public Node {742public:743MoveF2INode( Node *value ) : Node(0,value) {}744virtual int Opcode() const;745virtual const Type *bottom_type() const { return TypeInt::INT; }746virtual uint ideal_reg() const { return Op_RegI; }747virtual const Type* Value( PhaseTransform *phase ) const;748};749750class MoveD2LNode : public Node {751public:752MoveD2LNode( Node *value ) : Node(0,value) {}753virtual int Opcode() const;754virtual const Type *bottom_type() const { return TypeLong::LONG; }755virtual uint ideal_reg() const { return Op_RegL; }756virtual const Type* Value( PhaseTransform *phase ) const;757};758759//---------- CountBitsNode -----------------------------------------------------760class CountBitsNode : public Node {761public:762CountBitsNode(Node* in1) : Node(0, in1) {}763const Type* bottom_type() const { return TypeInt::INT; }764virtual uint ideal_reg() const { return Op_RegI; }765};766767//---------- CountLeadingZerosINode --------------------------------------------768// Count leading zeros (0-bit count starting from MSB) of an integer.769class CountLeadingZerosINode : public CountBitsNode {770public:771CountLeadingZerosINode(Node* in1) : CountBitsNode(in1) {}772virtual int Opcode() const;773virtual const Type* Value(PhaseTransform* phase) const;774};775776//---------- CountLeadingZerosLNode --------------------------------------------777// Count leading zeros (0-bit count starting from MSB) of a long.778class CountLeadingZerosLNode : public CountBitsNode {779public:780CountLeadingZerosLNode(Node* in1) : CountBitsNode(in1) {}781virtual int Opcode() const;782virtual const Type* Value(PhaseTransform* phase) const;783};784785//---------- CountTrailingZerosINode -------------------------------------------786// Count trailing zeros (0-bit count starting from LSB) of an integer.787class CountTrailingZerosINode : public CountBitsNode {788public:789CountTrailingZerosINode(Node* in1) : CountBitsNode(in1) {}790virtual int Opcode() const;791virtual const Type* Value(PhaseTransform* phase) const;792};793794//---------- CountTrailingZerosLNode -------------------------------------------795// Count trailing zeros (0-bit count starting from LSB) of a long.796class CountTrailingZerosLNode : public CountBitsNode {797public:798CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {}799virtual int Opcode() const;800virtual const Type* Value(PhaseTransform* phase) const;801};802803//---------- PopCountINode -----------------------------------------------------804// Population count (bit count) of an integer.805class PopCountINode : public CountBitsNode {806public:807PopCountINode(Node* in1) : CountBitsNode(in1) {}808virtual int Opcode() const;809};810811//---------- PopCountLNode -----------------------------------------------------812// Population count (bit count) of a long.813class PopCountLNode : public CountBitsNode {814public:815PopCountLNode(Node* in1) : CountBitsNode(in1) {}816virtual int Opcode() const;817};818819#endif // SHARE_VM_OPTO_CONNODE_HPP820821822