Index: src/compiler/pipeline.cc |
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
index 802024e5644f6d2892ac73444eb9b08cbc21c6d3..215908770f71817a1edeef2a4664b7a6da382b90 100644 |
--- a/src/compiler/pipeline.cc |
+++ b/src/compiler/pipeline.cc |
@@ -1002,8 +1002,9 @@ struct OptimizeMovesPhase { |
struct FrameElisionPhase { |
static const char* phase_name() { return "frame elision"; } |
- void Run(PipelineData* data, Zone* temp_zone) { |
- FrameElider(data->sequence()).Run(); |
+ void Run(PipelineData* data, Zone* temp_zone, |
+ const CallDescriptor* descriptor) { |
+ FrameElider(data->sequence()).Run(descriptor); |
} |
}; |
@@ -1373,11 +1374,7 @@ Handle<Code> Pipeline::ScheduleAndGenerateCode( |
BeginPhaseKind("code generation"); |
// TODO(mtrofin): move this off to the register allocator. |
bool generate_frame_at_start = |
- !FLAG_turbo_frame_elision || !data_->info()->IsStub() || |
- !data_->frame()->needs_frame() || |
- data_->sequence()->instruction_blocks().front()->needs_frame() || |
- linkage.GetIncomingDescriptor()->CalleeSavedFPRegisters() != 0 || |
- linkage.GetIncomingDescriptor()->CalleeSavedRegisters() != 0; |
+ data_->sequence()->instruction_blocks().front()->must_construct_frame(); |
// Optimimize jumps. |
if (FLAG_turbo_jt) { |
Run<JumpThreadingPhase>(generate_frame_at_start); |
@@ -1485,12 +1482,6 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config, |
Run<MergeSplintersPhase>(); |
} |
- // We plan to enable frame elision only for stubs and bytecode handlers. |
- if (FLAG_turbo_frame_elision && info()->IsStub()) { |
- Run<LocateSpillSlotsPhase>(); |
- Run<FrameElisionPhase>(); |
- } |
- |
Run<AssignSpillSlotsPhase>(); |
Run<CommitAssignmentPhase>(); |
@@ -1501,6 +1492,13 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config, |
Run<OptimizeMovesPhase>(); |
} |
+ if (descriptor != nullptr && descriptor->RequiresFrameAsIncoming()) { |
+ data_->sequence()->instruction_blocks()[0]->mark_needs_frame(); |
+ } |
+ |
+ Run<LocateSpillSlotsPhase>(); |
+ Run<FrameElisionPhase>(descriptor); |
+ |
if (FLAG_trace_turbo_graph) { |
OFStream os(stdout); |
PrintableInstructionSequence printable = {config, data->sequence()}; |