Index: src/compiler/pipeline.cc |
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
index 67ea99292e091d7e7794f096e73ee8f993c78d47..55cef8a062da2d0875f51c820cb90937922beb5f 100644 |
--- a/src/compiler/pipeline.cc |
+++ b/src/compiler/pipeline.cc |
@@ -844,6 +844,31 @@ struct AllocateDoubleRegistersPhase { |
}; |
+struct MarkSpilledOnlyInDeferredPhase { |
Jarin
2015/11/25 10:33:08
I think there is no need to introduce a new phase
Mircea Trofin
2015/11/25 16:21:36
It can be done, but it seemed cleaner to have it s
|
+ static const char* phase_name() { |
+ return "mark ranges spilled in deferred blocks"; |
+ } |
+ |
+ void Run(PipelineData* pipeline_data, Zone* temp_zone) { |
+ RegisterAllocationData* data = pipeline_data->register_allocation_data(); |
+ for (TopLevelLiveRange* top : data->live_ranges()) { |
Jarin
2015/11/25 10:33:08
The pipeline should not know about implementation
Mircea Trofin
2015/11/25 16:21:36
done as a side-effect of addressing the above.
|
+ if (top == nullptr || top->IsEmpty() || top->splinter() == nullptr) { |
+ continue; |
+ } |
+ |
+ LiveRange* child = top; |
+ for (; child != nullptr; child = child->next()) { |
+ if (child->spilled() || |
+ child->NextSlotPosition(child->Start()) != nullptr) { |
+ break; |
+ } |
+ } |
+ if (child == nullptr) top->MarkSpilledInDeferredBlock(); |
+ } |
+ } |
+}; |
+ |
+ |
struct MergeSplintersPhase { |
static const char* phase_name() { return "merge splintered ranges"; } |
void Run(PipelineData* pipeline_data, Zone* temp_zone) { |
@@ -1376,6 +1401,8 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config, |
} |
if (verifier != nullptr) { |
CHECK(!data->register_allocation_data()->ExistsUseWithoutDefinition()); |
+ CHECK(data->register_allocation_data() |
+ ->RangesDefinedInDeferredStaysInDeferred()); |
} |
if (FLAG_turbo_preprocess_ranges) { |
@@ -1391,6 +1418,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config, |
} |
if (FLAG_turbo_preprocess_ranges) { |
+ Run<MarkSpilledOnlyInDeferredPhase>(); |
Run<MergeSplintersPhase>(); |
} |