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

Side by Side Diff: src/compiler/live-range-separator.cc

Issue 1391023007: [turbofan] Splinter into one range. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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.h » ('j') | src/compiler/register-allocator.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/live-range-separator.h" 5 #include "src/compiler/live-range-separator.h"
6 #include "src/compiler/register-allocator.h" 6 #include "src/compiler/register-allocator.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 LifetimePosition end = Min(last_cut, range->End()); 71 LifetimePosition end = Min(last_cut, range->End());
72 72
73 if (start < end) { 73 if (start < end) {
74 // Ensure the original range has a spill range associated, before it gets 74 // Ensure the original range has a spill range associated, before it gets
75 // splintered. Splinters will point to it. This way, when attempting to 75 // splintered. Splinters will point to it. This way, when attempting to
76 // reuse spill slots of splinters, during allocation, we avoid clobbering 76 // reuse spill slots of splinters, during allocation, we avoid clobbering
77 // such slots. 77 // such slots.
78 if (range->MayRequireSpillRange()) { 78 if (range->MayRequireSpillRange()) {
79 data->CreateSpillRangeForLiveRange(range); 79 data->CreateSpillRangeForLiveRange(range);
80 } 80 }
81 TopLevelLiveRange *result = data->NextLiveRange(range->machine_type()); 81 if (range->splinter() == nullptr) {
82 DCHECK_NULL(data->live_ranges()[result->vreg()]); 82 TopLevelLiveRange *splinter = data->NextLiveRange(range->machine_type());
83 data->live_ranges()[result->vreg()] = result; 83 DCHECK_NULL(data->live_ranges()[splinter->vreg()]);
84 84 data->live_ranges()[splinter->vreg()] = splinter;
85 range->SetSplinter(splinter);
86 }
85 Zone *zone = data->allocation_zone(); 87 Zone *zone = data->allocation_zone();
86 range->Splinter(start, end, result, zone); 88 range->Splinter(start, end, zone);
87 } 89 }
88 } 90 }
89 91
90 92
91 // Splinter all ranges live inside successive deferred blocks. 93 // Splinter all ranges live inside successive deferred blocks.
92 // No control flow analysis is performed. After the register allocation, we will 94 // No control flow analysis is performed. After the register allocation, we will
93 // merge the splinters back into the original ranges, and then rely on the 95 // merge the splinters back into the original ranges, and then rely on the
94 // range connector to properly connect them. 96 // range connector to properly connect them.
95 void SplinterRangesInDeferredBlocks(RegisterAllocationData *data) { 97 void SplinterRangesInDeferredBlocks(RegisterAllocationData *data) {
96 InstructionSequence *code = data->code(); 98 InstructionSequence *code = data->code();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 int to_remove = range->vreg(); 165 int to_remove = range->vreg();
164 splinter_parent->Merge(range, data()->allocation_zone()); 166 splinter_parent->Merge(range, data()->allocation_zone());
165 data()->live_ranges()[to_remove] = nullptr; 167 data()->live_ranges()[to_remove] = nullptr;
166 } 168 }
167 } 169 }
168 170
169 171
170 } // namespace compiler 172 } // namespace compiler
171 } // namespace internal 173 } // namespace internal
172 } // namespace v8 174 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/register-allocator.h » ('j') | src/compiler/register-allocator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698