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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Replace value uses of {node} with {value} and effect uses of {node} with | 83 // Replace value uses of {node} with {value} and effect uses of {node} with |
84 // {effect}. If {effect == NULL}, then use the effect input to {node}. | 84 // {effect}. If {effect == NULL}, then use the effect input to {node}. |
85 static void ReplaceWithValue(Node* node, Node* value, Node* effect = nullptr); | 85 static void ReplaceWithValue(Node* node, Node* value, Node* effect = nullptr); |
86 | 86 |
87 | 87 |
88 // --------------------------------------------------------------------------- | 88 // --------------------------------------------------------------------------- |
89 // Miscellaneous utilities. | 89 // Miscellaneous utilities. |
90 | 90 |
91 static Node* FindProjection(Node* node, size_t projection_index); | 91 static Node* FindProjection(Node* node, size_t projection_index); |
92 | 92 |
| 93 // Collect the branch-related projections from a node, such as IfTrue, |
| 94 // IfFalse, IfValue and IfDefault. |
| 95 // - Branch: [ IfTrue, IfFalse ] |
| 96 // - Switch: [ IfValue, ..., IfDefault ] |
| 97 static void CollectControlProjections(Node* node, Node** proj, size_t count); |
| 98 |
93 | 99 |
94 // --------------------------------------------------------------------------- | 100 // --------------------------------------------------------------------------- |
95 // Type Bounds. | 101 // Type Bounds. |
96 | 102 |
97 static bool IsTyped(Node* node) { | 103 static bool IsTyped(Node* node) { |
98 Bounds const bounds = node->bounds(); | 104 Bounds const bounds = node->bounds(); |
99 DCHECK(!bounds.lower == !bounds.upper); | 105 DCHECK(!bounds.lower == !bounds.upper); |
100 return bounds.upper; | 106 return bounds.upper; |
101 } | 107 } |
102 static Bounds GetBounds(Node* node) { | 108 static Bounds GetBounds(Node* node) { |
(...skipping 10 matching lines...) Expand all Loading... |
113 | 119 |
114 private: | 120 private: |
115 static inline bool IsInputRange(Edge edge, int first, int count); | 121 static inline bool IsInputRange(Edge edge, int first, int count); |
116 }; | 122 }; |
117 | 123 |
118 } // namespace compiler | 124 } // namespace compiler |
119 } // namespace internal | 125 } // namespace internal |
120 } // namespace v8 | 126 } // namespace v8 |
121 | 127 |
122 #endif // V8_COMPILER_NODE_PROPERTIES_H_ | 128 #endif // V8_COMPILER_NODE_PROPERTIES_H_ |
OLD | NEW |