Chromium Code Reviews| 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( |