| 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 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 } | 1410 } |
| 1411 | 1411 |
| 1412 if (FLAG_turbo_escape) { | 1412 if (FLAG_turbo_escape) { |
| 1413 Run<EscapeAnalysisPhase>(); | 1413 Run<EscapeAnalysisPhase>(); |
| 1414 RunPrintAndVerify("Escape Analysed"); | 1414 RunPrintAndVerify("Escape Analysed"); |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 // Select representations. | 1417 // Select representations. |
| 1418 Run<RepresentationSelectionPhase>(); | 1418 Run<RepresentationSelectionPhase>(); |
| 1419 RunPrintAndVerify("Representations selected"); | 1419 RunPrintAndVerify("Representations selected"); |
| 1420 | |
| 1421 // Run early optimization pass. | |
| 1422 Run<EarlyOptimizationPhase>(); | |
| 1423 RunPrintAndVerify("Early optimized", true); | |
| 1424 } | 1420 } |
| 1425 | 1421 |
| 1426 #ifdef DEBUG | 1422 #ifdef DEBUG |
| 1427 // From now on it is invalid to look at types on the nodes, because: | 1423 // From now on it is invalid to look at types on the nodes, because: |
| 1428 // | 1424 // |
| 1429 // (a) The remaining passes (might) run concurrent to the main thread and | 1425 // (a) The remaining passes (might) run concurrent to the main thread and |
| 1430 // therefore must not access the Heap or the Isolate in an uncontrolled | 1426 // therefore must not access the Heap or the Isolate in an uncontrolled |
| 1431 // way (as done by the type system), and | 1427 // way (as done by the type system), and |
| 1432 // (b) the types on the nodes might not make sense after representation | 1428 // (b) the types on the nodes might not make sense after representation |
| 1433 // selection due to the way we handle truncations; if we'd want to look | 1429 // selection due to the way we handle truncations; if we'd want to look |
| 1434 // at types afterwards we'd essentially need to re-type (large portions | 1430 // at types afterwards we'd essentially need to re-type (large portions |
| 1435 // of) the graph. | 1431 // of) the graph. |
| 1436 // | 1432 // |
| 1437 // In order to catch bugs related to type access after this point we remove | 1433 // In order to catch bugs related to type access after this point we remove |
| 1438 // the types from the nodes at this point (currently only in Debug builds). | 1434 // the types from the nodes at this point (currently only in Debug builds). |
| 1439 Run<UntyperPhase>(); | 1435 Run<UntyperPhase>(); |
| 1440 RunPrintAndVerify("Untyped", true); | 1436 RunPrintAndVerify("Untyped", true); |
| 1441 #endif | 1437 #endif |
| 1442 | 1438 |
| 1439 // Run early optimization pass. |
| 1440 Run<EarlyOptimizationPhase>(); |
| 1441 RunPrintAndVerify("Early optimized", true); |
| 1442 |
| 1443 data->EndPhaseKind(); | 1443 data->EndPhaseKind(); |
| 1444 | 1444 |
| 1445 return true; | 1445 return true; |
| 1446 } | 1446 } |
| 1447 | 1447 |
| 1448 bool PipelineImpl::OptimizeGraph(Linkage* linkage) { | 1448 bool PipelineImpl::OptimizeGraph(Linkage* linkage) { |
| 1449 PipelineData* data = this->data_; | 1449 PipelineData* data = this->data_; |
| 1450 | 1450 |
| 1451 data->BeginPhaseKind("block building"); | 1451 data->BeginPhaseKind("block building"); |
| 1452 | 1452 |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 data->DeleteRegisterAllocationZone(); | 1799 data->DeleteRegisterAllocationZone(); |
| 1800 } | 1800 } |
| 1801 | 1801 |
| 1802 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 1802 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
| 1803 | 1803 |
| 1804 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 1804 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
| 1805 | 1805 |
| 1806 } // namespace compiler | 1806 } // namespace compiler |
| 1807 } // namespace internal | 1807 } // namespace internal |
| 1808 } // namespace v8 | 1808 } // namespace v8 |
| OLD | NEW |