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 <memory> | 8 #include <memory> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 | 929 |
930 void Run(PipelineData* data, Zone* temp_zone) { | 930 void Run(PipelineData* data, Zone* temp_zone) { |
931 EscapeAnalysis escape_analysis(data->graph(), data->jsgraph()->common(), | 931 EscapeAnalysis escape_analysis(data->graph(), data->jsgraph()->common(), |
932 temp_zone); | 932 temp_zone); |
933 escape_analysis.Run(); | 933 escape_analysis.Run(); |
934 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 934 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
935 EscapeAnalysisReducer escape_reducer(&graph_reducer, data->jsgraph(), | 935 EscapeAnalysisReducer escape_reducer(&graph_reducer, data->jsgraph(), |
936 &escape_analysis, temp_zone); | 936 &escape_analysis, temp_zone); |
937 AddReducer(data, &graph_reducer, &escape_reducer); | 937 AddReducer(data, &graph_reducer, &escape_reducer); |
938 graph_reducer.ReduceGraph(); | 938 graph_reducer.ReduceGraph(); |
| 939 if (escape_reducer.compilation_failed()) { |
| 940 data->set_compilation_failed(); |
| 941 return; |
| 942 } |
939 escape_reducer.VerifyReplacement(); | 943 escape_reducer.VerifyReplacement(); |
940 } | 944 } |
941 }; | 945 }; |
942 | 946 |
943 struct RepresentationSelectionPhase { | 947 struct RepresentationSelectionPhase { |
944 static const char* phase_name() { return "representation selection"; } | 948 static const char* phase_name() { return "representation selection"; } |
945 | 949 |
946 void Run(PipelineData* data, Zone* temp_zone) { | 950 void Run(PipelineData* data, Zone* temp_zone) { |
947 SimplifiedLowering lowering(data->jsgraph(), temp_zone, | 951 SimplifiedLowering lowering(data->jsgraph(), temp_zone, |
948 data->source_positions()); | 952 data->source_positions()); |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 } | 1547 } |
1544 | 1548 |
1545 if (!info()->shared_info()->asm_function()) { | 1549 if (!info()->shared_info()->asm_function()) { |
1546 if (FLAG_turbo_load_elimination) { | 1550 if (FLAG_turbo_load_elimination) { |
1547 Run<LoadEliminationPhase>(); | 1551 Run<LoadEliminationPhase>(); |
1548 RunPrintAndVerify("Load eliminated"); | 1552 RunPrintAndVerify("Load eliminated"); |
1549 } | 1553 } |
1550 | 1554 |
1551 if (FLAG_turbo_escape) { | 1555 if (FLAG_turbo_escape) { |
1552 Run<EscapeAnalysisPhase>(); | 1556 Run<EscapeAnalysisPhase>(); |
| 1557 if (data->compilation_failed()) { |
| 1558 info()->AbortOptimization(kCyclicObjectStateDetectedInEscapeAnalysis); |
| 1559 data->EndPhaseKind(); |
| 1560 return false; |
| 1561 } |
1553 RunPrintAndVerify("Escape Analysed"); | 1562 RunPrintAndVerify("Escape Analysed"); |
1554 } | 1563 } |
1555 } | 1564 } |
1556 } | 1565 } |
1557 | 1566 |
1558 // Select representations. This has to run w/o the Typer decorator, because | 1567 // Select representations. This has to run w/o the Typer decorator, because |
1559 // we cannot compute meaningful types anyways, and the computed types might | 1568 // we cannot compute meaningful types anyways, and the computed types might |
1560 // even conflict with the representation/truncation logic. | 1569 // even conflict with the representation/truncation logic. |
1561 Run<RepresentationSelectionPhase>(); | 1570 Run<RepresentationSelectionPhase>(); |
1562 RunPrintAndVerify("Representations selected", true); | 1571 RunPrintAndVerify("Representations selected", true); |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1964 data->DeleteRegisterAllocationZone(); | 1973 data->DeleteRegisterAllocationZone(); |
1965 } | 1974 } |
1966 | 1975 |
1967 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 1976 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
1968 | 1977 |
1969 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 1978 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
1970 | 1979 |
1971 } // namespace compiler | 1980 } // namespace compiler |
1972 } // namespace internal | 1981 } // namespace internal |
1973 } // namespace v8 | 1982 } // namespace v8 |
OLD | NEW |