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

Side by Side Diff: src/compiler/register-allocator.cc

Issue 1119683002: Mark instruction blocks with spills (for frame elision). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improved printing of blocks Created 5 years, 7 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
« no previous file with comments | « src/compiler/register-allocator.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/compiler/linkage.h" 6 #include "src/compiler/linkage.h"
7 #include "src/compiler/register-allocator.h" 7 #include "src/compiler/register-allocator.h"
8 #include "src/string-stream.h" 8 #include "src/string-stream.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 return true; 2683 return true;
2684 } 2684 }
2685 2685
2686 auto second_part = SplitRangeAt(current, register_use->pos()); 2686 auto second_part = SplitRangeAt(current, register_use->pos());
2687 Spill(second_part); 2687 Spill(second_part);
2688 2688
2689 return true; 2689 return true;
2690 } 2690 }
2691 2691
2692 2692
2693 SpillSlotLocator::SpillSlotLocator(RegisterAllocationData* data)
2694 : data_(data) {}
2695
2696
2697 void SpillSlotLocator::LocateSpillSlots() {
2698 auto code = data()->code();
2699 for (auto range : data()->live_ranges()) {
2700 if (range == nullptr || range->IsEmpty() || range->IsChild()) continue;
2701 // We care only about ranges which spill in the frame.
2702 if (!range->HasSpillRange()) continue;
2703 auto spills = range->spills_at_definition();
2704 DCHECK_NOT_NULL(spills);
2705 for (; spills != nullptr; spills = spills->next) {
2706 code->GetInstructionBlock(spills->gap_index)->mark_needs_frame();
2707 }
2708 }
2709 }
2710
2711
2693 OperandAssigner::OperandAssigner(RegisterAllocationData* data) : data_(data) {} 2712 OperandAssigner::OperandAssigner(RegisterAllocationData* data) : data_(data) {}
2694 2713
2695 2714
2696 void OperandAssigner::AssignSpillSlots() { 2715 void OperandAssigner::AssignSpillSlots() {
2697 auto& spill_ranges = data()->spill_ranges(); 2716 auto& spill_ranges = data()->spill_ranges();
2698 // Merge disjoint spill ranges 2717 // Merge disjoint spill ranges
2699 for (size_t i = 0; i < spill_ranges.size(); i++) { 2718 for (size_t i = 0; i < spill_ranges.size(); i++) {
2700 auto range = spill_ranges[i]; 2719 auto range = spill_ranges[i];
2701 if (range->IsEmpty()) continue; 2720 if (range->IsEmpty()) continue;
2702 for (size_t j = i + 1; j < spill_ranges.size(); j++) { 2721 for (size_t j = i + 1; j < spill_ranges.size(); j++) {
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
3126 auto eliminate = moves->PrepareInsertAfter(move); 3145 auto eliminate = moves->PrepareInsertAfter(move);
3127 to_insert.push_back(move); 3146 to_insert.push_back(move);
3128 if (eliminate != nullptr) to_eliminate.push_back(eliminate); 3147 if (eliminate != nullptr) to_eliminate.push_back(eliminate);
3129 } 3148 }
3130 } 3149 }
3131 3150
3132 3151
3133 } // namespace compiler 3152 } // namespace compiler
3134 } // namespace internal 3153 } // namespace internal
3135 } // namespace v8 3154 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/register-allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698