OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/crankshaft/lithium-allocator.h" | 5 #include "src/crankshaft/lithium-allocator.h" |
6 | 6 |
7 #include "src/crankshaft/hydrogen.h" | 7 #include "src/crankshaft/hydrogen.h" |
8 #include "src/crankshaft/lithium-inl.h" | 8 #include "src/crankshaft/lithium-inl.h" |
9 #include "src/crankshaft/lithium-allocator-inl.h" | 9 #include "src/crankshaft/lithium-allocator-inl.h" |
10 #include "src/register-configuration.h" | 10 #include "src/register-configuration.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 a = a->next(); | 503 a = a->next(); |
504 if (a == NULL || a->start().Value() > other->End().Value()) break; | 504 if (a == NULL || a->start().Value() > other->End().Value()) break; |
505 AdvanceLastProcessedMarker(a, advance_last_processed_up_to); | 505 AdvanceLastProcessedMarker(a, advance_last_processed_up_to); |
506 } else { | 506 } else { |
507 b = b->next(); | 507 b = b->next(); |
508 } | 508 } |
509 } | 509 } |
510 return LifetimePosition::Invalid(); | 510 return LifetimePosition::Invalid(); |
511 } | 511 } |
512 | 512 |
513 | |
514 LAllocator::LAllocator(int num_values, HGraph* graph) | 513 LAllocator::LAllocator(int num_values, HGraph* graph) |
515 : chunk_(NULL), | 514 : zone_(graph->isolate()->allocator()), |
| 515 chunk_(NULL), |
516 live_in_sets_(graph->blocks()->length(), zone()), | 516 live_in_sets_(graph->blocks()->length(), zone()), |
517 live_ranges_(num_values * 2, zone()), | 517 live_ranges_(num_values * 2, zone()), |
518 fixed_live_ranges_(NULL), | 518 fixed_live_ranges_(NULL), |
519 fixed_double_live_ranges_(NULL), | 519 fixed_double_live_ranges_(NULL), |
520 unhandled_live_ranges_(num_values * 2, zone()), | 520 unhandled_live_ranges_(num_values * 2, zone()), |
521 active_live_ranges_(8, zone()), | 521 active_live_ranges_(8, zone()), |
522 inactive_live_ranges_(8, zone()), | 522 inactive_live_ranges_(8, zone()), |
523 reusable_slots_(8, zone()), | 523 reusable_slots_(8, zone()), |
524 next_virtual_register_(num_values), | 524 next_virtual_register_(num_values), |
525 first_artificial_register_(num_values), | 525 first_artificial_register_(num_values), |
526 mode_(UNALLOCATED_REGISTERS), | 526 mode_(UNALLOCATED_REGISTERS), |
527 num_registers_(-1), | 527 num_registers_(-1), |
528 graph_(graph), | 528 graph_(graph), |
529 has_osr_entry_(false), | 529 has_osr_entry_(false), |
530 allocation_ok_(true) {} | 530 allocation_ok_(true) {} |
531 | 531 |
532 | |
533 void LAllocator::InitializeLivenessAnalysis() { | 532 void LAllocator::InitializeLivenessAnalysis() { |
534 // Initialize the live_in sets for each block to NULL. | 533 // Initialize the live_in sets for each block to NULL. |
535 int block_count = graph_->blocks()->length(); | 534 int block_count = graph_->blocks()->length(); |
536 live_in_sets_.Initialize(block_count, zone()); | 535 live_in_sets_.Initialize(block_count, zone()); |
537 live_in_sets_.AddBlock(NULL, block_count, zone()); | 536 live_in_sets_.AddBlock(NULL, block_count, zone()); |
538 } | 537 } |
539 | 538 |
540 | 539 |
541 BitVector* LAllocator::ComputeLiveOut(HBasicBlock* block) { | 540 BitVector* LAllocator::ComputeLiveOut(HBasicBlock* block) { |
542 // Compute live out for the given block, except not including backward | 541 // Compute live out for the given block, except not including backward |
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2189 } | 2188 } |
2190 | 2189 |
2191 #ifdef DEBUG | 2190 #ifdef DEBUG |
2192 if (allocator_ != NULL) allocator_->Verify(); | 2191 if (allocator_ != NULL) allocator_->Verify(); |
2193 #endif | 2192 #endif |
2194 } | 2193 } |
2195 | 2194 |
2196 | 2195 |
2197 } // namespace internal | 2196 } // namespace internal |
2198 } // namespace v8 | 2197 } // namespace v8 |
OLD | NEW |