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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 10824177: Reapply "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, 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
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »
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 daa61fddf6561d735ad361bc7636c53927aa12a7..9a5c12f4fee7a72f517fb39ec6ec8144c1152434 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -447,6 +447,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();
@@ -461,10 +463,19 @@ 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));
+ if (copied) {
+ ASSERT(spill_slots_.length() == slot_index);
+ spill_slots_.Add(range->End());
zerny-google 2012/08/06 09:39:53 This has to come before splitting. This is the bug
+ }
range->finger()->Initialize(range);
UsePosition* use = range->finger()->FirstRegisterBeneficialUse(
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698