70 class CheckCastPPNode;
71 class ClearArrayNode;
72 class CmpNode;
73 class CodeBuffer;
74 class ConstraintCastNode;
75 class ConNode;
76 class ConINode;
77 class ConvertNode;
78 class CompareAndSwapNode;
79 class CompareAndExchangeNode;
80 class CountedLoopNode;
81 class CountedLoopEndNode;
82 class DecodeNarrowPtrNode;
83 class DecodeNNode;
84 class DecodeNKlassNode;
85 class EncodeNarrowPtrNode;
86 class EncodePNode;
87 class EncodePKlassNode;
88 class FastLockNode;
89 class FastUnlockNode;
90 class HaltNode;
91 class IfNode;
92 class IfProjNode;
93 class IfFalseNode;
94 class IfTrueNode;
95 class InitializeNode;
96 class JVMState;
97 class JumpNode;
98 class JumpProjNode;
99 class LoadNode;
100 class LoadStoreNode;
101 class LoadStoreConditionalNode;
102 class LockNode;
103 class LongCountedLoopNode;
104 class LongCountedLoopEndNode;
105 class LoopNode;
106 class LShiftNode;
107 class MachBranchNode;
108 class MachCallDynamicJavaNode;
109 class MachCallJavaNode;
110 class MachCallLeafNode;
111 class MachCallNode;
112 class MachCallRuntimeNode;
113 class MachCallStaticJavaNode;
114 class MachConstantBaseNode;
115 class MachConstantNode;
116 class MachGotoNode;
117 class MachIfNode;
118 class MachJumpNode;
119 class MachNode;
120 class MachNullCheckNode;
121 class MachProjNode;
122 class MachReturnNode;
123 class MachSafePointNode;
124 class MachSpillCopyNode;
125 class MachTempNode;
126 class MachMergeNode;
127 class MachMemBarNode;
128 class Matcher;
129 class MemBarNode;
130 class MemBarStoreStoreNode;
131 class MemNode;
132 class MergeMemNode;
133 class MinMaxNode;
134 class MoveNode;
135 class MulNode;
136 class MultiNode;
137 class MultiBranchNode;
138 class NarrowMemProjNode;
139 class NegNode;
140 class NegVNode;
141 class NeverBranchNode;
142 class Opaque1Node;
143 class OpaqueLoopInitNode;
144 class OpaqueLoopStrideNode;
145 class OpaqueMultiversioningNode;
146 class OpaqueConstantBoolNode;
147 class OpaqueInitializedAssertionPredicateNode;
168 class PopulateIndexNode;
169 class ProjNode;
170 class RangeCheckNode;
171 class ReachabilityFenceNode;
172 class ReductionNode;
173 class RegMask;
174 class RegionNode;
175 class RootNode;
176 class SafePointNode;
177 class SafePointScalarObjectNode;
178 class SafePointScalarMergeNode;
179 class SaturatingVectorNode;
180 class StartNode;
181 class State;
182 class StoreNode;
183 class SubNode;
184 class SubTypeCheckNode;
185 class Type;
186 class TypeNode;
187 class UnlockNode;
188 class VectorNode;
189 class LoadVectorNode;
190 class LoadVectorMaskedNode;
191 class StoreVectorMaskedNode;
192 class LoadVectorGatherNode;
193 class LoadVectorGatherMaskedNode;
194 class StoreVectorNode;
195 class StoreVectorScatterNode;
196 class StoreVectorScatterMaskedNode;
197 class VerifyVectorAlignmentNode;
198 class VectorMaskCmpNode;
199 class VectorUnboxNode;
200 class VectorSet;
201 class VectorReinterpretNode;
202 class ShiftVNode;
203 class MulVLNode;
204 class ExpandVNode;
205 class CompressVNode;
206 class CompressMNode;
207 class C2_MacroAssembler;
677 Bit_Node = 0x00000000,
678 Class_Node = 0x00000000,
679 ClassMask_Node = 0xFFFFFFFF,
680
681 DEFINE_CLASS_ID(Multi, Node, 0)
682 DEFINE_CLASS_ID(SafePoint, Multi, 0)
683 DEFINE_CLASS_ID(Call, SafePoint, 0)
684 DEFINE_CLASS_ID(CallJava, Call, 0)
685 DEFINE_CLASS_ID(CallStaticJava, CallJava, 0)
686 DEFINE_CLASS_ID(CallDynamicJava, CallJava, 1)
687 DEFINE_CLASS_ID(CallRuntime, Call, 1)
688 DEFINE_CLASS_ID(CallLeaf, CallRuntime, 0)
689 DEFINE_CLASS_ID(CallLeafNoFP, CallLeaf, 0)
690 DEFINE_CLASS_ID(CallLeafPure, CallLeaf, 1)
691 DEFINE_CLASS_ID(Allocate, Call, 2)
692 DEFINE_CLASS_ID(AllocateArray, Allocate, 0)
693 DEFINE_CLASS_ID(AbstractLock, Call, 3)
694 DEFINE_CLASS_ID(Lock, AbstractLock, 0)
695 DEFINE_CLASS_ID(Unlock, AbstractLock, 1)
696 DEFINE_CLASS_ID(ArrayCopy, Call, 4)
697 DEFINE_CLASS_ID(MultiBranch, Multi, 1)
698 DEFINE_CLASS_ID(PCTable, MultiBranch, 0)
699 DEFINE_CLASS_ID(Catch, PCTable, 0)
700 DEFINE_CLASS_ID(Jump, PCTable, 1)
701 DEFINE_CLASS_ID(If, MultiBranch, 1)
702 DEFINE_CLASS_ID(BaseCountedLoopEnd, If, 0)
703 DEFINE_CLASS_ID(CountedLoopEnd, BaseCountedLoopEnd, 0)
704 DEFINE_CLASS_ID(LongCountedLoopEnd, BaseCountedLoopEnd, 1)
705 DEFINE_CLASS_ID(RangeCheck, If, 1)
706 DEFINE_CLASS_ID(OuterStripMinedLoopEnd, If, 2)
707 DEFINE_CLASS_ID(ParsePredicate, If, 3)
708 DEFINE_CLASS_ID(NeverBranch, MultiBranch, 2)
709 DEFINE_CLASS_ID(Start, Multi, 2)
710 DEFINE_CLASS_ID(MemBar, Multi, 3)
711 DEFINE_CLASS_ID(Initialize, MemBar, 0)
712 DEFINE_CLASS_ID(MemBarStoreStore, MemBar, 1)
713
714 DEFINE_CLASS_ID(Mach, Node, 1)
715 DEFINE_CLASS_ID(MachReturn, Mach, 0)
716 DEFINE_CLASS_ID(MachSafePoint, MachReturn, 0)
717 DEFINE_CLASS_ID(MachCall, MachSafePoint, 0)
718 DEFINE_CLASS_ID(MachCallJava, MachCall, 0)
719 DEFINE_CLASS_ID(MachCallStaticJava, MachCallJava, 0)
720 DEFINE_CLASS_ID(MachCallDynamicJava, MachCallJava, 1)
721 DEFINE_CLASS_ID(MachCallRuntime, MachCall, 1)
722 DEFINE_CLASS_ID(MachCallLeaf, MachCallRuntime, 0)
723 DEFINE_CLASS_ID(MachBranch, Mach, 1)
724 DEFINE_CLASS_ID(MachIf, MachBranch, 0)
725 DEFINE_CLASS_ID(MachGoto, MachBranch, 1)
726 DEFINE_CLASS_ID(MachNullCheck, MachBranch, 2)
727 DEFINE_CLASS_ID(MachSpillCopy, Mach, 2)
728 DEFINE_CLASS_ID(MachTemp, Mach, 3)
729 DEFINE_CLASS_ID(MachConstantBase, Mach, 4)
730 DEFINE_CLASS_ID(MachConstant, Mach, 5)
731 DEFINE_CLASS_ID(MachJump, MachConstant, 0)
732 DEFINE_CLASS_ID(MachMerge, Mach, 6)
733 DEFINE_CLASS_ID(MachMemBar, Mach, 7)
734
735 DEFINE_CLASS_ID(Type, Node, 2)
736 DEFINE_CLASS_ID(Phi, Type, 0)
737 DEFINE_CLASS_ID(ConstraintCast, Type, 1)
738 DEFINE_CLASS_ID(CastII, ConstraintCast, 0)
739 DEFINE_CLASS_ID(CheckCastPP, ConstraintCast, 1)
740 DEFINE_CLASS_ID(CastLL, ConstraintCast, 2)
741 DEFINE_CLASS_ID(CastFF, ConstraintCast, 3)
742 DEFINE_CLASS_ID(CastDD, ConstraintCast, 4)
743 DEFINE_CLASS_ID(CastVV, ConstraintCast, 5)
744 DEFINE_CLASS_ID(CastPP, ConstraintCast, 6)
745 DEFINE_CLASS_ID(CastHH, ConstraintCast, 7)
746 DEFINE_CLASS_ID(CMove, Type, 3)
747 DEFINE_CLASS_ID(SafePointScalarObject, Type, 4)
748 DEFINE_CLASS_ID(DecodeNarrowPtr, Type, 5)
749 DEFINE_CLASS_ID(DecodeN, DecodeNarrowPtr, 0)
750 DEFINE_CLASS_ID(DecodeNKlass, DecodeNarrowPtr, 1)
751 DEFINE_CLASS_ID(EncodeNarrowPtr, Type, 6)
752 DEFINE_CLASS_ID(EncodeP, EncodeNarrowPtr, 0)
753 DEFINE_CLASS_ID(EncodePKlass, EncodeNarrowPtr, 1)
754 DEFINE_CLASS_ID(Vector, Type, 7)
755 DEFINE_CLASS_ID(VectorMaskCmp, Vector, 0)
756 DEFINE_CLASS_ID(VectorUnbox, Vector, 1)
757 DEFINE_CLASS_ID(VectorReinterpret, Vector, 2)
758 DEFINE_CLASS_ID(ShiftV, Vector, 3)
759 DEFINE_CLASS_ID(CompressV, Vector, 4)
760 DEFINE_CLASS_ID(ExpandV, Vector, 5)
761 DEFINE_CLASS_ID(CompressM, Vector, 6)
762 DEFINE_CLASS_ID(Reduction, Vector, 7)
763 DEFINE_CLASS_ID(NegV, Vector, 8)
764 DEFINE_CLASS_ID(SaturatingVector, Vector, 9)
765 DEFINE_CLASS_ID(MulVL, Vector, 10)
766 DEFINE_CLASS_ID(Con, Type, 8)
767 DEFINE_CLASS_ID(ConI, Con, 0)
768 DEFINE_CLASS_ID(SafePointScalarMerge, Type, 9)
769 DEFINE_CLASS_ID(Convert, Type, 10)
770
771
772 DEFINE_CLASS_ID(Proj, Node, 3)
773 DEFINE_CLASS_ID(CatchProj, Proj, 0)
774 DEFINE_CLASS_ID(JumpProj, Proj, 1)
775 DEFINE_CLASS_ID(IfProj, Proj, 2)
776 DEFINE_CLASS_ID(IfTrue, IfProj, 0)
777 DEFINE_CLASS_ID(IfFalse, IfProj, 1)
778 DEFINE_CLASS_ID(Parm, Proj, 4)
779 DEFINE_CLASS_ID(MachProj, Proj, 5)
780 DEFINE_CLASS_ID(NarrowMemProj, Proj, 6)
781
782 DEFINE_CLASS_ID(Mem, Node, 4)
783 DEFINE_CLASS_ID(Load, Mem, 0)
784 DEFINE_CLASS_ID(LoadVector, Load, 0)
785 DEFINE_CLASS_ID(LoadVectorGather, LoadVector, 0)
786 DEFINE_CLASS_ID(LoadVectorGatherMasked, LoadVector, 1)
787 DEFINE_CLASS_ID(LoadVectorMasked, LoadVector, 2)
788 DEFINE_CLASS_ID(Store, Mem, 1)
789 DEFINE_CLASS_ID(StoreVector, Store, 0)
790 DEFINE_CLASS_ID(StoreVectorScatter, StoreVector, 0)
791 DEFINE_CLASS_ID(StoreVectorScatterMasked, StoreVector, 1)
792 DEFINE_CLASS_ID(StoreVectorMasked, StoreVector, 2)
793 DEFINE_CLASS_ID(LoadStore, Mem, 2)
794 DEFINE_CLASS_ID(LoadStoreConditional, LoadStore, 0)
795 DEFINE_CLASS_ID(CompareAndSwap, LoadStoreConditional, 0)
796 DEFINE_CLASS_ID(CompareAndExchangeNode, LoadStore, 1)
797
798 DEFINE_CLASS_ID(Region, Node, 5)
799 DEFINE_CLASS_ID(Loop, Region, 0)
800 DEFINE_CLASS_ID(Root, Loop, 0)
801 DEFINE_CLASS_ID(BaseCountedLoop, Loop, 1)
802 DEFINE_CLASS_ID(CountedLoop, BaseCountedLoop, 0)
803 DEFINE_CLASS_ID(LongCountedLoop, BaseCountedLoop, 1)
804 DEFINE_CLASS_ID(OuterStripMinedLoop, Loop, 2)
805
806 DEFINE_CLASS_ID(Sub, Node, 6)
807 DEFINE_CLASS_ID(Cmp, Sub, 0)
808 DEFINE_CLASS_ID(FastLock, Cmp, 0)
809 DEFINE_CLASS_ID(FastUnlock, Cmp, 1)
810 DEFINE_CLASS_ID(SubTypeCheck,Cmp, 2)
811
812 DEFINE_CLASS_ID(MergeMem, Node, 7)
813 DEFINE_CLASS_ID(Bool, Node, 8)
814 DEFINE_CLASS_ID(AddP, Node, 9)
815 DEFINE_CLASS_ID(BoxLock, Node, 10)
816 DEFINE_CLASS_ID(Add, Node, 11)
817 DEFINE_CLASS_ID(MinMax, Add, 0)
818 DEFINE_CLASS_ID(Mul, Node, 12)
819 DEFINE_CLASS_ID(ClearArray, Node, 14)
820 DEFINE_CLASS_ID(Halt, Node, 15)
821 DEFINE_CLASS_ID(Opaque1, Node, 16)
822 DEFINE_CLASS_ID(OpaqueLoopInit, Opaque1, 0)
823 DEFINE_CLASS_ID(OpaqueLoopStride, Opaque1, 1)
824 DEFINE_CLASS_ID(OpaqueMultiversioning, Opaque1, 2)
825 DEFINE_CLASS_ID(OpaqueConstantBool, Node, 17)
826 DEFINE_CLASS_ID(OpaqueInitializedAssertionPredicate, Node, 18)
827 DEFINE_CLASS_ID(OpaqueTemplateAssertionPredicate, Node, 19)
828 DEFINE_CLASS_ID(Move, Node, 20)
829 DEFINE_CLASS_ID(LShift, Node, 21)
830 DEFINE_CLASS_ID(Neg, Node, 22)
902 #define DEFINE_CLASS_QUERY(type) \
903 bool is_##type() const { \
904 return ((_class_id & ClassMask_##type) == Class_##type); \
905 } \
906 type##Node *as_##type() const { \
907 assert(is_##type(), "invalid node class: %s", Name()); \
908 return (type##Node*)this; \
909 } \
910 type##Node* isa_##type() const { \
911 return (is_##type()) ? as_##type() : nullptr; \
912 }
913
914 DEFINE_CLASS_QUERY(AbstractLock)
915 DEFINE_CLASS_QUERY(Add)
916 DEFINE_CLASS_QUERY(AddP)
917 DEFINE_CLASS_QUERY(Allocate)
918 DEFINE_CLASS_QUERY(AllocateArray)
919 DEFINE_CLASS_QUERY(ArrayCopy)
920 DEFINE_CLASS_QUERY(BaseCountedLoop)
921 DEFINE_CLASS_QUERY(BaseCountedLoopEnd)
922 DEFINE_CLASS_QUERY(Bool)
923 DEFINE_CLASS_QUERY(BoxLock)
924 DEFINE_CLASS_QUERY(Call)
925 DEFINE_CLASS_QUERY(CallDynamicJava)
926 DEFINE_CLASS_QUERY(CallJava)
927 DEFINE_CLASS_QUERY(CallLeaf)
928 DEFINE_CLASS_QUERY(CallLeafNoFP)
929 DEFINE_CLASS_QUERY(CallLeafPure)
930 DEFINE_CLASS_QUERY(CallRuntime)
931 DEFINE_CLASS_QUERY(CallStaticJava)
932 DEFINE_CLASS_QUERY(Catch)
933 DEFINE_CLASS_QUERY(CatchProj)
934 DEFINE_CLASS_QUERY(CheckCastPP)
935 DEFINE_CLASS_QUERY(CastII)
936 DEFINE_CLASS_QUERY(CastLL)
937 DEFINE_CLASS_QUERY(CastFF)
938 DEFINE_CLASS_QUERY(ConI)
939 DEFINE_CLASS_QUERY(CastPP)
940 DEFINE_CLASS_QUERY(ConstraintCast)
941 DEFINE_CLASS_QUERY(ClearArray)
942 DEFINE_CLASS_QUERY(CMove)
943 DEFINE_CLASS_QUERY(Cmp)
944 DEFINE_CLASS_QUERY(Convert)
945 DEFINE_CLASS_QUERY(CountedLoop)
946 DEFINE_CLASS_QUERY(CountedLoopEnd)
947 DEFINE_CLASS_QUERY(DecodeNarrowPtr)
948 DEFINE_CLASS_QUERY(DecodeN)
949 DEFINE_CLASS_QUERY(DecodeNKlass)
950 DEFINE_CLASS_QUERY(EncodeNarrowPtr)
951 DEFINE_CLASS_QUERY(EncodeP)
952 DEFINE_CLASS_QUERY(EncodePKlass)
953 DEFINE_CLASS_QUERY(FastLock)
954 DEFINE_CLASS_QUERY(FastUnlock)
955 DEFINE_CLASS_QUERY(Halt)
956 DEFINE_CLASS_QUERY(If)
957 DEFINE_CLASS_QUERY(RangeCheck)
958 DEFINE_CLASS_QUERY(IfProj)
959 DEFINE_CLASS_QUERY(IfFalse)
960 DEFINE_CLASS_QUERY(IfTrue)
961 DEFINE_CLASS_QUERY(Initialize)
962 DEFINE_CLASS_QUERY(Jump)
963 DEFINE_CLASS_QUERY(JumpProj)
964 DEFINE_CLASS_QUERY(LongCountedLoop)
965 DEFINE_CLASS_QUERY(LongCountedLoopEnd)
966 DEFINE_CLASS_QUERY(Load)
967 DEFINE_CLASS_QUERY(LoadStore)
968 DEFINE_CLASS_QUERY(LoadStoreConditional)
969 DEFINE_CLASS_QUERY(Lock)
970 DEFINE_CLASS_QUERY(Loop)
971 DEFINE_CLASS_QUERY(LShift)
972 DEFINE_CLASS_QUERY(Mach)
973 DEFINE_CLASS_QUERY(MachBranch)
974 DEFINE_CLASS_QUERY(MachCall)
975 DEFINE_CLASS_QUERY(MachCallDynamicJava)
976 DEFINE_CLASS_QUERY(MachCallJava)
977 DEFINE_CLASS_QUERY(MachCallLeaf)
978 DEFINE_CLASS_QUERY(MachCallRuntime)
979 DEFINE_CLASS_QUERY(MachCallStaticJava)
980 DEFINE_CLASS_QUERY(MachConstantBase)
981 DEFINE_CLASS_QUERY(MachConstant)
982 DEFINE_CLASS_QUERY(MachGoto)
983 DEFINE_CLASS_QUERY(MachIf)
984 DEFINE_CLASS_QUERY(MachJump)
985 DEFINE_CLASS_QUERY(MachNullCheck)
986 DEFINE_CLASS_QUERY(MachProj)
987 DEFINE_CLASS_QUERY(MachReturn)
988 DEFINE_CLASS_QUERY(MachSafePoint)
989 DEFINE_CLASS_QUERY(MachSpillCopy)
990 DEFINE_CLASS_QUERY(MachTemp)
991 DEFINE_CLASS_QUERY(MachMemBar)
992 DEFINE_CLASS_QUERY(MachMerge)
993 DEFINE_CLASS_QUERY(Mem)
994 DEFINE_CLASS_QUERY(MemBar)
995 DEFINE_CLASS_QUERY(MemBarStoreStore)
996 DEFINE_CLASS_QUERY(MergeMem)
997 DEFINE_CLASS_QUERY(MinMax)
998 DEFINE_CLASS_QUERY(Move)
999 DEFINE_CLASS_QUERY(Mul)
1000 DEFINE_CLASS_QUERY(Multi)
1001 DEFINE_CLASS_QUERY(MultiBranch)
1002 DEFINE_CLASS_QUERY(MulVL)
1003 DEFINE_CLASS_QUERY(NarrowMemProj)
1004 DEFINE_CLASS_QUERY(Neg)
1005 DEFINE_CLASS_QUERY(NegV)
1006 DEFINE_CLASS_QUERY(NeverBranch)
1007 DEFINE_CLASS_QUERY(Opaque1)
1008 DEFINE_CLASS_QUERY(OpaqueConstantBool)
1009 DEFINE_CLASS_QUERY(OpaqueInitializedAssertionPredicate)
1010 DEFINE_CLASS_QUERY(OpaqueTemplateAssertionPredicate)
1011 DEFINE_CLASS_QUERY(OpaqueLoopInit)
1012 DEFINE_CLASS_QUERY(OpaqueLoopStride)
1013 DEFINE_CLASS_QUERY(OpaqueMultiversioning)
1014 DEFINE_CLASS_QUERY(OuterStripMinedLoop)
1015 DEFINE_CLASS_QUERY(OuterStripMinedLoopEnd)
1016 DEFINE_CLASS_QUERY(Parm)
1017 DEFINE_CLASS_QUERY(ParsePredicate)
1018 DEFINE_CLASS_QUERY(PCTable)
1019 DEFINE_CLASS_QUERY(Phi)
1020 DEFINE_CLASS_QUERY(Proj)
1021 DEFINE_CLASS_QUERY(ReachabilityFence)
1022 DEFINE_CLASS_QUERY(Reduction)
1023 DEFINE_CLASS_QUERY(Region)
1024 DEFINE_CLASS_QUERY(Root)
1025 DEFINE_CLASS_QUERY(SafePoint)
1026 DEFINE_CLASS_QUERY(SafePointScalarObject)
1027 DEFINE_CLASS_QUERY(SafePointScalarMerge)
1028 DEFINE_CLASS_QUERY(Start)
1029 DEFINE_CLASS_QUERY(Store)
1030 DEFINE_CLASS_QUERY(Sub)
1031 DEFINE_CLASS_QUERY(SubTypeCheck)
1032 DEFINE_CLASS_QUERY(Type)
1033 DEFINE_CLASS_QUERY(Vector)
1034 DEFINE_CLASS_QUERY(VectorMaskCmp)
1035 DEFINE_CLASS_QUERY(VectorUnbox)
1036 DEFINE_CLASS_QUERY(VectorReinterpret)
1037 DEFINE_CLASS_QUERY(CompressV)
1038 DEFINE_CLASS_QUERY(ExpandV)
1039 DEFINE_CLASS_QUERY(CompressM)
1040 DEFINE_CLASS_QUERY(LoadVector)
1041 DEFINE_CLASS_QUERY(LoadVectorGather)
1042 DEFINE_CLASS_QUERY(LoadVectorMasked)
1043 DEFINE_CLASS_QUERY(LoadVectorGatherMasked)
1044 DEFINE_CLASS_QUERY(StoreVector)
1045 DEFINE_CLASS_QUERY(StoreVectorScatter)
1046 DEFINE_CLASS_QUERY(StoreVectorMasked)
1047 DEFINE_CLASS_QUERY(StoreVectorScatterMasked)
1048 DEFINE_CLASS_QUERY(SaturatingVector)
1049 DEFINE_CLASS_QUERY(ShiftV)
1050 DEFINE_CLASS_QUERY(Unlock)
1051
1052 #undef DEFINE_CLASS_QUERY
1307 // Determine if a node is a counted loop induction variable.
1308 // NOTE: The method is defined in "loopnode.cpp".
1309 bool is_cloop_ind_var() const;
1310
1311 // Return a node with opcode "opc" and same inputs as "this" if one can
1312 // be found; Otherwise return null;
1313 Node* find_similar(int opc);
1314 bool has_same_inputs_as(const Node* other) const;
1315
1316 // Return the unique control out if only one. Null if none or more than one.
1317 Node* unique_ctrl_out_or_null() const;
1318 // Return the unique control out. Asserts if none or more than one control out.
1319 Node* unique_ctrl_out() const;
1320
1321 // Set control or add control as precedence edge
1322 void ensure_control_or_add_prec(Node* c);
1323 void add_prec_from(Node* n);
1324
1325 // Visit boundary uses of the node and apply a callback function for each.
1326 // Recursively traverse uses, stopping and applying the callback when
1327 // reaching a boundary node, defined by is_boundary. Note: the function
1328 // definition appears after the complete type definition of Node_List.
1329 template <typename Callback, typename Check>
1330 void visit_uses(Callback callback, Check is_boundary) const;
1331
1332 //----------------- Code Generation
1333
1334 // Ideal register class for Matching. Zero means unmatched instruction
1335 // (these are cloned instead of converted to machine nodes).
1336 virtual uint ideal_reg() const;
1337
1338 static const uint NotAMachineReg; // must be > max. machine register
1339
1340 // Do we Match on this edge index or not? Generally false for Control
1341 // and true for everything else. Weird for calls & returns.
1342 virtual uint match_edge(uint idx) const;
1343
1344 // Register class output is returned in
1345 virtual const RegMask &out_RegMask() const;
1346 // Register class input is expected in
1347 virtual const RegMask &in_RegMask(uint) const;
1348 // Should we clone rather than spill this instruction?
1349 bool rematerialize() const;
1350
1827 void remove( uint i ) { Node_Array::remove(i); _cnt--; }
1828 void push( Node *b ) { map(_cnt++,b); }
1829 void yank( Node *n ); // Find and remove
1830 Node *pop() { return _nodes[--_cnt]; }
1831 void clear() { _cnt = 0; Node_Array::clear(); } // retain storage
1832 void copy(const Node_List& from) {
1833 if (from._max > _max) {
1834 grow(from._max);
1835 }
1836 _cnt = from._cnt;
1837 Copy::conjoint_words_to_higher((HeapWord*)&from._nodes[0], (HeapWord*)&_nodes[0], from._max * sizeof(Node*));
1838 }
1839
1840 uint size() const { return _cnt; }
1841 void dump() const;
1842 void dump_simple() const;
1843 };
1844
1845 // Definition must appear after complete type definition of Node_List
1846 template <typename Callback, typename Check>
1847 void Node::visit_uses(Callback callback, Check is_boundary) const {
1848 ResourceMark rm;
1849 VectorSet visited;
1850 Node_List worklist;
1851
1852 // The initial worklist consists of the direct uses
1853 for (DUIterator_Fast kmax, k = fast_outs(kmax); k < kmax; k++) {
1854 Node* out = fast_out(k);
1855 if (!visited.test_set(out->_idx)) { worklist.push(out); }
1856 }
1857
1858 while (worklist.size() > 0) {
1859 Node* use = worklist.pop();
1860 // Apply callback on boundary nodes
1861 if (is_boundary(use)) {
1862 callback(use);
1863 } else {
1864 // Not a boundary node, continue search
1865 for (DUIterator_Fast kmax, k = use->fast_outs(kmax); k < kmax; k++) {
1866 Node* out = use->fast_out(k);
1867 if (!visited.test_set(out->_idx)) { worklist.push(out); }
1868 }
1869 }
1870 }
1871 }
1872
1873
1874 //------------------------------Unique_Node_List-------------------------------
1875 class Unique_Node_List : public Node_List {
1876 VectorSet _in_worklist;
1877 uint _clock_index; // Index in list where to pop from next
1878 public:
1879 Unique_Node_List() : Node_List(), _clock_index(0) {}
1880 Unique_Node_List(Arena *a) : Node_List(a), _in_worklist(a), _clock_index(0) {}
1881
1882 NONCOPYABLE(Unique_Node_List);
1883 Unique_Node_List& operator=(Unique_Node_List&&) = delete;
|
70 class CheckCastPPNode;
71 class ClearArrayNode;
72 class CmpNode;
73 class CodeBuffer;
74 class ConstraintCastNode;
75 class ConNode;
76 class ConINode;
77 class ConvertNode;
78 class CompareAndSwapNode;
79 class CompareAndExchangeNode;
80 class CountedLoopNode;
81 class CountedLoopEndNode;
82 class DecodeNarrowPtrNode;
83 class DecodeNNode;
84 class DecodeNKlassNode;
85 class EncodeNarrowPtrNode;
86 class EncodePNode;
87 class EncodePKlassNode;
88 class FastLockNode;
89 class FastUnlockNode;
90 class FlatArrayCheckNode;
91 class HaltNode;
92 class IfNode;
93 class IfProjNode;
94 class IfFalseNode;
95 class IfTrueNode;
96 class InitializeNode;
97 class JVMState;
98 class JumpNode;
99 class JumpProjNode;
100 class LoadNode;
101 class LoadStoreNode;
102 class LoadStoreConditionalNode;
103 class LockNode;
104 class LongCountedLoopNode;
105 class LongCountedLoopEndNode;
106 class LoopNode;
107 class LShiftNode;
108 class MachBranchNode;
109 class MachCallDynamicJavaNode;
110 class MachCallJavaNode;
111 class MachCallLeafNode;
112 class MachCallNode;
113 class MachCallRuntimeNode;
114 class MachCallStaticJavaNode;
115 class MachConstantBaseNode;
116 class MachConstantNode;
117 class MachGotoNode;
118 class MachIfNode;
119 class MachJumpNode;
120 class MachNode;
121 class MachNullCheckNode;
122 class MachProjNode;
123 class MachPrologNode;
124 class MachReturnNode;
125 class MachSafePointNode;
126 class MachSpillCopyNode;
127 class MachTempNode;
128 class MachMergeNode;
129 class MachMemBarNode;
130 class MachVEPNode;
131 class Matcher;
132 class MemBarNode;
133 class MemBarStoreStoreNode;
134 class MemNode;
135 class MergeMemNode;
136 class MinMaxNode;
137 class MoveNode;
138 class MulNode;
139 class MultiNode;
140 class MultiBranchNode;
141 class NarrowMemProjNode;
142 class NegNode;
143 class NegVNode;
144 class NeverBranchNode;
145 class Opaque1Node;
146 class OpaqueLoopInitNode;
147 class OpaqueLoopStrideNode;
148 class OpaqueMultiversioningNode;
149 class OpaqueConstantBoolNode;
150 class OpaqueInitializedAssertionPredicateNode;
171 class PopulateIndexNode;
172 class ProjNode;
173 class RangeCheckNode;
174 class ReachabilityFenceNode;
175 class ReductionNode;
176 class RegMask;
177 class RegionNode;
178 class RootNode;
179 class SafePointNode;
180 class SafePointScalarObjectNode;
181 class SafePointScalarMergeNode;
182 class SaturatingVectorNode;
183 class StartNode;
184 class State;
185 class StoreNode;
186 class SubNode;
187 class SubTypeCheckNode;
188 class Type;
189 class TypeNode;
190 class UnlockNode;
191 class InlineTypeNode;
192 class LoadFlatNode;
193 class StoreFlatNode;
194 class VectorNode;
195 class LoadVectorNode;
196 class LoadVectorMaskedNode;
197 class StoreVectorMaskedNode;
198 class LoadVectorGatherNode;
199 class LoadVectorGatherMaskedNode;
200 class StoreVectorNode;
201 class StoreVectorScatterNode;
202 class StoreVectorScatterMaskedNode;
203 class VerifyVectorAlignmentNode;
204 class VectorMaskCmpNode;
205 class VectorUnboxNode;
206 class VectorSet;
207 class VectorReinterpretNode;
208 class ShiftVNode;
209 class MulVLNode;
210 class ExpandVNode;
211 class CompressVNode;
212 class CompressMNode;
213 class C2_MacroAssembler;
683 Bit_Node = 0x00000000,
684 Class_Node = 0x00000000,
685 ClassMask_Node = 0xFFFFFFFF,
686
687 DEFINE_CLASS_ID(Multi, Node, 0)
688 DEFINE_CLASS_ID(SafePoint, Multi, 0)
689 DEFINE_CLASS_ID(Call, SafePoint, 0)
690 DEFINE_CLASS_ID(CallJava, Call, 0)
691 DEFINE_CLASS_ID(CallStaticJava, CallJava, 0)
692 DEFINE_CLASS_ID(CallDynamicJava, CallJava, 1)
693 DEFINE_CLASS_ID(CallRuntime, Call, 1)
694 DEFINE_CLASS_ID(CallLeaf, CallRuntime, 0)
695 DEFINE_CLASS_ID(CallLeafNoFP, CallLeaf, 0)
696 DEFINE_CLASS_ID(CallLeafPure, CallLeaf, 1)
697 DEFINE_CLASS_ID(Allocate, Call, 2)
698 DEFINE_CLASS_ID(AllocateArray, Allocate, 0)
699 DEFINE_CLASS_ID(AbstractLock, Call, 3)
700 DEFINE_CLASS_ID(Lock, AbstractLock, 0)
701 DEFINE_CLASS_ID(Unlock, AbstractLock, 1)
702 DEFINE_CLASS_ID(ArrayCopy, Call, 4)
703 DEFINE_CLASS_ID(LoadFlat, SafePoint, 1)
704 DEFINE_CLASS_ID(StoreFlat, SafePoint, 2)
705 DEFINE_CLASS_ID(MultiBranch, Multi, 1)
706 DEFINE_CLASS_ID(PCTable, MultiBranch, 0)
707 DEFINE_CLASS_ID(Catch, PCTable, 0)
708 DEFINE_CLASS_ID(Jump, PCTable, 1)
709 DEFINE_CLASS_ID(If, MultiBranch, 1)
710 DEFINE_CLASS_ID(BaseCountedLoopEnd, If, 0)
711 DEFINE_CLASS_ID(CountedLoopEnd, BaseCountedLoopEnd, 0)
712 DEFINE_CLASS_ID(LongCountedLoopEnd, BaseCountedLoopEnd, 1)
713 DEFINE_CLASS_ID(RangeCheck, If, 1)
714 DEFINE_CLASS_ID(OuterStripMinedLoopEnd, If, 2)
715 DEFINE_CLASS_ID(ParsePredicate, If, 3)
716 DEFINE_CLASS_ID(NeverBranch, MultiBranch, 2)
717 DEFINE_CLASS_ID(Start, Multi, 2)
718 DEFINE_CLASS_ID(MemBar, Multi, 3)
719 DEFINE_CLASS_ID(Initialize, MemBar, 0)
720 DEFINE_CLASS_ID(MemBarStoreStore, MemBar, 1)
721 DEFINE_CLASS_ID(Blackhole, Multi, 4)
722
723 DEFINE_CLASS_ID(Mach, Node, 1)
724 DEFINE_CLASS_ID(MachReturn, Mach, 0)
725 DEFINE_CLASS_ID(MachSafePoint, MachReturn, 0)
726 DEFINE_CLASS_ID(MachCall, MachSafePoint, 0)
727 DEFINE_CLASS_ID(MachCallJava, MachCall, 0)
728 DEFINE_CLASS_ID(MachCallStaticJava, MachCallJava, 0)
729 DEFINE_CLASS_ID(MachCallDynamicJava, MachCallJava, 1)
730 DEFINE_CLASS_ID(MachCallRuntime, MachCall, 1)
731 DEFINE_CLASS_ID(MachCallLeaf, MachCallRuntime, 0)
732 DEFINE_CLASS_ID(MachBranch, Mach, 1)
733 DEFINE_CLASS_ID(MachIf, MachBranch, 0)
734 DEFINE_CLASS_ID(MachGoto, MachBranch, 1)
735 DEFINE_CLASS_ID(MachNullCheck, MachBranch, 2)
736 DEFINE_CLASS_ID(MachSpillCopy, Mach, 2)
737 DEFINE_CLASS_ID(MachTemp, Mach, 3)
738 DEFINE_CLASS_ID(MachConstantBase, Mach, 4)
739 DEFINE_CLASS_ID(MachConstant, Mach, 5)
740 DEFINE_CLASS_ID(MachJump, MachConstant, 0)
741 DEFINE_CLASS_ID(MachMerge, Mach, 6)
742 DEFINE_CLASS_ID(MachMemBar, Mach, 7)
743 DEFINE_CLASS_ID(MachProlog, Mach, 8)
744 DEFINE_CLASS_ID(MachVEP, Mach, 9)
745
746 DEFINE_CLASS_ID(Type, Node, 2)
747 DEFINE_CLASS_ID(Phi, Type, 0)
748 DEFINE_CLASS_ID(ConstraintCast, Type, 1)
749 DEFINE_CLASS_ID(CastII, ConstraintCast, 0)
750 DEFINE_CLASS_ID(CheckCastPP, ConstraintCast, 1)
751 DEFINE_CLASS_ID(CastLL, ConstraintCast, 2)
752 DEFINE_CLASS_ID(CastFF, ConstraintCast, 3)
753 DEFINE_CLASS_ID(CastDD, ConstraintCast, 4)
754 DEFINE_CLASS_ID(CastVV, ConstraintCast, 5)
755 DEFINE_CLASS_ID(CastPP, ConstraintCast, 6)
756 DEFINE_CLASS_ID(CastHH, ConstraintCast, 7)
757 DEFINE_CLASS_ID(CMove, Type, 3)
758 DEFINE_CLASS_ID(SafePointScalarObject, Type, 4)
759 DEFINE_CLASS_ID(DecodeNarrowPtr, Type, 5)
760 DEFINE_CLASS_ID(DecodeN, DecodeNarrowPtr, 0)
761 DEFINE_CLASS_ID(DecodeNKlass, DecodeNarrowPtr, 1)
762 DEFINE_CLASS_ID(EncodeNarrowPtr, Type, 6)
763 DEFINE_CLASS_ID(EncodeP, EncodeNarrowPtr, 0)
764 DEFINE_CLASS_ID(EncodePKlass, EncodeNarrowPtr, 1)
765 DEFINE_CLASS_ID(Vector, Type, 7)
766 DEFINE_CLASS_ID(VectorMaskCmp, Vector, 0)
767 DEFINE_CLASS_ID(VectorUnbox, Vector, 1)
768 DEFINE_CLASS_ID(VectorReinterpret, Vector, 2)
769 DEFINE_CLASS_ID(ShiftV, Vector, 3)
770 DEFINE_CLASS_ID(CompressV, Vector, 4)
771 DEFINE_CLASS_ID(ExpandV, Vector, 5)
772 DEFINE_CLASS_ID(CompressM, Vector, 6)
773 DEFINE_CLASS_ID(Reduction, Vector, 7)
774 DEFINE_CLASS_ID(NegV, Vector, 8)
775 DEFINE_CLASS_ID(SaturatingVector, Vector, 9)
776 DEFINE_CLASS_ID(MulVL, Vector, 10)
777 DEFINE_CLASS_ID(InlineType, Type, 8)
778 DEFINE_CLASS_ID(Con, Type, 9)
779 DEFINE_CLASS_ID(ConI, Con, 0)
780 DEFINE_CLASS_ID(SafePointScalarMerge, Type, 10)
781 DEFINE_CLASS_ID(Convert, Type, 11)
782
783
784 DEFINE_CLASS_ID(Proj, Node, 3)
785 DEFINE_CLASS_ID(CatchProj, Proj, 0)
786 DEFINE_CLASS_ID(JumpProj, Proj, 1)
787 DEFINE_CLASS_ID(IfProj, Proj, 2)
788 DEFINE_CLASS_ID(IfTrue, IfProj, 0)
789 DEFINE_CLASS_ID(IfFalse, IfProj, 1)
790 DEFINE_CLASS_ID(Parm, Proj, 4)
791 DEFINE_CLASS_ID(MachProj, Proj, 5)
792 DEFINE_CLASS_ID(NarrowMemProj, Proj, 6)
793
794 DEFINE_CLASS_ID(Mem, Node, 4)
795 DEFINE_CLASS_ID(Load, Mem, 0)
796 DEFINE_CLASS_ID(LoadVector, Load, 0)
797 DEFINE_CLASS_ID(LoadVectorGather, LoadVector, 0)
798 DEFINE_CLASS_ID(LoadVectorGatherMasked, LoadVector, 1)
799 DEFINE_CLASS_ID(LoadVectorMasked, LoadVector, 2)
800 DEFINE_CLASS_ID(Store, Mem, 1)
801 DEFINE_CLASS_ID(StoreVector, Store, 0)
802 DEFINE_CLASS_ID(StoreVectorScatter, StoreVector, 0)
803 DEFINE_CLASS_ID(StoreVectorScatterMasked, StoreVector, 1)
804 DEFINE_CLASS_ID(StoreVectorMasked, StoreVector, 2)
805 DEFINE_CLASS_ID(LoadStore, Mem, 2)
806 DEFINE_CLASS_ID(LoadStoreConditional, LoadStore, 0)
807 DEFINE_CLASS_ID(CompareAndSwap, LoadStoreConditional, 0)
808 DEFINE_CLASS_ID(CompareAndExchangeNode, LoadStore, 1)
809
810 DEFINE_CLASS_ID(Region, Node, 5)
811 DEFINE_CLASS_ID(Loop, Region, 0)
812 DEFINE_CLASS_ID(Root, Loop, 0)
813 DEFINE_CLASS_ID(BaseCountedLoop, Loop, 1)
814 DEFINE_CLASS_ID(CountedLoop, BaseCountedLoop, 0)
815 DEFINE_CLASS_ID(LongCountedLoop, BaseCountedLoop, 1)
816 DEFINE_CLASS_ID(OuterStripMinedLoop, Loop, 2)
817
818 DEFINE_CLASS_ID(Sub, Node, 6)
819 DEFINE_CLASS_ID(Cmp, Sub, 0)
820 DEFINE_CLASS_ID(FastLock, Cmp, 0)
821 DEFINE_CLASS_ID(FastUnlock, Cmp, 1)
822 DEFINE_CLASS_ID(SubTypeCheck, Cmp, 2)
823 DEFINE_CLASS_ID(FlatArrayCheck, Cmp, 3)
824
825 DEFINE_CLASS_ID(MergeMem, Node, 7)
826 DEFINE_CLASS_ID(Bool, Node, 8)
827 DEFINE_CLASS_ID(AddP, Node, 9)
828 DEFINE_CLASS_ID(BoxLock, Node, 10)
829 DEFINE_CLASS_ID(Add, Node, 11)
830 DEFINE_CLASS_ID(MinMax, Add, 0)
831 DEFINE_CLASS_ID(Mul, Node, 12)
832 DEFINE_CLASS_ID(ClearArray, Node, 14)
833 DEFINE_CLASS_ID(Halt, Node, 15)
834 DEFINE_CLASS_ID(Opaque1, Node, 16)
835 DEFINE_CLASS_ID(OpaqueLoopInit, Opaque1, 0)
836 DEFINE_CLASS_ID(OpaqueLoopStride, Opaque1, 1)
837 DEFINE_CLASS_ID(OpaqueMultiversioning, Opaque1, 2)
838 DEFINE_CLASS_ID(OpaqueConstantBool, Node, 17)
839 DEFINE_CLASS_ID(OpaqueInitializedAssertionPredicate, Node, 18)
840 DEFINE_CLASS_ID(OpaqueTemplateAssertionPredicate, Node, 19)
841 DEFINE_CLASS_ID(Move, Node, 20)
842 DEFINE_CLASS_ID(LShift, Node, 21)
843 DEFINE_CLASS_ID(Neg, Node, 22)
915 #define DEFINE_CLASS_QUERY(type) \
916 bool is_##type() const { \
917 return ((_class_id & ClassMask_##type) == Class_##type); \
918 } \
919 type##Node *as_##type() const { \
920 assert(is_##type(), "invalid node class: %s", Name()); \
921 return (type##Node*)this; \
922 } \
923 type##Node* isa_##type() const { \
924 return (is_##type()) ? as_##type() : nullptr; \
925 }
926
927 DEFINE_CLASS_QUERY(AbstractLock)
928 DEFINE_CLASS_QUERY(Add)
929 DEFINE_CLASS_QUERY(AddP)
930 DEFINE_CLASS_QUERY(Allocate)
931 DEFINE_CLASS_QUERY(AllocateArray)
932 DEFINE_CLASS_QUERY(ArrayCopy)
933 DEFINE_CLASS_QUERY(BaseCountedLoop)
934 DEFINE_CLASS_QUERY(BaseCountedLoopEnd)
935 DEFINE_CLASS_QUERY(Blackhole)
936 DEFINE_CLASS_QUERY(Bool)
937 DEFINE_CLASS_QUERY(BoxLock)
938 DEFINE_CLASS_QUERY(Call)
939 DEFINE_CLASS_QUERY(CallDynamicJava)
940 DEFINE_CLASS_QUERY(CallJava)
941 DEFINE_CLASS_QUERY(CallLeaf)
942 DEFINE_CLASS_QUERY(CallLeafNoFP)
943 DEFINE_CLASS_QUERY(CallLeafPure)
944 DEFINE_CLASS_QUERY(CallRuntime)
945 DEFINE_CLASS_QUERY(CallStaticJava)
946 DEFINE_CLASS_QUERY(Catch)
947 DEFINE_CLASS_QUERY(CatchProj)
948 DEFINE_CLASS_QUERY(CheckCastPP)
949 DEFINE_CLASS_QUERY(CastII)
950 DEFINE_CLASS_QUERY(CastLL)
951 DEFINE_CLASS_QUERY(CastFF)
952 DEFINE_CLASS_QUERY(ConI)
953 DEFINE_CLASS_QUERY(CastPP)
954 DEFINE_CLASS_QUERY(ConstraintCast)
955 DEFINE_CLASS_QUERY(ClearArray)
956 DEFINE_CLASS_QUERY(CMove)
957 DEFINE_CLASS_QUERY(Cmp)
958 DEFINE_CLASS_QUERY(Convert)
959 DEFINE_CLASS_QUERY(CountedLoop)
960 DEFINE_CLASS_QUERY(CountedLoopEnd)
961 DEFINE_CLASS_QUERY(DecodeNarrowPtr)
962 DEFINE_CLASS_QUERY(DecodeN)
963 DEFINE_CLASS_QUERY(DecodeNKlass)
964 DEFINE_CLASS_QUERY(EncodeNarrowPtr)
965 DEFINE_CLASS_QUERY(EncodeP)
966 DEFINE_CLASS_QUERY(EncodePKlass)
967 DEFINE_CLASS_QUERY(FastLock)
968 DEFINE_CLASS_QUERY(FastUnlock)
969 DEFINE_CLASS_QUERY(FlatArrayCheck)
970 DEFINE_CLASS_QUERY(Halt)
971 DEFINE_CLASS_QUERY(If)
972 DEFINE_CLASS_QUERY(RangeCheck)
973 DEFINE_CLASS_QUERY(IfProj)
974 DEFINE_CLASS_QUERY(IfFalse)
975 DEFINE_CLASS_QUERY(IfTrue)
976 DEFINE_CLASS_QUERY(Initialize)
977 DEFINE_CLASS_QUERY(Jump)
978 DEFINE_CLASS_QUERY(JumpProj)
979 DEFINE_CLASS_QUERY(LongCountedLoop)
980 DEFINE_CLASS_QUERY(LongCountedLoopEnd)
981 DEFINE_CLASS_QUERY(Load)
982 DEFINE_CLASS_QUERY(LoadStore)
983 DEFINE_CLASS_QUERY(LoadStoreConditional)
984 DEFINE_CLASS_QUERY(Lock)
985 DEFINE_CLASS_QUERY(Loop)
986 DEFINE_CLASS_QUERY(LShift)
987 DEFINE_CLASS_QUERY(Mach)
988 DEFINE_CLASS_QUERY(MachBranch)
989 DEFINE_CLASS_QUERY(MachCall)
990 DEFINE_CLASS_QUERY(MachCallDynamicJava)
991 DEFINE_CLASS_QUERY(MachCallJava)
992 DEFINE_CLASS_QUERY(MachCallLeaf)
993 DEFINE_CLASS_QUERY(MachCallRuntime)
994 DEFINE_CLASS_QUERY(MachCallStaticJava)
995 DEFINE_CLASS_QUERY(MachConstantBase)
996 DEFINE_CLASS_QUERY(MachConstant)
997 DEFINE_CLASS_QUERY(MachGoto)
998 DEFINE_CLASS_QUERY(MachIf)
999 DEFINE_CLASS_QUERY(MachJump)
1000 DEFINE_CLASS_QUERY(MachNullCheck)
1001 DEFINE_CLASS_QUERY(MachProj)
1002 DEFINE_CLASS_QUERY(MachProlog)
1003 DEFINE_CLASS_QUERY(MachReturn)
1004 DEFINE_CLASS_QUERY(MachSafePoint)
1005 DEFINE_CLASS_QUERY(MachSpillCopy)
1006 DEFINE_CLASS_QUERY(MachTemp)
1007 DEFINE_CLASS_QUERY(MachMemBar)
1008 DEFINE_CLASS_QUERY(MachMerge)
1009 DEFINE_CLASS_QUERY(MachVEP)
1010 DEFINE_CLASS_QUERY(Mem)
1011 DEFINE_CLASS_QUERY(MemBar)
1012 DEFINE_CLASS_QUERY(MemBarStoreStore)
1013 DEFINE_CLASS_QUERY(MergeMem)
1014 DEFINE_CLASS_QUERY(MinMax)
1015 DEFINE_CLASS_QUERY(Move)
1016 DEFINE_CLASS_QUERY(Mul)
1017 DEFINE_CLASS_QUERY(Multi)
1018 DEFINE_CLASS_QUERY(MultiBranch)
1019 DEFINE_CLASS_QUERY(MulVL)
1020 DEFINE_CLASS_QUERY(NarrowMemProj)
1021 DEFINE_CLASS_QUERY(Neg)
1022 DEFINE_CLASS_QUERY(NegV)
1023 DEFINE_CLASS_QUERY(NeverBranch)
1024 DEFINE_CLASS_QUERY(Opaque1)
1025 DEFINE_CLASS_QUERY(OpaqueConstantBool)
1026 DEFINE_CLASS_QUERY(OpaqueInitializedAssertionPredicate)
1027 DEFINE_CLASS_QUERY(OpaqueTemplateAssertionPredicate)
1028 DEFINE_CLASS_QUERY(OpaqueLoopInit)
1029 DEFINE_CLASS_QUERY(OpaqueLoopStride)
1030 DEFINE_CLASS_QUERY(OpaqueMultiversioning)
1031 DEFINE_CLASS_QUERY(OuterStripMinedLoop)
1032 DEFINE_CLASS_QUERY(OuterStripMinedLoopEnd)
1033 DEFINE_CLASS_QUERY(Parm)
1034 DEFINE_CLASS_QUERY(ParsePredicate)
1035 DEFINE_CLASS_QUERY(PCTable)
1036 DEFINE_CLASS_QUERY(Phi)
1037 DEFINE_CLASS_QUERY(Proj)
1038 DEFINE_CLASS_QUERY(ReachabilityFence)
1039 DEFINE_CLASS_QUERY(Reduction)
1040 DEFINE_CLASS_QUERY(Region)
1041 DEFINE_CLASS_QUERY(Root)
1042 DEFINE_CLASS_QUERY(SafePoint)
1043 DEFINE_CLASS_QUERY(SafePointScalarObject)
1044 DEFINE_CLASS_QUERY(SafePointScalarMerge)
1045 DEFINE_CLASS_QUERY(Start)
1046 DEFINE_CLASS_QUERY(Store)
1047 DEFINE_CLASS_QUERY(Sub)
1048 DEFINE_CLASS_QUERY(SubTypeCheck)
1049 DEFINE_CLASS_QUERY(Type)
1050 DEFINE_CLASS_QUERY(InlineType)
1051 DEFINE_CLASS_QUERY(LoadFlat)
1052 DEFINE_CLASS_QUERY(StoreFlat)
1053 DEFINE_CLASS_QUERY(Vector)
1054 DEFINE_CLASS_QUERY(VectorMaskCmp)
1055 DEFINE_CLASS_QUERY(VectorUnbox)
1056 DEFINE_CLASS_QUERY(VectorReinterpret)
1057 DEFINE_CLASS_QUERY(CompressV)
1058 DEFINE_CLASS_QUERY(ExpandV)
1059 DEFINE_CLASS_QUERY(CompressM)
1060 DEFINE_CLASS_QUERY(LoadVector)
1061 DEFINE_CLASS_QUERY(LoadVectorGather)
1062 DEFINE_CLASS_QUERY(LoadVectorMasked)
1063 DEFINE_CLASS_QUERY(LoadVectorGatherMasked)
1064 DEFINE_CLASS_QUERY(StoreVector)
1065 DEFINE_CLASS_QUERY(StoreVectorScatter)
1066 DEFINE_CLASS_QUERY(StoreVectorMasked)
1067 DEFINE_CLASS_QUERY(StoreVectorScatterMasked)
1068 DEFINE_CLASS_QUERY(SaturatingVector)
1069 DEFINE_CLASS_QUERY(ShiftV)
1070 DEFINE_CLASS_QUERY(Unlock)
1071
1072 #undef DEFINE_CLASS_QUERY
1327 // Determine if a node is a counted loop induction variable.
1328 // NOTE: The method is defined in "loopnode.cpp".
1329 bool is_cloop_ind_var() const;
1330
1331 // Return a node with opcode "opc" and same inputs as "this" if one can
1332 // be found; Otherwise return null;
1333 Node* find_similar(int opc);
1334 bool has_same_inputs_as(const Node* other) const;
1335
1336 // Return the unique control out if only one. Null if none or more than one.
1337 Node* unique_ctrl_out_or_null() const;
1338 // Return the unique control out. Asserts if none or more than one control out.
1339 Node* unique_ctrl_out() const;
1340
1341 // Set control or add control as precedence edge
1342 void ensure_control_or_add_prec(Node* c);
1343 void add_prec_from(Node* n);
1344
1345 // Visit boundary uses of the node and apply a callback function for each.
1346 // Recursively traverse uses, stopping and applying the callback when
1347 // reaching a boundary node, defined by is_boundary. If callback_on_all is true,
1348 // it applies the callback on all the nodes seen, and not only on the boundary
1349 // nodes. Note: the function definition appears after the complete type
1350 // definition of Node_List.
1351 template <typename Callback, typename Check>
1352 void visit_uses(Callback callback, Check is_boundary, bool always_callback = false) const;
1353
1354 //----------------- Code Generation
1355
1356 // Ideal register class for Matching. Zero means unmatched instruction
1357 // (these are cloned instead of converted to machine nodes).
1358 virtual uint ideal_reg() const;
1359
1360 static const uint NotAMachineReg; // must be > max. machine register
1361
1362 // Do we Match on this edge index or not? Generally false for Control
1363 // and true for everything else. Weird for calls & returns.
1364 virtual uint match_edge(uint idx) const;
1365
1366 // Register class output is returned in
1367 virtual const RegMask &out_RegMask() const;
1368 // Register class input is expected in
1369 virtual const RegMask &in_RegMask(uint) const;
1370 // Should we clone rather than spill this instruction?
1371 bool rematerialize() const;
1372
1849 void remove( uint i ) { Node_Array::remove(i); _cnt--; }
1850 void push( Node *b ) { map(_cnt++,b); }
1851 void yank( Node *n ); // Find and remove
1852 Node *pop() { return _nodes[--_cnt]; }
1853 void clear() { _cnt = 0; Node_Array::clear(); } // retain storage
1854 void copy(const Node_List& from) {
1855 if (from._max > _max) {
1856 grow(from._max);
1857 }
1858 _cnt = from._cnt;
1859 Copy::conjoint_words_to_higher((HeapWord*)&from._nodes[0], (HeapWord*)&_nodes[0], from._max * sizeof(Node*));
1860 }
1861
1862 uint size() const { return _cnt; }
1863 void dump() const;
1864 void dump_simple() const;
1865 };
1866
1867 // Definition must appear after complete type definition of Node_List
1868 template <typename Callback, typename Check>
1869 void Node::visit_uses(Callback callback, Check is_boundary, bool always_callback) const {
1870 ResourceMark rm;
1871 VectorSet visited;
1872 Node_List worklist;
1873
1874 // The initial worklist consists of the direct uses
1875 for (DUIterator_Fast kmax, k = fast_outs(kmax); k < kmax; k++) {
1876 Node* out = fast_out(k);
1877 if (!visited.test_set(out->_idx)) { worklist.push(out); }
1878 }
1879
1880 while (worklist.size() > 0) {
1881 Node* use = worklist.pop();
1882 bool boundary = is_boundary(use);
1883 if (boundary || always_callback) {
1884 callback(use);
1885 }
1886 if (!boundary) {
1887 // Not a boundary node, continue search
1888 for (DUIterator_Fast kmax, k = use->fast_outs(kmax); k < kmax; k++) {
1889 Node* out = use->fast_out(k);
1890 if (!visited.test_set(out->_idx)) { worklist.push(out); }
1891 }
1892 }
1893 }
1894 }
1895
1896
1897 //------------------------------Unique_Node_List-------------------------------
1898 class Unique_Node_List : public Node_List {
1899 VectorSet _in_worklist;
1900 uint _clock_index; // Index in list where to pop from next
1901 public:
1902 Unique_Node_List() : Node_List(), _clock_index(0) {}
1903 Unique_Node_List(Arena *a) : Node_List(a), _in_worklist(a), _clock_index(0) {}
1904
1905 NONCOPYABLE(Unique_Node_List);
1906 Unique_Node_List& operator=(Unique_Node_List&&) = delete;
|