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 fddde8096132e78a4fdb1563cd92a257a605f72d..a67499afd9b7ab740e48fd358896e028f199ca59 100644 |
| --- a/runtime/vm/flow_graph_allocator.cc |
| +++ b/runtime/vm/flow_graph_allocator.cc |
| @@ -510,16 +510,7 @@ void FlowGraphAllocator::BuildLiveRanges() { |
| Definition* defn = (*catch_entry->initial_definitions())[i]; |
| LiveRange* range = GetLiveRange(defn->ssa_temp_index()); |
| range->DefineAt(catch_entry->start_pos()); // Defined at block entry. |
| - |
| - // Save range->End() because it may change in ProcessInitialDefinition. |
| - intptr_t range_end = range->End(); |
| ProcessInitialDefinition(defn, range, catch_entry); |
| - spill_slots_.Add(range_end); |
| - quad_spill_slots_.Add(false); |
| - |
| - if (defn->IsParameter() && range->spill_slot().stack_index() >= 0) { |
| - MarkAsObjectAtSafepoints(range); |
| - } |
| } |
| } |
| } |
| @@ -532,16 +523,7 @@ void FlowGraphAllocator::BuildLiveRanges() { |
| LiveRange* range = GetLiveRange(defn->ssa_temp_index()); |
| range->AddUseInterval(graph_entry->start_pos(), graph_entry->end_pos()); |
| range->DefineAt(graph_entry->start_pos()); |
| - |
| - // Save range->End() because it may change in ProcessInitialDefinition. |
| - intptr_t range_end = range->End(); |
| ProcessInitialDefinition(defn, range, graph_entry); |
| - if (defn->IsParameter() && flow_graph_.num_copied_params() > 0) { |
| - spill_slots_.Add(range_end); |
| - quad_spill_slots_.Add(false); |
| - |
| - MarkAsObjectAtSafepoints(range); |
| - } |
| } |
| } |
| @@ -549,6 +531,8 @@ void FlowGraphAllocator::BuildLiveRanges() { |
| void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn, |
| LiveRange* range, |
| BlockEntryInstr* block) { |
| + // Save the range end because it may change below. |
| + intptr_t range_end = range->End(); |
| if (defn->IsParameter()) { |
| ParameterInstr* param = defn->AsParameter(); |
| // Assert that copied and non-copied parameters are mutually exclusive. |
| @@ -579,6 +563,17 @@ void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn, |
| CompleteRange(tail, Location::kRegister); |
| } |
| ConvertAllUses(range); |
| + if (defn->IsParameter() && range->spill_slot().stack_index() >= 0) { |
|
srdjan
2013/06/11 17:12:02
Add parentheses.
Kevin Millikin (Google)
2013/06/14 10:10:42
Done.
|
| + // Parameters above the frame pointer consume spill slots and are marked |
| + // in stack maps. |
| + spill_slots_.Add(range_end); |
| + quad_spill_slots_.Add(false); |
| + MarkAsObjectAtSafepoints(range); |
| + } else if (defn->IsConstant() && block->IsCatchBlockEntry()) { |
| + // Constants at catch block entries consume spill slots. |
| + spill_slots_.Add(range_end); |
| + quad_spill_slots_.Add(false); |
| + } |
| } |
| @@ -1617,7 +1612,6 @@ void FlowGraphAllocator::AllocateSpillSlotFor(LiveRange* range) { |
| } |
| } |
| - |
| // Set spill slot expiration boundary to the live range's end. |
| spill_slots_[idx] = end; |
| if (need_quad) { |