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_GRAPH_BUILDER_H_ | 5 #ifndef V8_COMPILER_GRAPH_BUILDER_H_ |
6 #define V8_COMPILER_GRAPH_BUILDER_H_ | 6 #define V8_COMPILER_GRAPH_BUILDER_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Helpers for merging control, effect or value dependencies. | 92 // Helpers for merging control, effect or value dependencies. |
93 Node* MergeControl(Node* control, Node* other); | 93 Node* MergeControl(Node* control, Node* other); |
94 Node* MergeEffect(Node* value, Node* other, Node* control); | 94 Node* MergeEffect(Node* value, Node* other, Node* control); |
95 Node* MergeValue(Node* value, Node* other, Node* control); | 95 Node* MergeValue(Node* value, Node* other, Node* control); |
96 | 96 |
97 // Helpers to create new control nodes. | 97 // Helpers to create new control nodes. |
98 Node* NewIfTrue() { return NewNode(common()->IfTrue()); } | 98 Node* NewIfTrue() { return NewNode(common()->IfTrue()); } |
99 Node* NewIfFalse() { return NewNode(common()->IfFalse()); } | 99 Node* NewIfFalse() { return NewNode(common()->IfFalse()); } |
100 Node* NewMerge() { return NewNode(common()->Merge(1), true); } | 100 Node* NewMerge() { return NewNode(common()->Merge(1), true); } |
101 Node* NewLoop() { return NewNode(common()->Loop(1), true); } | 101 Node* NewLoop() { return NewNode(common()->Loop(1), true); } |
102 Node* NewBranch(Node* condition) { | 102 Node* NewBranch(Node* condition, BranchHint hint = BranchHint::kNone) { |
103 return NewNode(common()->Branch(), condition); | 103 return NewNode(common()->Branch(hint), condition); |
104 } | 104 } |
105 | 105 |
106 protected: | 106 protected: |
107 class Environment; | 107 class Environment; |
108 friend class Environment; | 108 friend class Environment; |
109 friend class ControlBuilder; | 109 friend class ControlBuilder; |
110 | 110 |
111 // The following method creates a new node having the specified operator and | 111 // The following method creates a new node having the specified operator and |
112 // ensures effect and control dependencies are wired up. The dependencies | 112 // ensures effect and control dependencies are wired up. The dependencies |
113 // tracked by the environment might be mutated. | 113 // tracked by the environment might be mutated. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 StructuredGraphBuilder* builder_; | 236 StructuredGraphBuilder* builder_; |
237 Node* control_dependency_; | 237 Node* control_dependency_; |
238 Node* effect_dependency_; | 238 Node* effect_dependency_; |
239 NodeVector values_; | 239 NodeVector values_; |
240 }; | 240 }; |
241 } | 241 } |
242 } | 242 } |
243 } // namespace v8::internal::compiler | 243 } // namespace v8::internal::compiler |
244 | 244 |
245 #endif // V8_COMPILER_GRAPH_BUILDER_H__ | 245 #endif // V8_COMPILER_GRAPH_BUILDER_H__ |
OLD | NEW |