| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/register-allocator.h" | 5 #include "src/compiler/register-allocator.h" |
| 6 | 6 |
| 7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
| 8 #include "src/hydrogen.h" | 8 #include "src/hydrogen.h" |
| 9 #include "src/string-stream.h" | 9 #include "src/string-stream.h" |
| 10 | 10 |
| (...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 // Now live is live_in for this block except not including values live | 1321 // Now live is live_in for this block except not including values live |
| 1322 // out on backward successor edges. | 1322 // out on backward successor edges. |
| 1323 live_in_sets_[block_id] = live; | 1323 live_in_sets_[block_id] = live; |
| 1324 | 1324 |
| 1325 if (block->IsLoopHeader()) { | 1325 if (block->IsLoopHeader()) { |
| 1326 // Add a live range stretching from the first loop instruction to the last | 1326 // Add a live range stretching from the first loop instruction to the last |
| 1327 // for each value live on entry to the header. | 1327 // for each value live on entry to the header. |
| 1328 BitVector::Iterator iterator(live); | 1328 BitVector::Iterator iterator(live); |
| 1329 LifetimePosition start = LifetimePosition::FromInstructionIndex( | 1329 LifetimePosition start = LifetimePosition::FromInstructionIndex( |
| 1330 block->first_instruction_index()); | 1330 block->first_instruction_index()); |
| 1331 int end_index = code() | |
| 1332 ->InstructionBlockAt(block->loop_end()) | |
| 1333 ->last_instruction_index(); | |
| 1334 LifetimePosition end = | 1331 LifetimePosition end = |
| 1335 LifetimePosition::FromInstructionIndex(end_index).NextInstruction(); | 1332 LifetimePosition::FromInstructionIndex( |
| 1333 code()->LastLoopInstructionIndex(block)).NextInstruction(); |
| 1336 while (!iterator.Done()) { | 1334 while (!iterator.Done()) { |
| 1337 int operand_index = iterator.Current(); | 1335 int operand_index = iterator.Current(); |
| 1338 LiveRange* range = LiveRangeFor(operand_index); | 1336 LiveRange* range = LiveRangeFor(operand_index); |
| 1339 range->EnsureInterval(start, end, zone()); | 1337 range->EnsureInterval(start, end, zone()); |
| 1340 iterator.Advance(); | 1338 iterator.Advance(); |
| 1341 } | 1339 } |
| 1342 | 1340 |
| 1343 // Insert all values into the live in sets of all blocks in the loop. | 1341 // Insert all values into the live in sets of all blocks in the loop. |
| 1344 for (int i = block->rpo_number().ToInt() + 1; | 1342 for (int i = block->rpo_number().ToInt() + 1; |
| 1345 i < block->loop_end().ToInt(); ++i) { | 1343 i < block->loop_end().ToInt(); ++i) { |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2224 allocator_zone_start_allocation_size_; | 2222 allocator_zone_start_allocation_size_; |
| 2225 isolate()->GetTStatistics()->SaveTiming(name(), base::TimeDelta(), size); | 2223 isolate()->GetTStatistics()->SaveTiming(name(), base::TimeDelta(), size); |
| 2226 } | 2224 } |
| 2227 #ifdef DEBUG | 2225 #ifdef DEBUG |
| 2228 if (allocator_ != NULL) allocator_->Verify(); | 2226 if (allocator_ != NULL) allocator_->Verify(); |
| 2229 #endif | 2227 #endif |
| 2230 } | 2228 } |
| 2231 } | 2229 } |
| 2232 } | 2230 } |
| 2233 } // namespace v8::internal::compiler | 2231 } // namespace v8::internal::compiler |
| OLD | NEW |