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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 10824147: Added support for copied parameters to the SSA compiler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | runtime/vm/flow_graph_builder.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_allocator.cc
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index 36a9306eca9db9ff41e9b87371aef4ffdee28e13..25b07e5d64ab2420de327a129061621f172f352a 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -448,6 +448,8 @@ void FlowGraphAllocator::BuildLiveRanges() {
ConnectIncomingPhiMoves(block);
}
+ const bool copied = builder_->parsed_function().copied_parameter_count() > 0;
+
// Process incoming parameters.
const intptr_t fixed_parameters_count =
builder_->parsed_function().function().num_fixed_parameters();
@@ -462,8 +464,13 @@ void FlowGraphAllocator::BuildLiveRanges() {
range->AddUseInterval(graph_entry->start_pos(), graph_entry->end_pos());
range->DefineAt(graph_entry->start_pos());
- // Slot index for the rightmost parameter is -1.
- const intptr_t slot_index = param->index() - fixed_parameters_count;
+ // Slot index for the leftmost copied parameter is 0.
+ intptr_t slot_index = param->index();
+ if (!copied) {
+ // Slot index for the rightmost fixed parameter is -1.
+ slot_index -= fixed_parameters_count;
+ }
+
range->set_assigned_location(Location::StackSlot(slot_index));
range->set_spill_slot(Location::StackSlot(slot_index));
@@ -477,6 +484,11 @@ void FlowGraphAllocator::BuildLiveRanges() {
AddToUnallocated(tail);
}
ConvertAllUses(range);
+
+ if (copied) {
+ ASSERT(spill_slots_.length() == slot_index);
+ spill_slots_.Add(range->End());
+ }
}
}
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | runtime/vm/flow_graph_builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698