Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Unified Diff: runtime/vm/stack_frame_dbc.h

Issue 2176413003: DBC: Fix reading locals out of a deopt frame. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stack_frame.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « runtime/vm/stack_frame.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698