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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 }; | 690 }; |
691 | 691 |
692 | 692 |
693 struct SimplifiedLoweringPhase { | 693 struct SimplifiedLoweringPhase { |
694 static const char* phase_name() { return "simplified lowering"; } | 694 static const char* phase_name() { return "simplified lowering"; } |
695 | 695 |
696 void Run(PipelineData* data, Zone* temp_zone) { | 696 void Run(PipelineData* data, Zone* temp_zone) { |
697 SimplifiedLowering lowering(data->jsgraph(), temp_zone, | 697 SimplifiedLowering lowering(data->jsgraph(), temp_zone, |
698 data->source_positions()); | 698 data->source_positions()); |
699 lowering.LowerAllNodes(); | 699 lowering.LowerAllNodes(); |
| 700 |
| 701 // TODO(bmeurer): See comment on SimplifiedLowering::abort_compilation_. |
| 702 if (lowering.abort_compilation_) { |
| 703 data->set_compilation_failed(); |
| 704 return; |
| 705 } |
| 706 |
700 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 707 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
701 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), | 708 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
702 data->common()); | 709 data->common()); |
703 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); | 710 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); |
704 ValueNumberingReducer value_numbering(temp_zone); | 711 ValueNumberingReducer value_numbering(temp_zone); |
705 MachineOperatorReducer machine_reducer(data->jsgraph()); | 712 MachineOperatorReducer machine_reducer(data->jsgraph()); |
706 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 713 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
707 data->common(), data->machine()); | 714 data->common(), data->machine()); |
708 AddReducer(data, &graph_reducer, &dead_code_elimination); | 715 AddReducer(data, &graph_reducer, &dead_code_elimination); |
709 AddReducer(data, &graph_reducer, &simple_reducer); | 716 AddReducer(data, &graph_reducer, &simple_reducer); |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. | 1217 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. |
1211 RunPrintAndVerify("Late trimmed", true); | 1218 RunPrintAndVerify("Late trimmed", true); |
1212 | 1219 |
1213 BeginPhaseKind("block building"); | 1220 BeginPhaseKind("block building"); |
1214 | 1221 |
1215 data.source_positions()->RemoveDecorator(); | 1222 data.source_positions()->RemoveDecorator(); |
1216 | 1223 |
1217 // Kill the Typer and thereby uninstall the decorator (if any). | 1224 // Kill the Typer and thereby uninstall the decorator (if any). |
1218 typer.Reset(nullptr); | 1225 typer.Reset(nullptr); |
1219 | 1226 |
| 1227 // TODO(bmeurer): See comment on SimplifiedLowering::abort_compilation_. |
| 1228 if (data.compilation_failed()) return Handle<Code>::null(); |
| 1229 |
1220 return ScheduleAndGenerateCode( | 1230 return ScheduleAndGenerateCode( |
1221 Linkage::ComputeIncoming(data.instruction_zone(), info())); | 1231 Linkage::ComputeIncoming(data.instruction_zone(), info())); |
1222 } | 1232 } |
1223 | 1233 |
1224 | 1234 |
1225 Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate, | 1235 Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate, |
1226 CallDescriptor* call_descriptor, | 1236 CallDescriptor* call_descriptor, |
1227 Graph* graph, Schedule* schedule, | 1237 Graph* graph, Schedule* schedule, |
1228 Code::Flags flags, | 1238 Code::Flags flags, |
1229 const char* debug_name) { | 1239 const char* debug_name) { |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 } | 1512 } |
1503 | 1513 |
1504 data->DeleteRegisterAllocationZone(); | 1514 data->DeleteRegisterAllocationZone(); |
1505 } | 1515 } |
1506 | 1516 |
1507 Isolate* Pipeline::isolate() const { return info()->isolate(); } | 1517 Isolate* Pipeline::isolate() const { return info()->isolate(); } |
1508 | 1518 |
1509 } // namespace compiler | 1519 } // namespace compiler |
1510 } // namespace internal | 1520 } // namespace internal |
1511 } // namespace v8 | 1521 } // namespace v8 |
OLD | NEW |