Index: runtime/vm/stack_frame_dbc.h |
diff --git a/runtime/vm/stack_frame_dbc.h b/runtime/vm/stack_frame_dbc.h |
index a59a417ed883b3b341be303dba46731e3669c626..5d5ee78e3aedac4b83650050fd38494e7ded919a 100644 |
--- a/runtime/vm/stack_frame_dbc.h |
+++ b/runtime/vm/stack_frame_dbc.h |
@@ -10,7 +10,7 @@ namespace dart { |
/* DBC Frame Layout |
IMPORTANT: On DBC stack is growing upwards which is different from all other |
-architectures. This enables effecient addressing for locals via unsigned index. |
+architectures. This enables efficient addressing for locals via unsigned index. |
| | <- TOS |
Callee frame | ... | |
@@ -56,15 +56,17 @@ static const int kParamEndSlotFromFp = 4; // One slot past last parameter. |
static const int kFirstLocalSlotFromFp = -1; |
-DART_FORCE_INLINE static uword LocalVarAddress(uword fp, intptr_t index) { |
- ASSERT(index != 0); |
- if (index > 0) { |
- return fp - index * kWordSize; |
+DART_FORCE_INLINE static intptr_t LocalVarIndex(intptr_t fp_offset, |
+ intptr_t var_index) { |
+ ASSERT(var_index != 0); |
+ if (var_index > 0) { |
+ return fp_offset - var_index; |
} else { |
- return fp - (index + 1) * kWordSize; |
+ return fp_offset - (var_index + 1); |
} |
} |
+ |
DART_FORCE_INLINE static uword ParamAddress(uword fp, intptr_t reverse_index) { |
return fp - (kDartFrameFixedSize + reverse_index) * kWordSize; |
} |