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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 void Run(PipelineData* data, Zone* temp_zone) { | 995 void Run(PipelineData* data, Zone* temp_zone) { |
996 MoveOptimizer move_optimizer(temp_zone, data->sequence()); | 996 MoveOptimizer move_optimizer(temp_zone, data->sequence()); |
997 move_optimizer.Run(); | 997 move_optimizer.Run(); |
998 } | 998 } |
999 }; | 999 }; |
1000 | 1000 |
1001 | 1001 |
1002 struct FrameElisionPhase { | 1002 struct FrameElisionPhase { |
1003 static const char* phase_name() { return "frame elision"; } | 1003 static const char* phase_name() { return "frame elision"; } |
1004 | 1004 |
1005 void Run(PipelineData* data, Zone* temp_zone) { | 1005 void Run(PipelineData* data, Zone* temp_zone, |
1006 FrameElider(data->sequence()).Run(); | 1006 const CallDescriptor* descriptor) { |
| 1007 FrameElider(data->sequence()).Run(descriptor); |
1007 } | 1008 } |
1008 }; | 1009 }; |
1009 | 1010 |
1010 | 1011 |
1011 struct JumpThreadingPhase { | 1012 struct JumpThreadingPhase { |
1012 static const char* phase_name() { return "jump threading"; } | 1013 static const char* phase_name() { return "jump threading"; } |
1013 | 1014 |
1014 void Run(PipelineData* data, Zone* temp_zone, bool frame_at_start) { | 1015 void Run(PipelineData* data, Zone* temp_zone, bool frame_at_start) { |
1015 ZoneVector<RpoNumber> result(temp_zone); | 1016 ZoneVector<RpoNumber> result(temp_zone); |
1016 if (JumpThreading::ComputeForwarding(temp_zone, result, data->sequence(), | 1017 if (JumpThreading::ComputeForwarding(temp_zone, result, data->sequence(), |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 Run<AllocateDoubleRegistersPhase<GreedyAllocator>>(); | 1478 Run<AllocateDoubleRegistersPhase<GreedyAllocator>>(); |
1478 } else { | 1479 } else { |
1479 Run<AllocateGeneralRegistersPhase<LinearScanAllocator>>(); | 1480 Run<AllocateGeneralRegistersPhase<LinearScanAllocator>>(); |
1480 Run<AllocateDoubleRegistersPhase<LinearScanAllocator>>(); | 1481 Run<AllocateDoubleRegistersPhase<LinearScanAllocator>>(); |
1481 } | 1482 } |
1482 | 1483 |
1483 if (FLAG_turbo_preprocess_ranges) { | 1484 if (FLAG_turbo_preprocess_ranges) { |
1484 Run<MergeSplintersPhase>(); | 1485 Run<MergeSplintersPhase>(); |
1485 } | 1486 } |
1486 | 1487 |
1487 // We plan to enable frame elision only for stubs and bytecode handlers. | |
1488 if (FLAG_turbo_frame_elision && info()->IsStub()) { | |
1489 Run<LocateSpillSlotsPhase>(); | |
1490 Run<FrameElisionPhase>(); | |
1491 } | |
1492 | |
1493 Run<AssignSpillSlotsPhase>(); | 1488 Run<AssignSpillSlotsPhase>(); |
1494 | 1489 |
1495 Run<CommitAssignmentPhase>(); | 1490 Run<CommitAssignmentPhase>(); |
1496 Run<PopulateReferenceMapsPhase>(); | 1491 Run<PopulateReferenceMapsPhase>(); |
1497 Run<ConnectRangesPhase>(); | 1492 Run<ConnectRangesPhase>(); |
1498 Run<ResolveControlFlowPhase>(); | 1493 Run<ResolveControlFlowPhase>(); |
1499 if (FLAG_turbo_move_optimization) { | 1494 if (FLAG_turbo_move_optimization) { |
1500 Run<OptimizeMovesPhase>(); | 1495 Run<OptimizeMovesPhase>(); |
1501 } | 1496 } |
1502 | 1497 |
| 1498 Run<LocateSpillSlotsPhase>(); |
| 1499 Run<FrameElisionPhase>(descriptor); |
| 1500 |
1503 if (FLAG_trace_turbo_graph) { | 1501 if (FLAG_trace_turbo_graph) { |
1504 OFStream os(stdout); | 1502 OFStream os(stdout); |
1505 PrintableInstructionSequence printable = {config, data->sequence()}; | 1503 PrintableInstructionSequence printable = {config, data->sequence()}; |
1506 os << "----- Instruction sequence after register allocation -----\n" | 1504 os << "----- Instruction sequence after register allocation -----\n" |
1507 << printable; | 1505 << printable; |
1508 } | 1506 } |
1509 | 1507 |
1510 if (verifier != nullptr) { | 1508 if (verifier != nullptr) { |
1511 verifier->VerifyAssignment(); | 1509 verifier->VerifyAssignment(); |
1512 verifier->VerifyGapMoves(); | 1510 verifier->VerifyGapMoves(); |
1513 } | 1511 } |
1514 | 1512 |
1515 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { | 1513 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { |
1516 TurboCfgFile tcf(data->isolate()); | 1514 TurboCfgFile tcf(data->isolate()); |
1517 tcf << AsC1VRegisterAllocationData("CodeGen", | 1515 tcf << AsC1VRegisterAllocationData("CodeGen", |
1518 data->register_allocation_data()); | 1516 data->register_allocation_data()); |
1519 } | 1517 } |
1520 | 1518 |
1521 data->DeleteRegisterAllocationZone(); | 1519 data->DeleteRegisterAllocationZone(); |
1522 } | 1520 } |
1523 | 1521 |
1524 Isolate* Pipeline::isolate() const { return info()->isolate(); } | 1522 Isolate* Pipeline::isolate() const { return info()->isolate(); } |
1525 | 1523 |
1526 } // namespace compiler | 1524 } // namespace compiler |
1527 } // namespace internal | 1525 } // namespace internal |
1528 } // namespace v8 | 1526 } // namespace v8 |
OLD | NEW |