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

Side by Side Diff: runtime/vm/flow_graph_allocator.cc

Issue 10834002: When evicting interference convert uses from evicted ranges. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « no previous file | 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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_allocator.h" 5 #include "vm/flow_graph_allocator.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/il_printer.h" 9 #include "vm/il_printer.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 void FlowGraphAllocator::AssignNonFreeRegister(LiveRange* unallocated, 1278 void FlowGraphAllocator::AssignNonFreeRegister(LiveRange* unallocated,
1279 Register reg) { 1279 Register reg) {
1280 TRACE_ALLOC(("assigning blocked register %s to live range %d\n", 1280 TRACE_ALLOC(("assigning blocked register %s to live range %d\n",
1281 Location::RegisterLocation(reg).Name(), 1281 Location::RegisterLocation(reg).Name(),
1282 unallocated->vreg())); 1282 unallocated->vreg()));
1283 1283
1284 intptr_t first_evicted = -1; 1284 intptr_t first_evicted = -1;
1285 for (intptr_t i = cpu_regs_[reg].length() - 1; i >= 0; i--) { 1285 for (intptr_t i = cpu_regs_[reg].length() - 1; i >= 0; i--) {
1286 LiveRange* allocated = cpu_regs_[reg][i]; 1286 LiveRange* allocated = cpu_regs_[reg][i];
1287 if (allocated->vreg() < 0) continue; // Can't be evicted. 1287 if (allocated->vreg() < 0) continue; // Can't be evicted.
1288 if (EvictIntersection(allocated, 1288 if (EvictIntersection(allocated,
Kevin Millikin (Google) 2012/07/25 11:26:32 We probably don't need a line break here.
1289 unallocated)) { 1289 unallocated)) {
1290 ASSERT(allocated->End() <= unallocated->Start());
1291 ConvertAllUses(allocated);
1290 cpu_regs_[reg][i] = NULL; 1292 cpu_regs_[reg][i] = NULL;
1291 first_evicted = i; 1293 first_evicted = i;
1292 } 1294 }
1293 } 1295 }
1294 1296
1295 // Remove evicted ranges from the array. 1297 // Remove evicted ranges from the array.
1296 if (first_evicted != -1) RemoveEvicted(reg, first_evicted); 1298 if (first_evicted != -1) RemoveEvicted(reg, first_evicted);
1297 1299
1298 cpu_regs_[reg].Add(unallocated); 1300 cpu_regs_[reg].Add(unallocated);
1299 unallocated->set_assigned_location(Location::RegisterLocation(reg)); 1301 unallocated->set_assigned_location(Location::RegisterLocation(reg));
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 1598
1597 if (FLAG_trace_ssa_allocator) { 1599 if (FLAG_trace_ssa_allocator) {
1598 OS::Print("-- ir after allocation -------------------------\n"); 1600 OS::Print("-- ir after allocation -------------------------\n");
1599 FlowGraphPrinter printer(Function::Handle(), block_order_, true); 1601 FlowGraphPrinter printer(Function::Handle(), block_order_, true);
1600 printer.PrintBlocks(); 1602 printer.PrintBlocks();
1601 } 1603 }
1602 } 1604 }
1603 1605
1604 1606
1605 } // namespace dart 1607 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698