| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 InstructionSequence *code = data->code(); | 111 InstructionSequence *code = data->code(); |
| 112 int code_block_count = code->InstructionBlockCount(); | 112 int code_block_count = code->InstructionBlockCount(); |
| 113 Zone *zone = data->allocation_zone(); | 113 Zone *zone = data->allocation_zone(); |
| 114 ZoneVector<BitVector *> &in_sets = data->live_in_sets(); | 114 ZoneVector<BitVector *> &in_sets = data->live_in_sets(); |
| 115 | 115 |
| 116 for (int i = 0; i < code_block_count; ++i) { | 116 for (int i = 0; i < code_block_count; ++i) { |
| 117 InstructionBlock *block = code->InstructionBlockAt(RpoNumber::FromInt(i)); | 117 InstructionBlock *block = code->InstructionBlockAt(RpoNumber::FromInt(i)); |
| 118 if (!block->IsDeferred()) continue; | 118 if (!block->IsDeferred()) continue; |
| 119 | 119 |
| 120 RpoNumber last_deferred = block->last_deferred(); | 120 RpoNumber last_deferred = block->last_deferred(); |
| 121 i = last_deferred.ToInt(); | 121 // last_deferred + 1 is not deferred, so no point in visiting it. |
| 122 i = last_deferred.ToInt() + 1; |
| 122 | 123 |
| 123 LifetimePosition first_cut = LifetimePosition::GapFromInstructionIndex( | 124 LifetimePosition first_cut = LifetimePosition::GapFromInstructionIndex( |
| 124 block->first_instruction_index()); | 125 block->first_instruction_index()); |
| 125 | 126 |
| 126 LifetimePosition last_cut = LifetimePosition::GapFromInstructionIndex( | 127 LifetimePosition last_cut = LifetimePosition::GapFromInstructionIndex( |
| 127 static_cast<int>(code->instructions().size())); | 128 static_cast<int>(code->instructions().size())); |
| 128 | 129 |
| 129 const BitVector *in_set = in_sets[i]; | 130 const BitVector *in_set = in_sets[block->rpo_number().ToInt()]; |
| 130 InstructionBlock *last = code->InstructionBlockAt(last_deferred); | 131 InstructionBlock *last = code->InstructionBlockAt(last_deferred); |
| 131 const BitVector *out_set = LiveRangeBuilder::ComputeLiveOut(last, data); | 132 const BitVector *out_set = LiveRangeBuilder::ComputeLiveOut(last, data); |
| 132 last_cut = LifetimePosition::GapFromInstructionIndex( | 133 last_cut = LifetimePosition::GapFromInstructionIndex( |
| 133 last->last_instruction_index()); | 134 last->last_instruction_index()); |
| 134 | 135 |
| 135 BitVector ranges_to_splinter(*in_set, zone); | 136 BitVector ranges_to_splinter(*in_set, zone); |
| 136 ranges_to_splinter.Union(*out_set); | 137 ranges_to_splinter.Union(*out_set); |
| 137 BitVector::Iterator iterator(&ranges_to_splinter); | 138 BitVector::Iterator iterator(&ranges_to_splinter); |
| 138 | 139 |
| 139 while (!iterator.Done()) { | 140 while (!iterator.Done()) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 164 TopLevelLiveRange *splinter_parent = range->splintered_from(); | 165 TopLevelLiveRange *splinter_parent = range->splintered_from(); |
| 165 | 166 |
| 166 splinter_parent->Merge(range, data()); | 167 splinter_parent->Merge(range, data()); |
| 167 } | 168 } |
| 168 } | 169 } |
| 169 | 170 |
| 170 | 171 |
| 171 } // namespace compiler | 172 } // namespace compiler |
| 172 } // namespace internal | 173 } // namespace internal |
| 173 } // namespace v8 | 174 } // namespace v8 |
| OLD | NEW |