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

Unified Diff: src/compiler/pipeline.cc

Issue 1472803004: [turbofan] Simplified splintering code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/live-range-separator.cc ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>();
}
« no previous file with comments | « src/compiler/live-range-separator.cc ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698