OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "test/cctest/compiler/simplified-graph-builder.h" | 5 #include "test/cctest/compiler/simplified-graph-builder.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace compiler { | 9 namespace compiler { |
10 | 10 |
11 SimplifiedGraphBuilder::SimplifiedGraphBuilder( | 11 SimplifiedGraphBuilder::SimplifiedGraphBuilder( |
12 Graph* graph, CommonOperatorBuilder* common, | 12 Graph* graph, CommonOperatorBuilder* common, |
13 MachineOperatorBuilder* machine, SimplifiedOperatorBuilder* simplified) | 13 MachineOperatorBuilder* machine, SimplifiedOperatorBuilder* simplified) |
14 : StructuredGraphBuilder(graph, common), | 14 : StructuredGraphBuilder(graph, common), |
15 machine_(machine), | 15 machine_(machine), |
16 simplified_(simplified) {} | 16 simplified_(simplified) {} |
17 | 17 |
18 | 18 |
19 void SimplifiedGraphBuilder::Begin() { | 19 void SimplifiedGraphBuilder::Begin(int num_parameters) { |
20 DCHECK(graph()->start() == NULL); | 20 DCHECK(graph()->start() == NULL); |
21 Node* start = graph()->NewNode(common()->Start()); | 21 Node* start = graph()->NewNode(common()->Start(num_parameters)); |
22 graph()->SetStart(start); | 22 graph()->SetStart(start); |
23 set_environment(new (zone()) Environment(this, start)); | 23 set_environment(new (zone()) Environment(this, start)); |
24 } | 24 } |
25 | 25 |
26 | 26 |
27 void SimplifiedGraphBuilder::Return(Node* value) { | 27 void SimplifiedGraphBuilder::Return(Node* value) { |
28 Node* control = NewNode(common()->Return(), value); | 28 Node* control = NewNode(common()->Return(), value); |
29 UpdateControlDependencyToLeaveFunction(control); | 29 UpdateControlDependencyToLeaveFunction(control); |
30 } | 30 } |
31 | 31 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 Node* SimplifiedGraphBuilder::Environment::Peek(size_t depth) { | 70 Node* SimplifiedGraphBuilder::Environment::Peek(size_t depth) { |
71 DCHECK(depth < values()->size()); | 71 DCHECK(depth < values()->size()); |
72 size_t index = values()->size() - depth - 1; | 72 size_t index = values()->size() - depth - 1; |
73 return values()->at(index); | 73 return values()->at(index); |
74 } | 74 } |
75 | 75 |
76 } // namespace compiler | 76 } // namespace compiler |
77 } // namespace internal | 77 } // namespace internal |
78 } // namespace v8 | 78 } // namespace v8 |
OLD | NEW |