OSDN Git Service

Fix GetOutVROffset to use correct Method* size.
authorbuzbee <buzbee@google.com>
Wed, 4 Jun 2014 22:35:41 +0000 (15:35 -0700)
committerbuzbee <buzbee@google.com>
Wed, 4 Jun 2014 23:00:40 +0000 (16:00 -0700)
[Tip 'o the hat to Mark Mendell for noticing this one]

Use StackReference to find Method* size in GetOutVROffset.

Change-Id: Ie1b25eb839c59305cadc5fdc7cbb5f41f1a85686

runtime/stack.h

index e1c8c80..1991115 100644 (file)
@@ -661,13 +661,14 @@ class StackVisitor {
       return locals_start + (reg * sizeof(uint32_t));
     } else {
       // Handle ins.
-      return frame_size + ((reg - num_regs) * sizeof(uint32_t)) + sizeof(StackReference<mirror::ArtMethod>);
+      return frame_size + ((reg - num_regs) * sizeof(uint32_t)) +
+          sizeof(StackReference<mirror::ArtMethod>);
     }
   }
 
   static int GetOutVROffset(uint16_t out_num, InstructionSet isa) {
-    // According to stack model, the first out is above the Method ptr.
-    return GetBytesPerGprSpillLocation(isa) + (out_num * sizeof(uint32_t));
+    // According to stack model, the first out is above the Method referernce.
+    return sizeof(StackReference<mirror::ArtMethod>) + (out_num * sizeof(uint32_t));
   }
 
   uintptr_t GetCurrentQuickFramePc() const {