Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: src/compiler/pipeline.cc

Issue 1810333003: [turbofan] Move frame elision logic to the end (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/register-allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 frame_ = nullptr; 260 frame_ = nullptr;
261 } 261 }
262 262
263 void DeleteRegisterAllocationZone() { 263 void DeleteRegisterAllocationZone() {
264 if (register_allocation_zone_ == nullptr) return; 264 if (register_allocation_zone_ == nullptr) return;
265 register_allocation_zone_scope_.Destroy(); 265 register_allocation_zone_scope_.Destroy();
266 register_allocation_zone_ = nullptr; 266 register_allocation_zone_ = nullptr;
267 register_allocation_data_ = nullptr; 267 register_allocation_data_ = nullptr;
268 } 268 }
269 269
270 void InitializeInstructionSequence() { 270 void InitializeInstructionSequence(const CallDescriptor* descriptor) {
271 DCHECK(sequence_ == nullptr); 271 DCHECK(sequence_ == nullptr);
272 InstructionBlocks* instruction_blocks = 272 InstructionBlocks* instruction_blocks =
273 InstructionSequence::InstructionBlocksFor(instruction_zone(), 273 InstructionSequence::InstructionBlocksFor(instruction_zone(),
274 schedule()); 274 schedule());
275 sequence_ = new (instruction_zone()) InstructionSequence( 275 sequence_ = new (instruction_zone()) InstructionSequence(
276 info()->isolate(), instruction_zone(), instruction_blocks); 276 info()->isolate(), instruction_zone(), instruction_blocks);
277 if (descriptor && descriptor->RequiresFrameAsIncoming()) {
278 sequence_->instruction_blocks()[0]->mark_needs_frame();
279 }
277 } 280 }
278 281
279 void InitializeFrameData(CallDescriptor* descriptor) { 282 void InitializeFrameData(CallDescriptor* descriptor) {
280 DCHECK(frame_ == nullptr); 283 DCHECK(frame_ == nullptr);
281 int fixed_frame_size = 0; 284 int fixed_frame_size = 0;
282 if (descriptor != nullptr) { 285 if (descriptor != nullptr) {
283 fixed_frame_size = CalculateFixedFrameSize(descriptor); 286 fixed_frame_size = CalculateFixedFrameSize(descriptor);
284 } 287 }
285 frame_ = new (instruction_zone()) Frame(fixed_frame_size, descriptor); 288 frame_ = new (instruction_zone()) Frame(fixed_frame_size, descriptor);
286 } 289 }
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 1332
1330 if (data->schedule() == nullptr) Run<ComputeSchedulePhase>(); 1333 if (data->schedule() == nullptr) Run<ComputeSchedulePhase>();
1331 TraceSchedule(data->info(), data->schedule()); 1334 TraceSchedule(data->info(), data->schedule());
1332 1335
1333 BasicBlockProfiler::Data* profiler_data = nullptr; 1336 BasicBlockProfiler::Data* profiler_data = nullptr;
1334 if (FLAG_turbo_profiling) { 1337 if (FLAG_turbo_profiling) {
1335 profiler_data = BasicBlockInstrumentor::Instrument(info(), data->graph(), 1338 profiler_data = BasicBlockInstrumentor::Instrument(info(), data->graph(),
1336 data->schedule()); 1339 data->schedule());
1337 } 1340 }
1338 1341
1339 data->InitializeInstructionSequence(); 1342 data->InitializeInstructionSequence(call_descriptor);
1340 1343
1341 data->InitializeFrameData(call_descriptor); 1344 data->InitializeFrameData(call_descriptor);
1342 // Select and schedule instructions covering the scheduled graph. 1345 // Select and schedule instructions covering the scheduled graph.
1343 Linkage linkage(call_descriptor); 1346 Linkage linkage(call_descriptor);
1344 Run<InstructionSelectionPhase>(&linkage); 1347 Run<InstructionSelectionPhase>(&linkage);
1345 1348
1346 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { 1349 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) {
1347 TurboCfgFile tcf(isolate()); 1350 TurboCfgFile tcf(isolate());
1348 tcf << AsC1V("CodeGen", data->schedule(), data->source_positions(), 1351 tcf << AsC1V("CodeGen", data->schedule(), data->source_positions(),
1349 data->sequence()); 1352 data->sequence());
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 Run<AllocateDoubleRegistersPhase<GreedyAllocator>>(); 1481 Run<AllocateDoubleRegistersPhase<GreedyAllocator>>();
1479 } else { 1482 } else {
1480 Run<AllocateGeneralRegistersPhase<LinearScanAllocator>>(); 1483 Run<AllocateGeneralRegistersPhase<LinearScanAllocator>>();
1481 Run<AllocateDoubleRegistersPhase<LinearScanAllocator>>(); 1484 Run<AllocateDoubleRegistersPhase<LinearScanAllocator>>();
1482 } 1485 }
1483 1486
1484 if (FLAG_turbo_preprocess_ranges) { 1487 if (FLAG_turbo_preprocess_ranges) {
1485 Run<MergeSplintersPhase>(); 1488 Run<MergeSplintersPhase>();
1486 } 1489 }
1487 1490
1488 // We plan to enable frame elision only for stubs and bytecode handlers.
1489 if (FLAG_turbo_frame_elision && info()->IsStub()) {
1490 Run<LocateSpillSlotsPhase>();
1491 Run<FrameElisionPhase>();
1492 }
1493
1494 Run<AssignSpillSlotsPhase>(); 1491 Run<AssignSpillSlotsPhase>();
1495 1492
1496 Run<CommitAssignmentPhase>(); 1493 Run<CommitAssignmentPhase>();
1497 Run<PopulateReferenceMapsPhase>(); 1494 Run<PopulateReferenceMapsPhase>();
1498 Run<ConnectRangesPhase>(); 1495 Run<ConnectRangesPhase>();
1499 Run<ResolveControlFlowPhase>(); 1496 Run<ResolveControlFlowPhase>();
1500 if (FLAG_turbo_move_optimization) { 1497 if (FLAG_turbo_move_optimization) {
1501 Run<OptimizeMovesPhase>(); 1498 Run<OptimizeMovesPhase>();
1502 } 1499 }
1503 1500
1501 Run<LocateSpillSlotsPhase>();
1502 Run<FrameElisionPhase>();
1503
1504 if (FLAG_trace_turbo_graph) { 1504 if (FLAG_trace_turbo_graph) {
1505 OFStream os(stdout); 1505 OFStream os(stdout);
1506 PrintableInstructionSequence printable = {config, data->sequence()}; 1506 PrintableInstructionSequence printable = {config, data->sequence()};
1507 os << "----- Instruction sequence after register allocation -----\n" 1507 os << "----- Instruction sequence after register allocation -----\n"
1508 << printable; 1508 << printable;
1509 } 1509 }
1510 1510
1511 if (verifier != nullptr) { 1511 if (verifier != nullptr) {
1512 verifier->VerifyAssignment(); 1512 verifier->VerifyAssignment();
1513 verifier->VerifyGapMoves(); 1513 verifier->VerifyGapMoves();
1514 } 1514 }
1515 1515
1516 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { 1516 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) {
1517 TurboCfgFile tcf(data->isolate()); 1517 TurboCfgFile tcf(data->isolate());
1518 tcf << AsC1VRegisterAllocationData("CodeGen", 1518 tcf << AsC1VRegisterAllocationData("CodeGen",
1519 data->register_allocation_data()); 1519 data->register_allocation_data());
1520 } 1520 }
1521 1521
1522 data->DeleteRegisterAllocationZone(); 1522 data->DeleteRegisterAllocationZone();
1523 } 1523 }
1524 1524
1525 Isolate* Pipeline::isolate() const { return info()->isolate(); } 1525 Isolate* Pipeline::isolate() const { return info()->isolate(); }
1526 1526
1527 } // namespace compiler 1527 } // namespace compiler
1528 } // namespace internal 1528 } // namespace internal
1529 } // namespace v8 1529 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698