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" |
11 #include "src/base/platform/elapsed-timer.h" | 11 #include "src/base/platform/elapsed-timer.h" |
12 #include "src/compiler/all-nodes.h" | |
Jarin
2016/06/23 09:58:28
You should not need to add that.
bgeron
2016/06/23 12:03:05
Done.
| |
12 #include "src/compiler/ast-graph-builder.h" | 13 #include "src/compiler/ast-graph-builder.h" |
13 #include "src/compiler/ast-loop-assignment-analyzer.h" | 14 #include "src/compiler/ast-loop-assignment-analyzer.h" |
14 #include "src/compiler/basic-block-instrumentor.h" | 15 #include "src/compiler/basic-block-instrumentor.h" |
15 #include "src/compiler/branch-elimination.h" | 16 #include "src/compiler/branch-elimination.h" |
16 #include "src/compiler/bytecode-graph-builder.h" | 17 #include "src/compiler/bytecode-graph-builder.h" |
17 #include "src/compiler/checkpoint-elimination.h" | 18 #include "src/compiler/checkpoint-elimination.h" |
18 #include "src/compiler/code-generator.h" | 19 #include "src/compiler/code-generator.h" |
19 #include "src/compiler/common-operator-reducer.h" | 20 #include "src/compiler/common-operator-reducer.h" |
20 #include "src/compiler/control-flow-optimizer.h" | 21 #include "src/compiler/control-flow-optimizer.h" |
21 #include "src/compiler/dead-code-elimination.h" | 22 #include "src/compiler/dead-code-elimination.h" |
(...skipping 29 matching lines...) Expand all Loading... | |
51 #include "src/compiler/pipeline-statistics.h" | 52 #include "src/compiler/pipeline-statistics.h" |
52 #include "src/compiler/redundancy-elimination.h" | 53 #include "src/compiler/redundancy-elimination.h" |
53 #include "src/compiler/register-allocator-verifier.h" | 54 #include "src/compiler/register-allocator-verifier.h" |
54 #include "src/compiler/register-allocator.h" | 55 #include "src/compiler/register-allocator.h" |
55 #include "src/compiler/schedule.h" | 56 #include "src/compiler/schedule.h" |
56 #include "src/compiler/scheduler.h" | 57 #include "src/compiler/scheduler.h" |
57 #include "src/compiler/select-lowering.h" | 58 #include "src/compiler/select-lowering.h" |
58 #include "src/compiler/simplified-lowering.h" | 59 #include "src/compiler/simplified-lowering.h" |
59 #include "src/compiler/simplified-operator-reducer.h" | 60 #include "src/compiler/simplified-operator-reducer.h" |
60 #include "src/compiler/simplified-operator.h" | 61 #include "src/compiler/simplified-operator.h" |
62 #include "src/compiler/store-store-elimination.h" | |
61 #include "src/compiler/tail-call-optimization.h" | 63 #include "src/compiler/tail-call-optimization.h" |
62 #include "src/compiler/type-hint-analyzer.h" | 64 #include "src/compiler/type-hint-analyzer.h" |
63 #include "src/compiler/typer.h" | 65 #include "src/compiler/typer.h" |
64 #include "src/compiler/value-numbering-reducer.h" | 66 #include "src/compiler/value-numbering-reducer.h" |
65 #include "src/compiler/verifier.h" | 67 #include "src/compiler/verifier.h" |
66 #include "src/compiler/zone-pool.h" | 68 #include "src/compiler/zone-pool.h" |
67 #include "src/isolate-inl.h" | 69 #include "src/isolate-inl.h" |
68 #include "src/ostreams.h" | 70 #include "src/ostreams.h" |
69 #include "src/parsing/parser.h" | 71 #include "src/parsing/parser.h" |
70 #include "src/register-configuration.h" | 72 #include "src/register-configuration.h" |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1024 // Post-pass for wiring the control/effects | 1026 // Post-pass for wiring the control/effects |
1025 // - connect allocating representation changes into the control&effect | 1027 // - connect allocating representation changes into the control&effect |
1026 // chains and lower them, | 1028 // chains and lower them, |
1027 // - get rid of the region markers, | 1029 // - get rid of the region markers, |
1028 // - introduce effect phis and rewire effects to get SSA again. | 1030 // - introduce effect phis and rewire effects to get SSA again. |
1029 EffectControlLinearizer linearizer(data->jsgraph(), schedule, temp_zone); | 1031 EffectControlLinearizer linearizer(data->jsgraph(), schedule, temp_zone); |
1030 linearizer.Run(); | 1032 linearizer.Run(); |
1031 } | 1033 } |
1032 }; | 1034 }; |
1033 | 1035 |
1036 struct StoreStoreEliminationPhase { | |
1037 static const char* phase_name() { return "Store-store elimination"; } | |
1038 | |
1039 void Run(PipelineData* data, Zone* temp_zone) { | |
1040 StoreStoreElimination store_store_elimination(data->jsgraph(), temp_zone); | |
1041 store_store_elimination.Run(); | |
1042 } | |
1043 }; | |
1044 | |
1034 struct MemoryOptimizationPhase { | 1045 struct MemoryOptimizationPhase { |
1035 static const char* phase_name() { return "memory optimization"; } | 1046 static const char* phase_name() { return "memory optimization"; } |
1036 | 1047 |
1037 void Run(PipelineData* data, Zone* temp_zone) { | 1048 void Run(PipelineData* data, Zone* temp_zone) { |
1038 // The memory optimizer requires the graphs to be trimmed, so trim now. | 1049 // The memory optimizer requires the graphs to be trimmed, so trim now. |
1039 GraphTrimmer trimmer(temp_zone, data->graph()); | 1050 GraphTrimmer trimmer(temp_zone, data->graph()); |
1040 NodeVector roots(temp_zone); | 1051 NodeVector roots(temp_zone); |
1041 data->jsgraph()->GetCachedNodes(&roots); | 1052 data->jsgraph()->GetCachedNodes(&roots); |
1042 trimmer.TrimGraph(roots.begin(), roots.end()); | 1053 trimmer.TrimGraph(roots.begin(), roots.end()); |
1043 | 1054 |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1467 } | 1478 } |
1468 | 1479 |
1469 bool PipelineImpl::OptimizeGraph(Linkage* linkage) { | 1480 bool PipelineImpl::OptimizeGraph(Linkage* linkage) { |
1470 PipelineData* data = this->data_; | 1481 PipelineData* data = this->data_; |
1471 | 1482 |
1472 data->BeginPhaseKind("block building"); | 1483 data->BeginPhaseKind("block building"); |
1473 | 1484 |
1474 Run<EffectControlLinearizationPhase>(); | 1485 Run<EffectControlLinearizationPhase>(); |
1475 RunPrintAndVerify("Effect and control linearized", true); | 1486 RunPrintAndVerify("Effect and control linearized", true); |
1476 | 1487 |
1488 if (FLAG_turbo_store_elimination) { | |
1489 Run<StoreStoreEliminationPhase>(); | |
1490 RunPrintAndVerify("Store-store elimination", true); | |
1491 } | |
1492 | |
1477 Run<BranchEliminationPhase>(); | 1493 Run<BranchEliminationPhase>(); |
1478 RunPrintAndVerify("Branch conditions eliminated", true); | 1494 RunPrintAndVerify("Branch conditions eliminated", true); |
1479 | 1495 |
1480 // Optimize control flow. | 1496 // Optimize control flow. |
1481 if (FLAG_turbo_cf_optimization) { | 1497 if (FLAG_turbo_cf_optimization) { |
1482 Run<ControlFlowOptimizationPhase>(); | 1498 Run<ControlFlowOptimizationPhase>(); |
1483 RunPrintAndVerify("Control flow optimized", true); | 1499 RunPrintAndVerify("Control flow optimized", true); |
1484 } | 1500 } |
1485 | 1501 |
1486 // Optimize memory access and allocation operations. | 1502 // Optimize memory access and allocation operations. |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1815 data->DeleteRegisterAllocationZone(); | 1831 data->DeleteRegisterAllocationZone(); |
1816 } | 1832 } |
1817 | 1833 |
1818 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 1834 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
1819 | 1835 |
1820 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 1836 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
1821 | 1837 |
1822 } // namespace compiler | 1838 } // namespace compiler |
1823 } // namespace internal | 1839 } // namespace internal |
1824 } // namespace v8 | 1840 } // namespace v8 |
OLD | NEW |