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 #include "src/compiler/graph-builder.h" | 5 #include "src/compiler/graph-builder.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/generic-graph.h" | 8 #include "src/compiler/generic-graph.h" |
9 #include "src/compiler/generic-node.h" | 9 #include "src/compiler/generic-node.h" |
10 #include "src/compiler/generic-node-inl.h" | 10 #include "src/compiler/generic-node-inl.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 CommonOperatorBuilder* common) | 23 CommonOperatorBuilder* common) |
24 : GraphBuilder(graph), | 24 : GraphBuilder(graph), |
25 common_(common), | 25 common_(common), |
26 environment_(NULL), | 26 environment_(NULL), |
27 current_context_(NULL), | 27 current_context_(NULL), |
28 exit_control_(NULL) {} | 28 exit_control_(NULL) {} |
29 | 29 |
30 | 30 |
31 Node* StructuredGraphBuilder::MakeNode(Operator* op, int value_input_count, | 31 Node* StructuredGraphBuilder::MakeNode(Operator* op, int value_input_count, |
32 Node** value_inputs) { | 32 Node** value_inputs) { |
| 33 DCHECK(op->InputCount() == value_input_count); |
| 34 |
33 bool has_context = OperatorProperties::HasContextInput(op); | 35 bool has_context = OperatorProperties::HasContextInput(op); |
34 bool has_control = OperatorProperties::GetControlInputCount(op) == 1; | 36 bool has_control = OperatorProperties::GetControlInputCount(op) == 1; |
35 bool has_effect = OperatorProperties::GetEffectInputCount(op) == 1; | 37 bool has_effect = OperatorProperties::GetEffectInputCount(op) == 1; |
36 | 38 |
37 DCHECK(OperatorProperties::GetControlInputCount(op) < 2); | 39 DCHECK(OperatorProperties::GetControlInputCount(op) < 2); |
38 DCHECK(OperatorProperties::GetEffectInputCount(op) < 2); | 40 DCHECK(OperatorProperties::GetEffectInputCount(op) < 2); |
39 | 41 |
40 Node* result = NULL; | 42 Node* result = NULL; |
41 if (!has_context && !has_control && !has_effect) { | 43 if (!has_context && !has_control && !has_effect) { |
42 result = graph()->NewNode(op, value_input_count, value_inputs); | 44 result = graph()->NewNode(op, value_input_count, value_inputs); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 if (!dead_control_.is_set()) { | 234 if (!dead_control_.is_set()) { |
233 Node* dead_node = graph()->NewNode(common_->Dead()); | 235 Node* dead_node = graph()->NewNode(common_->Dead()); |
234 dead_control_.set(dead_node); | 236 dead_control_.set(dead_node); |
235 return dead_node; | 237 return dead_node; |
236 } | 238 } |
237 return dead_control_.get(); | 239 return dead_control_.get(); |
238 } | 240 } |
239 } | 241 } |
240 } | 242 } |
241 } // namespace v8::internal::compiler | 243 } // namespace v8::internal::compiler |
OLD | NEW |