OLD | NEW |
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 26 matching lines...) Expand all Loading... |
37 LifetimePosition end = Min(last_cut, range->End()); | 37 LifetimePosition end = Min(last_cut, range->End()); |
38 | 38 |
39 if (start < end) { | 39 if (start < end) { |
40 // Ensure the original range has a spill range associated, before it gets | 40 // Ensure the original range has a spill range associated, before it gets |
41 // splintered. Splinters will point to it. This way, when attempting to | 41 // splintered. Splinters will point to it. This way, when attempting to |
42 // reuse spill slots of splinters, during allocation, we avoid clobbering | 42 // reuse spill slots of splinters, during allocation, we avoid clobbering |
43 // such slots. | 43 // such slots. |
44 if (range->MayRequireSpillRange()) { | 44 if (range->MayRequireSpillRange()) { |
45 data->CreateSpillRangeForLiveRange(range); | 45 data->CreateSpillRangeForLiveRange(range); |
46 } | 46 } |
47 TopLevelLiveRange *result = data->NextLiveRange(range->machine_type()); | 47 if (range->splinter() == nullptr) { |
48 DCHECK_NULL(data->live_ranges()[result->vreg()]); | 48 TopLevelLiveRange *splinter = data->NextLiveRange(range->machine_type()); |
49 data->live_ranges()[result->vreg()] = result; | 49 DCHECK_NULL(data->live_ranges()[splinter->vreg()]); |
50 | 50 data->live_ranges()[splinter->vreg()] = splinter; |
| 51 range->SetSplinter(splinter); |
| 52 } |
51 Zone *zone = data->allocation_zone(); | 53 Zone *zone = data->allocation_zone(); |
52 range->Splinter(start, end, result, zone); | 54 range->Splinter(start, end, zone); |
53 } | 55 } |
54 } | 56 } |
55 | 57 |
56 | 58 |
57 int FirstInstruction(const UseInterval *interval) { | 59 int FirstInstruction(const UseInterval *interval) { |
58 LifetimePosition start = interval->start(); | 60 LifetimePosition start = interval->start(); |
59 int ret = start.ToInstructionIndex(); | 61 int ret = start.ToInstructionIndex(); |
60 if (start.IsInstructionPosition() && start.IsEnd()) { | 62 if (start.IsInstructionPosition() && start.IsEnd()) { |
61 ++ret; | 63 ++ret; |
62 } | 64 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 int to_remove = range->vreg(); | 143 int to_remove = range->vreg(); |
142 splinter_parent->Merge(range, data()->allocation_zone()); | 144 splinter_parent->Merge(range, data()->allocation_zone()); |
143 data()->live_ranges()[to_remove] = nullptr; | 145 data()->live_ranges()[to_remove] = nullptr; |
144 } | 146 } |
145 } | 147 } |
146 | 148 |
147 | 149 |
148 } // namespace compiler | 150 } // namespace compiler |
149 } // namespace internal | 151 } // namespace internal |
150 } // namespace v8 | 152 } // namespace v8 |
OLD | NEW |