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

Side by Side Diff: src/lithium-allocator.cc

Issue 6683022: [Isolates] Merge 7111:7152 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/lithium-allocator.h ('k') | src/log.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 if (a == NULL || a->start().Value() > other->End().Value()) break; 524 if (a == NULL || a->start().Value() > other->End().Value()) break;
525 AdvanceLastProcessedMarker(a, advance_last_processed_up_to); 525 AdvanceLastProcessedMarker(a, advance_last_processed_up_to);
526 } else { 526 } else {
527 b = b->next(); 527 b = b->next();
528 } 528 }
529 } 529 }
530 return LifetimePosition::Invalid(); 530 return LifetimePosition::Invalid();
531 } 531 }
532 532
533 533
534 LAllocator::LAllocator(int num_values, HGraph* graph)
535 : chunk_(NULL),
536 live_in_sets_(graph->blocks()->length()),
537 live_ranges_(num_values * 2),
538 fixed_live_ranges_(NULL),
539 fixed_double_live_ranges_(NULL),
540 unhandled_live_ranges_(num_values * 2),
541 active_live_ranges_(8),
542 inactive_live_ranges_(8),
543 reusable_slots_(8),
544 next_virtual_register_(num_values),
545 first_artificial_register_(num_values),
546 mode_(NONE),
547 num_registers_(-1),
548 graph_(graph),
549 has_osr_entry_(false) {}
550
551
534 void LAllocator::InitializeLivenessAnalysis() { 552 void LAllocator::InitializeLivenessAnalysis() {
535 // Initialize the live_in sets for each block to NULL. 553 // Initialize the live_in sets for each block to NULL.
536 int block_count = graph_->blocks()->length(); 554 int block_count = graph_->blocks()->length();
537 live_in_sets_.Initialize(block_count); 555 live_in_sets_.Initialize(block_count);
538 live_in_sets_.AddBlock(NULL, block_count); 556 live_in_sets_.AddBlock(NULL, block_count);
539 } 557 }
540 558
541 559
542 BitVector* LAllocator::ComputeLiveOut(HBasicBlock* block) { 560 BitVector* LAllocator::ComputeLiveOut(HBasicBlock* block) {
543 // Compute live out for the given block, except not including backward 561 // Compute live out for the given block, except not including backward
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 LInstruction* instr = InstructionAt(pos); 635 LInstruction* instr = InstructionAt(pos);
618 if (instr->HasPointerMap()) { 636 if (instr->HasPointerMap()) {
619 instr->pointer_map()->RecordPointer(operand); 637 instr->pointer_map()->RecordPointer(operand);
620 } 638 }
621 } 639 }
622 return operand; 640 return operand;
623 } 641 }
624 642
625 643
626 LiveRange* LAllocator::FixedLiveRangeFor(int index) { 644 LiveRange* LAllocator::FixedLiveRangeFor(int index) {
627 if (index >= fixed_live_ranges_.length()) { 645 ASSERT(index < Register::kNumAllocatableRegisters);
628 fixed_live_ranges_.AddBlock(NULL,
629 index - fixed_live_ranges_.length() + 1);
630 }
631
632 LiveRange* result = fixed_live_ranges_[index]; 646 LiveRange* result = fixed_live_ranges_[index];
633 if (result == NULL) { 647 if (result == NULL) {
634 result = new LiveRange(FixedLiveRangeID(index)); 648 result = new LiveRange(FixedLiveRangeID(index));
635 ASSERT(result->IsFixed()); 649 ASSERT(result->IsFixed());
636 result->set_assigned_register(index, GENERAL_REGISTERS); 650 result->set_assigned_register(index, GENERAL_REGISTERS);
637 fixed_live_ranges_[index] = result; 651 fixed_live_ranges_[index] = result;
638 } 652 }
639 return result; 653 return result;
640 } 654 }
641 655
642 656
643 LiveRange* LAllocator::FixedDoubleLiveRangeFor(int index) { 657 LiveRange* LAllocator::FixedDoubleLiveRangeFor(int index) {
644 if (index >= fixed_double_live_ranges_.length()) { 658 ASSERT(index < DoubleRegister::kNumAllocatableRegisters);
645 fixed_double_live_ranges_.AddBlock(NULL,
646 index - fixed_double_live_ranges_.length() + 1);
647 }
648
649 LiveRange* result = fixed_double_live_ranges_[index]; 659 LiveRange* result = fixed_double_live_ranges_[index];
650 if (result == NULL) { 660 if (result == NULL) {
651 result = new LiveRange(FixedDoubleLiveRangeID(index)); 661 result = new LiveRange(FixedDoubleLiveRangeID(index));
652 ASSERT(result->IsFixed()); 662 ASSERT(result->IsFixed());
653 result->set_assigned_register(index, DOUBLE_REGISTERS); 663 result->set_assigned_register(index, DOUBLE_REGISTERS);
654 fixed_double_live_ranges_[index] = result; 664 fixed_double_live_ranges_[index] = result;
655 } 665 }
656 return result; 666 return result;
657 } 667 }
658 668
669
659 LiveRange* LAllocator::LiveRangeFor(int index) { 670 LiveRange* LAllocator::LiveRangeFor(int index) {
660 if (index >= live_ranges_.length()) { 671 if (index >= live_ranges_.length()) {
661 live_ranges_.AddBlock(NULL, index - live_ranges_.length() + 1); 672 live_ranges_.AddBlock(NULL, index - live_ranges_.length() + 1);
662 } 673 }
663 LiveRange* result = live_ranges_[index]; 674 LiveRange* result = live_ranges_[index];
664 if (result == NULL) { 675 if (result == NULL) {
665 result = new LiveRange(index); 676 result = new LiveRange(index);
666 live_ranges_[index] = result; 677 live_ranges_[index] = result;
667 } 678 }
668 return result; 679 return result;
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 LiveRange* current = live_ranges()->at(i); 2094 LiveRange* current = live_ranges()->at(i);
2084 if (current != NULL) current->Verify(); 2095 if (current != NULL) current->Verify();
2085 } 2096 }
2086 } 2097 }
2087 2098
2088 2099
2089 #endif 2100 #endif
2090 2101
2091 2102
2092 } } // namespace v8::internal 2103 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/lithium-allocator.h ('k') | src/log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698