| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // merge node or expanding an existing merge node if necessary. | 87 // merge node or expanding an existing merge node if necessary. |
| 88 static void MergeControlToEnd(Graph* graph, CommonOperatorBuilder* common, | 88 static void MergeControlToEnd(Graph* graph, CommonOperatorBuilder* common, |
| 89 Node* node); | 89 Node* node); |
| 90 | 90 |
| 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 |
| 98 // currently in a state that satisfies constraints of the new operator. |
| 99 static void ChangeOp(Node* node, const Operator* new_op); |
| 100 |
| 97 // --------------------------------------------------------------------------- | 101 // --------------------------------------------------------------------------- |
| 98 // Miscellaneous utilities. | 102 // Miscellaneous utilities. |
| 99 | 103 |
| 100 static Node* FindProjection(Node* node, size_t projection_index); | 104 static Node* FindProjection(Node* node, size_t projection_index); |
| 101 | 105 |
| 102 // Collect the branch-related projections from a node, such as IfTrue, | 106 // Collect the branch-related projections from a node, such as IfTrue, |
| 103 // IfFalse, IfSuccess, IfException, IfValue and IfDefault. | 107 // IfFalse, IfSuccess, IfException, IfValue and IfDefault. |
| 104 // - Branch: [ IfTrue, IfFalse ] | 108 // - Branch: [ IfTrue, IfFalse ] |
| 105 // - Call : [ IfSuccess, IfException ] | 109 // - Call : [ IfSuccess, IfException ] |
| 106 // - Switch: [ IfValue, ..., IfDefault ] | 110 // - Switch: [ IfValue, ..., IfDefault ] |
| (...skipping 17 matching lines...) Expand all Loading... |
| 124 | 128 |
| 125 private: | 129 private: |
| 126 static inline bool IsInputRange(Edge edge, int first, int count); | 130 static inline bool IsInputRange(Edge edge, int first, int count); |
| 127 }; | 131 }; |
| 128 | 132 |
| 129 } // namespace compiler | 133 } // namespace compiler |
| 130 } // namespace internal | 134 } // namespace internal |
| 131 } // namespace v8 | 135 } // namespace v8 |
| 132 | 136 |
| 133 #endif // V8_COMPILER_NODE_PROPERTIES_H_ | 137 #endif // V8_COMPILER_NODE_PROPERTIES_H_ |
| OLD | NEW |