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

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

Issue 793683002: [turbofan] enable stack slot reuse (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 | « no previous file | src/flag-definitions.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 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/linkage.h" 5 #include "src/compiler/linkage.h"
6 #include "src/compiler/register-allocator.h" 6 #include "src/compiler/register-allocator.h"
7 #include "src/string-stream.h" 7 #include "src/string-stream.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 SpillRange* RegisterAllocator::AssignSpillRangeToLiveRange(LiveRange* range) { 958 SpillRange* RegisterAllocator::AssignSpillRangeToLiveRange(LiveRange* range) {
959 DCHECK(FLAG_turbo_reuse_spill_slots); 959 DCHECK(FLAG_turbo_reuse_spill_slots);
960 auto spill_range = new (local_zone()) SpillRange(range, local_zone()); 960 auto spill_range = new (local_zone()) SpillRange(range, local_zone());
961 spill_ranges().push_back(spill_range); 961 spill_ranges().push_back(spill_range);
962 return spill_range; 962 return spill_range;
963 } 963 }
964 964
965 965
966 bool RegisterAllocator::TryReuseSpillForPhi(LiveRange* range) { 966 bool RegisterAllocator::TryReuseSpillForPhi(LiveRange* range) {
967 DCHECK(FLAG_turbo_reuse_spill_slots); 967 DCHECK(FLAG_turbo_reuse_spill_slots);
968 if (range->IsChild() || !range->is_phi()) return false;
968 DCHECK(range->HasNoSpillType()); 969 DCHECK(range->HasNoSpillType());
969 if (range->IsChild() || !range->is_phi()) return false;
970 970
971 auto lookup = phi_map_.find(range->id()); 971 auto lookup = phi_map_.find(range->id());
972 DCHECK(lookup != phi_map_.end()); 972 DCHECK(lookup != phi_map_.end());
973 auto phi = lookup->second.phi; 973 auto phi = lookup->second.phi;
974 auto block = lookup->second.block; 974 auto block = lookup->second.block;
975 // Count the number of spilled operands. 975 // Count the number of spilled operands.
976 size_t spilled_count = 0; 976 size_t spilled_count = 0;
977 LiveRange* first_op = nullptr; 977 LiveRange* first_op = nullptr;
978 for (size_t i = 0; i < phi->operands().size(); i++) { 978 for (size_t i = 0; i < phi->operands().size(); i++) {
979 int op = phi->operands()[i]; 979 int op = phi->operands()[i];
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
2547 } else { 2547 } else {
2548 DCHECK(range->Kind() == GENERAL_REGISTERS); 2548 DCHECK(range->Kind() == GENERAL_REGISTERS);
2549 assigned_registers_->Add(reg); 2549 assigned_registers_->Add(reg);
2550 } 2550 }
2551 range->set_assigned_register(reg, code_zone()); 2551 range->set_assigned_register(reg, code_zone());
2552 } 2552 }
2553 2553
2554 } // namespace compiler 2554 } // namespace compiler
2555 } // namespace internal 2555 } // namespace internal
2556 } // namespace v8 2556 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698