| 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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 | 760 |
| 761 | 761 |
| 762 struct SimplifiedLoweringPhase { | 762 struct SimplifiedLoweringPhase { |
| 763 static const char* phase_name() { return "simplified lowering"; } | 763 static const char* phase_name() { return "simplified lowering"; } |
| 764 | 764 |
| 765 void Run(PipelineData* data, Zone* temp_zone) { | 765 void Run(PipelineData* data, Zone* temp_zone) { |
| 766 SimplifiedLowering lowering(data->jsgraph(), temp_zone, | 766 SimplifiedLowering lowering(data->jsgraph(), temp_zone, |
| 767 data->source_positions()); | 767 data->source_positions()); |
| 768 lowering.LowerAllNodes(); | 768 lowering.LowerAllNodes(); |
| 769 | 769 |
| 770 // TODO(bmeurer): See comment on SimplifiedLowering::abort_compilation_. |
| 771 if (lowering.abort_compilation_) { |
| 772 data->set_compilation_failed(); |
| 773 return; |
| 774 } |
| 775 |
| 770 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 776 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
| 771 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), | 777 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
| 772 data->common()); | 778 data->common()); |
| 773 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); | 779 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); |
| 774 ValueNumberingReducer value_numbering(temp_zone); | 780 ValueNumberingReducer value_numbering(temp_zone); |
| 775 MachineOperatorReducer machine_reducer(data->jsgraph()); | 781 MachineOperatorReducer machine_reducer(data->jsgraph()); |
| 776 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 782 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| 777 data->common(), data->machine()); | 783 data->common(), data->machine()); |
| 778 AddReducer(data, &graph_reducer, &dead_code_elimination); | 784 AddReducer(data, &graph_reducer, &dead_code_elimination); |
| 779 AddReducer(data, &graph_reducer, &simple_reducer); | 785 AddReducer(data, &graph_reducer, &simple_reducer); |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. | 1276 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. |
| 1271 RunPrintAndVerify("Late trimmed", true); | 1277 RunPrintAndVerify("Late trimmed", true); |
| 1272 | 1278 |
| 1273 BeginPhaseKind("block building"); | 1279 BeginPhaseKind("block building"); |
| 1274 | 1280 |
| 1275 data.source_positions()->RemoveDecorator(); | 1281 data.source_positions()->RemoveDecorator(); |
| 1276 | 1282 |
| 1277 // Kill the Typer and thereby uninstall the decorator (if any). | 1283 // Kill the Typer and thereby uninstall the decorator (if any). |
| 1278 typer.Reset(nullptr); | 1284 typer.Reset(nullptr); |
| 1279 | 1285 |
| 1286 // TODO(bmeurer): See comment on SimplifiedLowering::abort_compilation_. |
| 1287 if (data.compilation_failed()) return Handle<Code>::null(); |
| 1288 |
| 1280 return ScheduleAndGenerateCode( | 1289 return ScheduleAndGenerateCode( |
| 1281 Linkage::ComputeIncoming(data.instruction_zone(), info())); | 1290 Linkage::ComputeIncoming(data.instruction_zone(), info())); |
| 1282 } | 1291 } |
| 1283 | 1292 |
| 1284 | 1293 |
| 1285 Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate, | 1294 Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate, |
| 1286 CallDescriptor* call_descriptor, | 1295 CallDescriptor* call_descriptor, |
| 1287 Graph* graph, Schedule* schedule, | 1296 Graph* graph, Schedule* schedule, |
| 1288 Code::Flags flags, | 1297 Code::Flags flags, |
| 1289 const char* debug_name) { | 1298 const char* debug_name) { |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1560 } | 1569 } |
| 1561 | 1570 |
| 1562 data->DeleteRegisterAllocationZone(); | 1571 data->DeleteRegisterAllocationZone(); |
| 1563 } | 1572 } |
| 1564 | 1573 |
| 1565 Isolate* Pipeline::isolate() const { return info()->isolate(); } | 1574 Isolate* Pipeline::isolate() const { return info()->isolate(); } |
| 1566 | 1575 |
| 1567 } // namespace compiler | 1576 } // namespace compiler |
| 1568 } // namespace internal | 1577 } // namespace internal |
| 1569 } // namespace v8 | 1578 } // namespace v8 |
| OLD | NEW |