| 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 | 6 |
| 7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/base/adapters.h" | 10 #include "src/base/adapters.h" |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 }; | 670 }; |
| 671 | 671 |
| 672 | 672 |
| 673 struct SimplifiedLoweringPhase { | 673 struct SimplifiedLoweringPhase { |
| 674 static const char* phase_name() { return "simplified lowering"; } | 674 static const char* phase_name() { return "simplified lowering"; } |
| 675 | 675 |
| 676 void Run(PipelineData* data, Zone* temp_zone) { | 676 void Run(PipelineData* data, Zone* temp_zone) { |
| 677 SimplifiedLowering lowering(data->jsgraph(), temp_zone, | 677 SimplifiedLowering lowering(data->jsgraph(), temp_zone, |
| 678 data->source_positions()); | 678 data->source_positions()); |
| 679 lowering.LowerAllNodes(); | 679 lowering.LowerAllNodes(); |
| 680 |
| 681 // TODO(bmeurer): See comment on SimplifiedLowering::abort_compilation_. |
| 682 if (lowering.abort_compilation_) { |
| 683 data->set_compilation_failed(); |
| 684 return; |
| 685 } |
| 686 |
| 680 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 687 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
| 681 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), | 688 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
| 682 data->common()); | 689 data->common()); |
| 683 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); | 690 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); |
| 684 ValueNumberingReducer value_numbering(temp_zone); | 691 ValueNumberingReducer value_numbering(temp_zone); |
| 685 MachineOperatorReducer machine_reducer(data->jsgraph()); | 692 MachineOperatorReducer machine_reducer(data->jsgraph()); |
| 686 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 693 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| 687 data->common(), data->machine()); | 694 data->common(), data->machine()); |
| 688 AddReducer(data, &graph_reducer, &dead_code_elimination); | 695 AddReducer(data, &graph_reducer, &dead_code_elimination); |
| 689 AddReducer(data, &graph_reducer, &simple_reducer); | 696 AddReducer(data, &graph_reducer, &simple_reducer); |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. | 1204 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. |
| 1198 RunPrintAndVerify("Late trimmed", true); | 1205 RunPrintAndVerify("Late trimmed", true); |
| 1199 | 1206 |
| 1200 BeginPhaseKind("block building"); | 1207 BeginPhaseKind("block building"); |
| 1201 | 1208 |
| 1202 data.source_positions()->RemoveDecorator(); | 1209 data.source_positions()->RemoveDecorator(); |
| 1203 | 1210 |
| 1204 // Kill the Typer and thereby uninstall the decorator (if any). | 1211 // Kill the Typer and thereby uninstall the decorator (if any). |
| 1205 typer.Reset(nullptr); | 1212 typer.Reset(nullptr); |
| 1206 | 1213 |
| 1214 // TODO(bmeurer): See comment on SimplifiedLowering::abort_compilation_. |
| 1215 if (data.compilation_failed()) return Handle<Code>::null(); |
| 1216 |
| 1207 return ScheduleAndGenerateCode( | 1217 return ScheduleAndGenerateCode( |
| 1208 Linkage::ComputeIncoming(data.instruction_zone(), info())); | 1218 Linkage::ComputeIncoming(data.instruction_zone(), info())); |
| 1209 } | 1219 } |
| 1210 | 1220 |
| 1211 | 1221 |
| 1212 Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate, | 1222 Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate, |
| 1213 CallDescriptor* call_descriptor, | 1223 CallDescriptor* call_descriptor, |
| 1214 Graph* graph, Schedule* schedule, | 1224 Graph* graph, Schedule* schedule, |
| 1215 Code::Kind kind, | 1225 Code::Kind kind, |
| 1216 const char* debug_name) { | 1226 const char* debug_name) { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 tcf << AsC1VRegisterAllocationData("CodeGen", | 1488 tcf << AsC1VRegisterAllocationData("CodeGen", |
| 1479 data->register_allocation_data()); | 1489 data->register_allocation_data()); |
| 1480 } | 1490 } |
| 1481 | 1491 |
| 1482 data->DeleteRegisterAllocationZone(); | 1492 data->DeleteRegisterAllocationZone(); |
| 1483 } | 1493 } |
| 1484 | 1494 |
| 1485 } // namespace compiler | 1495 } // namespace compiler |
| 1486 } // namespace internal | 1496 } // namespace internal |
| 1487 } // namespace v8 | 1497 } // namespace v8 |
| OLD | NEW |