Remove the hard coded "constants" related to shadow frame.
(cherry picked from commit ae63b2a5ae3fa64bc07369c22efcf5617d55cc16)
Change-Id: I4f00bcda535b080fd0acb586ef699d101a418675
diff --git a/src/shadow_frame.h b/src/shadow_frame.h
index 533d924..3bdee8e 100644
--- a/src/shadow_frame.h
+++ b/src/shadow_frame.h
@@ -51,6 +51,31 @@
references_[i] = object;
}
+ // Offset of link within shadow frame
+ static size_t LinkOffset() {
+ return OFFSETOF_MEMBER(ShadowFrame, link_);
+ }
+
+ // Offset of method within shadow frame
+ static size_t MethodOffset() {
+ return OFFSETOF_MEMBER(ShadowFrame, method_);
+ }
+
+ // Offset of line number within shadow frame
+ static size_t LineNumOffset() {
+ return OFFSETOF_MEMBER(ShadowFrame, line_num_);
+ }
+
+ // Offset of length within shadow frame
+ static size_t NumberOfReferencesOffset() {
+ return OFFSETOF_MEMBER(ShadowFrame, number_of_references_);
+ }
+
+ // Offset of references within shadow frame
+ static size_t ReferencesOffset() {
+ return OFFSETOF_MEMBER(ShadowFrame, references_);
+ }
+
private:
// ShadowFrame should be allocated by the generated code directly.
// We should not create new shadow stack in the runtime support function.