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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 10882055: Put live register bits in stackmaps. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Handle XMM registers in stackmaps. 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/flow_graph_allocator.cc
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index be5eae149f14f4f732d83cc3b3ae9adbe4375ad2..08e32794c89b12908acf0db3f553104d21d9f834 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -35,10 +35,6 @@ static const intptr_t kTempVirtualRegister = -2;
static const intptr_t kIllegalPosition = -1;
static const intptr_t kMaxPosition = 0x7FFFFFFF;
-// Number of stack slots needed for a double spill slot.
-static const intptr_t kDoubleSpillSlotFactor = kDoubleSize / kWordSize;
-
-
static intptr_t MinPosition(intptr_t a, intptr_t b) {
return (a < b) ? a : b;
}
@@ -1770,11 +1766,16 @@ void FlowGraphAllocator::ConvertAllUses(LiveRange* range) {
ConvertUseTo(use, loc);
}
+ // Add live registers at all safepoints for instructions with slow-path
+ // code.
if (loc.IsMachineRegister()) {
for (SafepointPosition* safepoint = range->first_safepoint();
safepoint != NULL;
safepoint = safepoint->next()) {
- safepoint->locs()->live_registers()->Add(loc);
+ if (!safepoint->locs()->always_calls()) {
+ ASSERT(safepoint->locs()->can_call());
+ safepoint->locs()->live_registers()->Add(loc);
+ }
}
}
}
@@ -2118,23 +2119,11 @@ void FlowGraphAllocator::AllocateRegisters() {
ResolveControlFlow();
- // Reserve spill slots for XMM registers alive across slow path code.
- // TODO(vegorov): remove this code when safepoints with registers are
- // implemented.
- intptr_t deferred_xmm_spills = 0;
- for (intptr_t i = 0; i < safepoints_.length(); i++) {
- if (!safepoints_[i]->locs()->always_calls()) {
- const intptr_t count =
- safepoints_[i]->locs()->live_registers()->xmm_regs_count();
- if (count > deferred_xmm_spills) deferred_xmm_spills = count;
- }
- }
-
GraphEntryInstr* entry = block_order_[0]->AsGraphEntry();
ASSERT(entry != NULL);
- entry->set_spill_slot_count(
- (deferred_xmm_spills + spill_slots_.length()) * kDoubleSpillSlotFactor +
- cpu_spill_slot_count_);
+ intptr_t double_spill_slot_count =
+ spill_slots_.length() * kDoubleSpillSlotFactor;
+ entry->set_spill_slot_count(cpu_spill_slot_count_ + double_spill_slot_count);
if (FLAG_print_ssa_liveranges) {
const Function& function = flow_graph_.parsed_function().function();

Powered by Google App Engine
This is Rietveld 408576698