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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 bool has_context = OperatorProperties::HasContextInput(op); | 35 bool has_context = OperatorProperties::HasContextInput(op); |
36 bool has_framestate = OperatorProperties::HasFrameStateInput(op); | 36 bool has_framestate = OperatorProperties::HasFrameStateInput(op); |
37 bool has_control = OperatorProperties::GetControlInputCount(op) == 1; | 37 bool has_control = OperatorProperties::GetControlInputCount(op) == 1; |
38 bool has_effect = OperatorProperties::GetEffectInputCount(op) == 1; | 38 bool has_effect = OperatorProperties::GetEffectInputCount(op) == 1; |
39 | 39 |
40 DCHECK(OperatorProperties::GetControlInputCount(op) < 2); | 40 DCHECK(OperatorProperties::GetControlInputCount(op) < 2); |
41 DCHECK(OperatorProperties::GetEffectInputCount(op) < 2); | 41 DCHECK(OperatorProperties::GetEffectInputCount(op) < 2); |
42 | 42 |
43 Node* result = NULL; | 43 Node* result = NULL; |
44 if (!has_context && !has_control && !has_effect) { | 44 if (!has_context && !has_framestate && !has_control && !has_effect) { |
45 result = graph()->NewNode(op, value_input_count, value_inputs); | 45 result = graph()->NewNode(op, value_input_count, value_inputs); |
46 } else { | 46 } else { |
47 int input_count_with_deps = value_input_count; | 47 int input_count_with_deps = value_input_count; |
48 if (has_context) ++input_count_with_deps; | 48 if (has_context) ++input_count_with_deps; |
49 if (has_framestate) ++input_count_with_deps; | 49 if (has_framestate) ++input_count_with_deps; |
50 if (has_control) ++input_count_with_deps; | 50 if (has_control) ++input_count_with_deps; |
51 if (has_effect) ++input_count_with_deps; | 51 if (has_effect) ++input_count_with_deps; |
52 Node** buffer = zone()->NewArray<Node*>(input_count_with_deps); | 52 Node** buffer = zone()->NewArray<Node*>(input_count_with_deps); |
53 memcpy(buffer, value_inputs, kPointerSize * value_input_count); | 53 memcpy(buffer, value_inputs, kPointerSize * value_input_count); |
54 Node** current_input = buffer + value_input_count; | 54 Node** current_input = buffer + value_input_count; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 if (!dead_control_.is_set()) { | 239 if (!dead_control_.is_set()) { |
240 Node* dead_node = graph()->NewNode(common_->Dead()); | 240 Node* dead_node = graph()->NewNode(common_->Dead()); |
241 dead_control_.set(dead_node); | 241 dead_control_.set(dead_node); |
242 return dead_node; | 242 return dead_node; |
243 } | 243 } |
244 return dead_control_.get(); | 244 return dead_control_.get(); |
245 } | 245 } |
246 } | 246 } |
247 } | 247 } |
248 } // namespace v8::internal::compiler | 248 } // namespace v8::internal::compiler |
OLD | NEW |