< 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


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

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

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

 719     DEFINE_CLASS_ID(ClearArray, Node, 14)
 720     DEFINE_CLASS_ID(Halt, Node, 15)
 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,
 738     Flag_has_call                    = Flag_avoid_back_to_back_after << 1,


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

 885   DEFINE_CLASS_QUERY(StoreVector)


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




 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


 676       DEFINE_CLASS_ID(SafePointScalarObject, Type, 4)
 677       DEFINE_CLASS_ID(DecodeNarrowPtr, Type, 5)
 678         DEFINE_CLASS_ID(DecodeN, DecodeNarrowPtr, 0)
 679         DEFINE_CLASS_ID(DecodeNKlass, DecodeNarrowPtr, 1)
 680       DEFINE_CLASS_ID(EncodeNarrowPtr, Type, 6)
 681         DEFINE_CLASS_ID(EncodeP, EncodeNarrowPtr, 0)
 682         DEFINE_CLASS_ID(EncodePKlass, EncodeNarrowPtr, 1)
 683 
 684     DEFINE_CLASS_ID(Proj,  Node, 3)
 685       DEFINE_CLASS_ID(CatchProj, Proj, 0)
 686       DEFINE_CLASS_ID(JumpProj,  Proj, 1)
 687       DEFINE_CLASS_ID(IfProj,    Proj, 2)
 688         DEFINE_CLASS_ID(IfTrue,    IfProj, 0)
 689         DEFINE_CLASS_ID(IfFalse,   IfProj, 1)
 690       DEFINE_CLASS_ID(Parm,      Proj, 4)
 691       DEFINE_CLASS_ID(MachProj,  Proj, 5)
 692 
 693     DEFINE_CLASS_ID(Mem,   Node, 4)
 694       DEFINE_CLASS_ID(Load,  Mem, 0)
 695         DEFINE_CLASS_ID(LoadVector,  Load, 0)
 696           DEFINE_CLASS_ID(LoadVectorGather, LoadVector, 0)
 697       DEFINE_CLASS_ID(Store, Mem, 1)
 698         DEFINE_CLASS_ID(StoreVector, Store, 0)
 699           DEFINE_CLASS_ID(StoreVectorScatter, StoreVector, 0)
 700       DEFINE_CLASS_ID(LoadStore, Mem, 2)
 701         DEFINE_CLASS_ID(LoadStoreConditional, LoadStore, 0)
 702           DEFINE_CLASS_ID(CompareAndSwap, LoadStoreConditional, 0)
 703         DEFINE_CLASS_ID(CompareAndExchangeNode, LoadStore, 1)
 704 
 705     DEFINE_CLASS_ID(Region, Node, 5)
 706       DEFINE_CLASS_ID(Loop, Region, 0)
 707         DEFINE_CLASS_ID(Root,                Loop, 0)
 708         DEFINE_CLASS_ID(CountedLoop,         Loop, 1)
 709         DEFINE_CLASS_ID(OuterStripMinedLoop, Loop, 2)
 710 
 711     DEFINE_CLASS_ID(Sub,   Node, 6)
 712       DEFINE_CLASS_ID(Cmp,   Sub, 0)
 713         DEFINE_CLASS_ID(FastLock,   Cmp, 0)
 714         DEFINE_CLASS_ID(FastUnlock, Cmp, 1)
 715         DEFINE_CLASS_ID(SubTypeCheck,Cmp, 2)
 716 
 717     DEFINE_CLASS_ID(MergeMem, Node, 7)
 718     DEFINE_CLASS_ID(Bool,     Node, 8)
 719     DEFINE_CLASS_ID(AddP,     Node, 9)
 720     DEFINE_CLASS_ID(BoxLock,  Node, 10)
 721     DEFINE_CLASS_ID(Add,      Node, 11)
 722     DEFINE_CLASS_ID(Mul,      Node, 12)
 723     DEFINE_CLASS_ID(Vector,   Node, 13)
 724       DEFINE_CLASS_ID(VectorMaskCmp, Vector, 0)
 725     DEFINE_CLASS_ID(ClearArray, Node, 14)
 726     DEFINE_CLASS_ID(Halt, Node, 15)
 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,
 744     Flag_has_call                    = Flag_avoid_back_to_back_after << 1,


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


< prev index next >