OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_NODE_PROPERTIES_H_ | 5 #ifndef V8_COMPILER_NODE_PROPERTIES_H_ |
6 #define V8_COMPILER_NODE_PROPERTIES_H_ | 6 #define V8_COMPILER_NODE_PROPERTIES_H_ |
7 | 7 |
8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
9 #include "src/types.h" | 9 #include "src/types.h" |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 // Replace all uses of {node} with the given replacement nodes. All occurring | 91 // Replace all uses of {node} with the given replacement nodes. All occurring |
92 // use kinds need to be replaced, {NULL} is only valid if a use kind is | 92 // use kinds need to be replaced, {NULL} is only valid if a use kind is |
93 // guaranteed not to exist. | 93 // guaranteed not to exist. |
94 static void ReplaceUses(Node* node, Node* value, Node* effect = nullptr, | 94 static void ReplaceUses(Node* node, Node* value, Node* effect = nullptr, |
95 Node* success = nullptr, Node* exception = nullptr); | 95 Node* success = nullptr, Node* exception = nullptr); |
96 | 96 |
97 // Safe wrapper to mutate the operator of a node. Checks that the node is | 97 // Safe wrapper to mutate the operator of a node. Checks that the node is |
98 // currently in a state that satisfies constraints of the new operator. | 98 // currently in a state that satisfies constraints of the new operator. |
99 static void ChangeOp(Node* node, const Operator* new_op); | 99 static void ChangeOp(Node* node, const Operator* new_op); |
100 | 100 |
101 // Verifies consistency of node inputs and uses: | |
102 // - node inputs should agree with the input count computed from | |
103 // the node's operator. | |
104 // - effect inputs should have effect outputs. | |
105 // - control inputs should have control outputs. | |
106 // - frame state inputs should be frame states. | |
107 // - if the node has control uses, it should produce control. | |
108 // - if the node has effect uses, it should produce effect. | |
109 // - if the node has frame state uses, it must be a frame state. | |
110 static void Verify(Node* node); | |
Michael Starzinger
2015/09/25 08:16:45
nit: This is not really a "miscellaneous mutator"
Jarin
2015/09/25 08:20:06
Done.
| |
111 | |
101 // --------------------------------------------------------------------------- | 112 // --------------------------------------------------------------------------- |
102 // Miscellaneous utilities. | 113 // Miscellaneous utilities. |
103 | 114 |
104 static Node* FindProjection(Node* node, size_t projection_index); | 115 static Node* FindProjection(Node* node, size_t projection_index); |
105 | 116 |
106 // Collect the branch-related projections from a node, such as IfTrue, | 117 // Collect the branch-related projections from a node, such as IfTrue, |
107 // IfFalse, IfSuccess, IfException, IfValue and IfDefault. | 118 // IfFalse, IfSuccess, IfException, IfValue and IfDefault. |
108 // - Branch: [ IfTrue, IfFalse ] | 119 // - Branch: [ IfTrue, IfFalse ] |
109 // - Call : [ IfSuccess, IfException ] | 120 // - Call : [ IfSuccess, IfException ] |
110 // - Switch: [ IfValue, ..., IfDefault ] | 121 // - Switch: [ IfValue, ..., IfDefault ] |
(...skipping 17 matching lines...) Expand all Loading... | |
128 | 139 |
129 private: | 140 private: |
130 static inline bool IsInputRange(Edge edge, int first, int count); | 141 static inline bool IsInputRange(Edge edge, int first, int count); |
131 }; | 142 }; |
132 | 143 |
133 } // namespace compiler | 144 } // namespace compiler |
134 } // namespace internal | 145 } // namespace internal |
135 } // namespace v8 | 146 } // namespace v8 |
136 | 147 |
137 #endif // V8_COMPILER_NODE_PROPERTIES_H_ | 148 #endif // V8_COMPILER_NODE_PROPERTIES_H_ |
OLD | NEW |