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 "src/compiler/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
6 #include "src/compiler/scheduler.h" | 6 #include "src/compiler/scheduler.h" |
7 #include "src/compiler/structured-machine-assembler.h" | 7 #include "src/compiler/structured-machine-assembler.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 10 matching lines...) Expand all Loading... |
21 MachineRepresentation word) | 21 MachineRepresentation word) |
22 : GraphBuilder(graph), | 22 : GraphBuilder(graph), |
23 schedule_(new (zone()) Schedule(zone())), | 23 schedule_(new (zone()) Schedule(zone())), |
24 machine_(zone(), word), | 24 machine_(zone(), word), |
25 common_(zone()), | 25 common_(zone()), |
26 call_descriptor_builder_(call_descriptor_builder), | 26 call_descriptor_builder_(call_descriptor_builder), |
27 parameters_(NULL), | 27 parameters_(NULL), |
28 current_environment_(new (zone()) | 28 current_environment_(new (zone()) |
29 Environment(zone(), schedule()->entry(), false)), | 29 Environment(zone(), schedule()->entry(), false)), |
30 number_of_variables_(0) { | 30 number_of_variables_(0) { |
| 31 Node* s = graph->NewNode(common_.Start(parameter_count())); |
| 32 graph->SetStart(s); |
31 if (parameter_count() == 0) return; | 33 if (parameter_count() == 0) return; |
32 parameters_ = zone()->NewArray<Node*>(parameter_count()); | 34 parameters_ = zone()->NewArray<Node*>(parameter_count()); |
33 for (int i = 0; i < parameter_count(); ++i) { | 35 for (int i = 0; i < parameter_count(); ++i) { |
34 parameters_[i] = NewNode(common()->Parameter(i)); | 36 parameters_[i] = NewNode(common()->Parameter(i), graph->start()); |
35 } | 37 } |
36 } | 38 } |
37 | 39 |
38 | 40 |
39 Schedule* StructuredMachineAssembler::Export() { | 41 Schedule* StructuredMachineAssembler::Export() { |
40 // Compute the correct codegen order. | 42 // Compute the correct codegen order. |
41 DCHECK(schedule_->rpo_order()->empty()); | 43 DCHECK(schedule_->rpo_order()->empty()); |
42 Scheduler scheduler(zone(), graph(), schedule_); | 44 Scheduler scheduler(zone(), graph(), schedule_); |
43 scheduler.ComputeSpecialRPO(); | 45 scheduler.ComputeSpecialRPO(); |
44 // Invalidate MachineAssembler. | 46 // Invalidate MachineAssembler. |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 } | 656 } |
655 pending_header_merges_.clear(); | 657 pending_header_merges_.clear(); |
656 pending_exit_merges_.clear(); | 658 pending_exit_merges_.clear(); |
657 header_environment_ = NULL; | 659 header_environment_ = NULL; |
658 DCHECK(IsDone()); | 660 DCHECK(IsDone()); |
659 } | 661 } |
660 | 662 |
661 } // namespace compiler | 663 } // namespace compiler |
662 } // namespace internal | 664 } // namespace internal |
663 } // namespace v8 | 665 } // namespace v8 |
OLD | NEW |