< prev index next >

src/hotspot/share/opto/node.hpp

Print this page




 135 class PhaseValues;
 136 class PhiNode;
 137 class Pipeline;
 138 class ProjNode;
 139 class RangeCheckNode;
 140 class RegMask;
 141 class RegionNode;
 142 class RootNode;
 143 class SafePointNode;
 144 class SafePointScalarObjectNode;
 145 class StartNode;
 146 class State;
 147 class StoreNode;
 148 class SubNode;
 149 class SubTypeCheckNode;
 150 class Type;
 151 class TypeNode;
 152 class UnlockNode;
 153 class VectorNode;
 154 class LoadVectorNode;

 155 class StoreVectorNode;


 156 class VectorSet;
 157 typedef void (*NFunc)(Node&,void*);
 158 extern "C" {
 159   typedef int (*C_sort_func_t)(const void *, const void *);
 160 }
 161 
 162 // The type of all node counts and indexes.
 163 // It must hold at least 16 bits, but must also be fast to load and store.
 164 // This type, if less than 32 bits, could limit the number of possible nodes.
 165 // (To make this type platform-specific, move to globalDefinitions_xxx.hpp.)
 166 typedef unsigned int node_idx_t;
 167 
 168 
 169 #ifndef OPTO_DU_ITERATOR_ASSERT
 170 #ifdef ASSERT
 171 #define OPTO_DU_ITERATOR_ASSERT 1
 172 #else
 173 #define OPTO_DU_ITERATOR_ASSERT 0
 174 #endif
 175 #endif //OPTO_DU_ITERATOR_ASSERT


 672       DEFINE_CLASS_ID(SafePointScalarObject, Type, 4)
 673       DEFINE_CLASS_ID(DecodeNarrowPtr, Type, 5)
 674         DEFINE_CLASS_ID(DecodeN, DecodeNarrowPtr, 0)
 675         DEFINE_CLASS_ID(DecodeNKlass, DecodeNarrowPtr, 1)
 676       DEFINE_CLASS_ID(EncodeNarrowPtr, Type, 6)
 677         DEFINE_CLASS_ID(EncodeP, EncodeNarrowPtr, 0)
 678         DEFINE_CLASS_ID(EncodePKlass, EncodeNarrowPtr, 1)
 679 
 680     DEFINE_CLASS_ID(Proj,  Node, 3)
 681       DEFINE_CLASS_ID(CatchProj, Proj, 0)
 682       DEFINE_CLASS_ID(JumpProj,  Proj, 1)
 683       DEFINE_CLASS_ID(IfProj,    Proj, 2)
 684         DEFINE_CLASS_ID(IfTrue,    IfProj, 0)
 685         DEFINE_CLASS_ID(IfFalse,   IfProj, 1)
 686       DEFINE_CLASS_ID(Parm,      Proj, 4)
 687       DEFINE_CLASS_ID(MachProj,  Proj, 5)
 688 
 689     DEFINE_CLASS_ID(Mem,   Node, 4)
 690       DEFINE_CLASS_ID(Load,  Mem, 0)
 691         DEFINE_CLASS_ID(LoadVector,  Load, 0)

 692       DEFINE_CLASS_ID(Store, Mem, 1)
 693         DEFINE_CLASS_ID(StoreVector, Store, 0)

 694       DEFINE_CLASS_ID(LoadStore, Mem, 2)
 695         DEFINE_CLASS_ID(LoadStoreConditional, LoadStore, 0)
 696           DEFINE_CLASS_ID(CompareAndSwap, LoadStoreConditional, 0)
 697         DEFINE_CLASS_ID(CompareAndExchangeNode, LoadStore, 1)
 698 
 699     DEFINE_CLASS_ID(Region, Node, 5)
 700       DEFINE_CLASS_ID(Loop, Region, 0)
 701         DEFINE_CLASS_ID(Root,                Loop, 0)
 702         DEFINE_CLASS_ID(CountedLoop,         Loop, 1)
 703         DEFINE_CLASS_ID(OuterStripMinedLoop, Loop, 2)
 704 
 705     DEFINE_CLASS_ID(Sub,   Node, 6)
 706       DEFINE_CLASS_ID(Cmp,   Sub, 0)
 707         DEFINE_CLASS_ID(FastLock,   Cmp, 0)
 708         DEFINE_CLASS_ID(FastUnlock, Cmp, 1)
 709         DEFINE_CLASS_ID(SubTypeCheck,Cmp, 2)
 710 
 711     DEFINE_CLASS_ID(MergeMem, Node, 7)
 712     DEFINE_CLASS_ID(Bool,     Node, 8)
 713     DEFINE_CLASS_ID(AddP,     Node, 9)
 714     DEFINE_CLASS_ID(BoxLock,  Node, 10)
 715     DEFINE_CLASS_ID(Add,      Node, 11)
 716     DEFINE_CLASS_ID(Mul,      Node, 12)
 717     DEFINE_CLASS_ID(Vector,   Node, 13)

 718     DEFINE_CLASS_ID(ClearArray, Node, 14)
 719     DEFINE_CLASS_ID(Halt, Node, 15)
 720     DEFINE_CLASS_ID(Opaque1, Node, 16)
 721 
 722     _max_classes  = ClassMask_Halt
 723   };
 724   #undef DEFINE_CLASS_ID
 725 
 726   // Flags are sorted by usage frequency.
 727   enum NodeFlags {
 728     Flag_is_Copy                     = 0x01, // should be first bit to avoid shift
 729     Flag_rematerialize               = Flag_is_Copy << 1,
 730     Flag_needs_anti_dependence_check = Flag_rematerialize << 1,
 731     Flag_is_macro                    = Flag_needs_anti_dependence_check << 1,
 732     Flag_is_Con                      = Flag_is_macro << 1,
 733     Flag_is_cisc_alternate           = Flag_is_Con << 1,
 734     Flag_is_dead_loop_safe           = Flag_is_cisc_alternate << 1,
 735     Flag_may_be_short_branch         = Flag_is_dead_loop_safe << 1,
 736     Flag_avoid_back_to_back_before   = Flag_may_be_short_branch << 1,
 737     Flag_avoid_back_to_back_after    = Flag_avoid_back_to_back_before << 1,


 868   DEFINE_CLASS_QUERY(Multi)
 869   DEFINE_CLASS_QUERY(MultiBranch)
 870   DEFINE_CLASS_QUERY(Opaque1)
 871   DEFINE_CLASS_QUERY(OuterStripMinedLoop)
 872   DEFINE_CLASS_QUERY(OuterStripMinedLoopEnd)
 873   DEFINE_CLASS_QUERY(Parm)
 874   DEFINE_CLASS_QUERY(PCTable)
 875   DEFINE_CLASS_QUERY(Phi)
 876   DEFINE_CLASS_QUERY(Proj)
 877   DEFINE_CLASS_QUERY(Region)
 878   DEFINE_CLASS_QUERY(Root)
 879   DEFINE_CLASS_QUERY(SafePoint)
 880   DEFINE_CLASS_QUERY(SafePointScalarObject)
 881   DEFINE_CLASS_QUERY(Start)
 882   DEFINE_CLASS_QUERY(Store)
 883   DEFINE_CLASS_QUERY(Sub)
 884   DEFINE_CLASS_QUERY(SubTypeCheck)
 885   DEFINE_CLASS_QUERY(Type)
 886   DEFINE_CLASS_QUERY(Vector)
 887   DEFINE_CLASS_QUERY(LoadVector)

 888   DEFINE_CLASS_QUERY(StoreVector)


 889   DEFINE_CLASS_QUERY(Unlock)
 890 
 891   #undef DEFINE_CLASS_QUERY
 892 
 893   // duplicate of is_MachSpillCopy()
 894   bool is_SpillCopy () const {
 895     return ((_class_id & ClassMask_MachSpillCopy) == Class_MachSpillCopy);
 896   }
 897 
 898   bool is_Con () const { return (_flags & Flag_is_Con) != 0; }
 899   // The data node which is safe to leave in dead loop during IGVN optimization.
 900   bool is_dead_loop_safe() const {
 901     return is_Phi() || (is_Proj() && in(0) == NULL) ||
 902            ((_flags & (Flag_is_dead_loop_safe | Flag_is_Con)) != 0 &&
 903             (!is_Proj() || !in(0)->is_Allocate()));
 904   }
 905 
 906   // is_Copy() returns copied edge index (0 or 1)
 907   uint is_Copy() const { return (_flags & Flag_is_Copy); }
 908 




 135 class PhaseValues;
 136 class PhiNode;
 137 class Pipeline;
 138 class ProjNode;
 139 class RangeCheckNode;
 140 class RegMask;
 141 class RegionNode;
 142 class RootNode;
 143 class SafePointNode;
 144 class SafePointScalarObjectNode;
 145 class StartNode;
 146 class State;
 147 class StoreNode;
 148 class SubNode;
 149 class SubTypeCheckNode;
 150 class Type;
 151 class TypeNode;
 152 class UnlockNode;
 153 class VectorNode;
 154 class LoadVectorNode;
 155 class LoadVectorGatherNode;
 156 class StoreVectorNode;
 157 class StoreVectorScatterNode;
 158 class VectorMaskCmpNode;
 159 class VectorSet;
 160 typedef void (*NFunc)(Node&,void*);
 161 extern "C" {
 162   typedef int (*C_sort_func_t)(const void *, const void *);
 163 }
 164 
 165 // The type of all node counts and indexes.
 166 // It must hold at least 16 bits, but must also be fast to load and store.
 167 // This type, if less than 32 bits, could limit the number of possible nodes.
 168 // (To make this type platform-specific, move to globalDefinitions_xxx.hpp.)
 169 typedef unsigned int node_idx_t;
 170 
 171 
 172 #ifndef OPTO_DU_ITERATOR_ASSERT
 173 #ifdef ASSERT
 174 #define OPTO_DU_ITERATOR_ASSERT 1
 175 #else
 176 #define OPTO_DU_ITERATOR_ASSERT 0
 177 #endif
 178 #endif //OPTO_DU_ITERATOR_ASSERT


 675       DEFINE_CLASS_ID(SafePointScalarObject, Type, 4)
 676       DEFINE_CLASS_ID(DecodeNarrowPtr, Type, 5)
 677         DEFINE_CLASS_ID(DecodeN, DecodeNarrowPtr, 0)
 678         DEFINE_CLASS_ID(DecodeNKlass, DecodeNarrowPtr, 1)
 679       DEFINE_CLASS_ID(EncodeNarrowPtr, Type, 6)
 680         DEFINE_CLASS_ID(EncodeP, EncodeNarrowPtr, 0)
 681         DEFINE_CLASS_ID(EncodePKlass, EncodeNarrowPtr, 1)
 682 
 683     DEFINE_CLASS_ID(Proj,  Node, 3)
 684       DEFINE_CLASS_ID(CatchProj, Proj, 0)
 685       DEFINE_CLASS_ID(JumpProj,  Proj, 1)
 686       DEFINE_CLASS_ID(IfProj,    Proj, 2)
 687         DEFINE_CLASS_ID(IfTrue,    IfProj, 0)
 688         DEFINE_CLASS_ID(IfFalse,   IfProj, 1)
 689       DEFINE_CLASS_ID(Parm,      Proj, 4)
 690       DEFINE_CLASS_ID(MachProj,  Proj, 5)
 691 
 692     DEFINE_CLASS_ID(Mem,   Node, 4)
 693       DEFINE_CLASS_ID(Load,  Mem, 0)
 694         DEFINE_CLASS_ID(LoadVector,  Load, 0)
 695           DEFINE_CLASS_ID(LoadVectorGather, LoadVector, 0)
 696       DEFINE_CLASS_ID(Store, Mem, 1)
 697         DEFINE_CLASS_ID(StoreVector, Store, 0)
 698           DEFINE_CLASS_ID(StoreVectorScatter, StoreVector, 0)
 699       DEFINE_CLASS_ID(LoadStore, Mem, 2)
 700         DEFINE_CLASS_ID(LoadStoreConditional, LoadStore, 0)
 701           DEFINE_CLASS_ID(CompareAndSwap, LoadStoreConditional, 0)
 702         DEFINE_CLASS_ID(CompareAndExchangeNode, LoadStore, 1)
 703 
 704     DEFINE_CLASS_ID(Region, Node, 5)
 705       DEFINE_CLASS_ID(Loop, Region, 0)
 706         DEFINE_CLASS_ID(Root,                Loop, 0)
 707         DEFINE_CLASS_ID(CountedLoop,         Loop, 1)
 708         DEFINE_CLASS_ID(OuterStripMinedLoop, Loop, 2)
 709 
 710     DEFINE_CLASS_ID(Sub,   Node, 6)
 711       DEFINE_CLASS_ID(Cmp,   Sub, 0)
 712         DEFINE_CLASS_ID(FastLock,   Cmp, 0)
 713         DEFINE_CLASS_ID(FastUnlock, Cmp, 1)
 714         DEFINE_CLASS_ID(SubTypeCheck,Cmp, 2)
 715 
 716     DEFINE_CLASS_ID(MergeMem, Node, 7)
 717     DEFINE_CLASS_ID(Bool,     Node, 8)
 718     DEFINE_CLASS_ID(AddP,     Node, 9)
 719     DEFINE_CLASS_ID(BoxLock,  Node, 10)
 720     DEFINE_CLASS_ID(Add,      Node, 11)
 721     DEFINE_CLASS_ID(Mul,      Node, 12)
 722     DEFINE_CLASS_ID(Vector,   Node, 13)
 723       DEFINE_CLASS_ID(VectorMaskCmp, Vector, 0)
 724     DEFINE_CLASS_ID(ClearArray, Node, 14)
 725     DEFINE_CLASS_ID(Halt, Node, 15)
 726     DEFINE_CLASS_ID(Opaque1, Node, 16)
 727 
 728     _max_classes  = ClassMask_Halt
 729   };
 730   #undef DEFINE_CLASS_ID
 731 
 732   // Flags are sorted by usage frequency.
 733   enum NodeFlags {
 734     Flag_is_Copy                     = 0x01, // should be first bit to avoid shift
 735     Flag_rematerialize               = Flag_is_Copy << 1,
 736     Flag_needs_anti_dependence_check = Flag_rematerialize << 1,
 737     Flag_is_macro                    = Flag_needs_anti_dependence_check << 1,
 738     Flag_is_Con                      = Flag_is_macro << 1,
 739     Flag_is_cisc_alternate           = Flag_is_Con << 1,
 740     Flag_is_dead_loop_safe           = Flag_is_cisc_alternate << 1,
 741     Flag_may_be_short_branch         = Flag_is_dead_loop_safe << 1,
 742     Flag_avoid_back_to_back_before   = Flag_may_be_short_branch << 1,
 743     Flag_avoid_back_to_back_after    = Flag_avoid_back_to_back_before << 1,


 874   DEFINE_CLASS_QUERY(Multi)
 875   DEFINE_CLASS_QUERY(MultiBranch)
 876   DEFINE_CLASS_QUERY(Opaque1)
 877   DEFINE_CLASS_QUERY(OuterStripMinedLoop)
 878   DEFINE_CLASS_QUERY(OuterStripMinedLoopEnd)
 879   DEFINE_CLASS_QUERY(Parm)
 880   DEFINE_CLASS_QUERY(PCTable)
 881   DEFINE_CLASS_QUERY(Phi)
 882   DEFINE_CLASS_QUERY(Proj)
 883   DEFINE_CLASS_QUERY(Region)
 884   DEFINE_CLASS_QUERY(Root)
 885   DEFINE_CLASS_QUERY(SafePoint)
 886   DEFINE_CLASS_QUERY(SafePointScalarObject)
 887   DEFINE_CLASS_QUERY(Start)
 888   DEFINE_CLASS_QUERY(Store)
 889   DEFINE_CLASS_QUERY(Sub)
 890   DEFINE_CLASS_QUERY(SubTypeCheck)
 891   DEFINE_CLASS_QUERY(Type)
 892   DEFINE_CLASS_QUERY(Vector)
 893   DEFINE_CLASS_QUERY(LoadVector)
 894   DEFINE_CLASS_QUERY(LoadVectorGather)
 895   DEFINE_CLASS_QUERY(StoreVector)
 896   DEFINE_CLASS_QUERY(StoreVectorScatter)
 897   DEFINE_CLASS_QUERY(VectorMaskCmp)
 898   DEFINE_CLASS_QUERY(Unlock)
 899 
 900   #undef DEFINE_CLASS_QUERY
 901 
 902   // duplicate of is_MachSpillCopy()
 903   bool is_SpillCopy () const {
 904     return ((_class_id & ClassMask_MachSpillCopy) == Class_MachSpillCopy);
 905   }
 906 
 907   bool is_Con () const { return (_flags & Flag_is_Con) != 0; }
 908   // The data node which is safe to leave in dead loop during IGVN optimization.
 909   bool is_dead_loop_safe() const {
 910     return is_Phi() || (is_Proj() && in(0) == NULL) ||
 911            ((_flags & (Flag_is_dead_loop_safe | Flag_is_Con)) != 0 &&
 912             (!is_Proj() || !in(0)->is_Allocate()));
 913   }
 914 
 915   // is_Copy() returns copied edge index (0 or 1)
 916   uint is_Copy() const { return (_flags & Flag_is_Copy); }
 917 


< prev index next >