Chromium Code Reviews| Index: runtime/vm/stack_frame.cc |
| diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc |
| index 01a67359e704d6a986aeebdec790a61575a57144..3dcdeeaa6e09084645adc60ed06714c218f54b67 100644 |
| --- a/runtime/vm/stack_frame.cc |
| +++ b/runtime/vm/stack_frame.cc |
| @@ -67,14 +67,20 @@ void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| // A stack map is present in the code object, use the stack map to visit |
| // frame slots which are marked as having objects. |
| intptr_t length = map.Length(); |
| - for (intptr_t bit_index = 0; bit_index < length; ++bit_index) { |
| - if (map.IsObject(bit_index)) { |
| - visitor->VisitPointer(end_addr - bit_index); |
| - } |
| + // Spill slots are at the 'bottom' of the frame. |
|
Vyacheslav Egorov (Google)
2012/08/27 14:54:51
This only works for calls with no arguments. Consi
Kevin Millikin (Google)
2012/08/29 12:40:41
Done.
|
| + intptr_t spill_slot_count = length - map.RegisterCount(); |
| + for (intptr_t bit = 0; bit < spill_slot_count; ++bit) { |
| + if (map.IsObject(bit)) visitor->VisitPointer(end_addr); |
| + --end_addr; |
| } |
| - // The stack slots that are not spill slots (i.e., outgoing arguments) |
| - // are tagged objects. |
| - end_addr -= length; |
| + |
| + // The live registers at the 'top' of the frame comprise the rest of the |
| + // stack map. |
| + for (intptr_t bit = length - 1; bit >= spill_slot_count; --bit) { |
| + if (map.IsObject(bit)) visitor->VisitPointer(start_addr); |
| + ++start_addr; |
| + } |
| + |
| // The end address can be one slot (but not more) past the start |
| // address in the case that all slots were covered by the stack map. |
| ASSERT((end_addr + 1) >= start_addr); |