diff options
author | Dmitry Petrochenko <dmitry.petrochenko@intel.com> | 2014-03-31 09:12:31 +0700 |
---|---|---|
committer | Dmitry Petrochenko <dmitry.petrochenko@intel.com> | 2014-04-01 10:24:51 +0700 |
commit | f0513c591271f93df76c46d672eed4a00cd4184b (patch) | |
tree | f1648f9a920218bb74bdd81b230a0f71055ffa12 | |
parent | 81ed34e686532cebc1e17a273110decf0dd24e81 (diff) | |
download | art-f0513c591271f93df76c46d672eed4a00cd4184b.zip art-f0513c591271f93df76c46d672eed4a00cd4184b.tar.gz art-f0513c591271f93df76c46d672eed4a00cd4184b.tar.bz2 |
art: Make calling convention immune to SIRT structure change
Introduce stack_indirect_reference_table::referencesOffset and
rely on it in calling convention to avoid issues if SIRT structure
change.
Change-Id: Icc0c5c5b1313173df2ee519ab8934183074fdfb6
Signed-off-by: Dmitry Petrochenko <dmitry.petrochenko@intel.com>
-rw-r--r-- | compiler/jni/quick/calling_convention.h | 5 | ||||
-rw-r--r-- | runtime/stack_indirect_reference_table.h | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/compiler/jni/quick/calling_convention.h b/compiler/jni/quick/calling_convention.h index fe3d1cd..4950905 100644 --- a/compiler/jni/quick/calling_convention.h +++ b/compiler/jni/quick/calling_convention.h @@ -298,9 +298,8 @@ class JniCallingConvention : public CallingConvention { } FrameOffset SirtReferencesOffset() const { - // The StackIndirectReferenceTable::number_of_references_ type is uint32_t - return FrameOffset(SirtNumRefsOffset().Int32Value() + - sizeof(uint32_t)); + return FrameOffset(SirtOffset().Int32Value() + + StackIndirectReferenceTable::ReferencesOffset()); } virtual ~JniCallingConvention() {} diff --git a/runtime/stack_indirect_reference_table.h b/runtime/stack_indirect_reference_table.h index e6dda85..daef3ff 100644 --- a/runtime/stack_indirect_reference_table.h +++ b/runtime/stack_indirect_reference_table.h @@ -98,14 +98,19 @@ class StackIndirectReferenceTable { && (sirt_entry <= (&references_[number_of_references_ - 1]))); } + // Offset of link within SIRT, used by generated code + static size_t LinkOffset() { + return OFFSETOF_MEMBER(StackIndirectReferenceTable, link_); + } + // Offset of length within SIRT, used by generated code static uint32_t NumberOfReferencesOffset() { return OFFSETOF_MEMBER(StackIndirectReferenceTable, number_of_references_); } // Offset of link within SIRT, used by generated code - static size_t LinkOffset() { - return OFFSETOF_MEMBER(StackIndirectReferenceTable, link_); + static size_t ReferencesOffset() { + return OFFSETOF_MEMBER(StackIndirectReferenceTable, references_); } private: |