diff options
author | Andreas Gampe <agampe@google.com> | 2014-04-03 13:31:32 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-04-03 13:31:32 -0700 |
commit | 242947dbcdc4038ddd8ac522bb480f82e7d92ffa (patch) | |
tree | a84dc663494a1dbadd0f209788ae071742381309 /runtime/stack_indirect_reference_table.h | |
parent | 0537c5ea92a4fb60a04024cc2b7247f08a3d9096 (diff) | |
download | art-242947dbcdc4038ddd8ac522bb480f82e7d92ffa.zip art-242947dbcdc4038ddd8ac522bb480f82e7d92ffa.tar.gz art-242947dbcdc4038ddd8ac522bb480f82e7d92ffa.tar.bz2 |
Make frame size dependent on arch-specific constants.
Necessary for proper cross-compiling.
Change-Id: I852901ee6ca5121e480b83a8e318bdc9c7d615e8
Diffstat (limited to 'runtime/stack_indirect_reference_table.h')
-rw-r--r-- | runtime/stack_indirect_reference_table.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/stack_indirect_reference_table.h b/runtime/stack_indirect_reference_table.h index daef3ff..6049e06 100644 --- a/runtime/stack_indirect_reference_table.h +++ b/runtime/stack_indirect_reference_table.h @@ -57,6 +57,16 @@ class StackIndirectReferenceTable { return RoundUp(sirt_size, 8); } + // Get the size of the SIRT for the number of entries, with padding added for potential alignment. + static size_t GetAlignedSirtSizeTarget(size_t pointer_size, uint32_t num_references) { + // Assume that the layout is packed. + size_t header_size = pointer_size + sizeof(uint32_t); + // This assumes there is no layout change between 32 and 64b. + size_t data_size = sizeof(StackReference<mirror::Object>) * num_references; + size_t sirt_size = header_size + data_size; + return RoundUp(sirt_size, 8); + } + // Link to previous SIRT or NULL. StackIndirectReferenceTable* GetLink() const { return link_; |