diff options
author | Andreas Gampe <agampe@google.com> | 2014-03-10 13:37:40 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-03-12 15:16:12 -0700 |
commit | 36fea8dd490ab6439f391b8cd7f366c59f026fd2 (patch) | |
tree | 6720290f54717f7cee1116103cd1839147936146 /runtime/stack_indirect_reference_table.h | |
parent | 63dcdff34c40a64df6939ea5bba71813abd2acd3 (diff) | |
download | art-36fea8dd490ab6439f391b8cd7f366c59f026fd2.zip art-36fea8dd490ab6439f391b8cd7f366c59f026fd2.tar.gz art-36fea8dd490ab6439f391b8cd7f366c59f026fd2.tar.bz2 |
Fixing structure of native frame for Generic JNI
This changes the layout of the callee-save frame used in generic
JNI to be consistent with the JNI compiler, that is, the SIRT is
inline (above the method reference). Now the location of the
"this" object is consistent.
Change-Id: Ibad0882680712cb640b4c70ada0229ef7cf4e62c
Diffstat (limited to 'runtime/stack_indirect_reference_table.h')
-rw-r--r-- | runtime/stack_indirect_reference_table.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/runtime/stack_indirect_reference_table.h b/runtime/stack_indirect_reference_table.h index c2d6a59..e6dda85 100644 --- a/runtime/stack_indirect_reference_table.h +++ b/runtime/stack_indirect_reference_table.h @@ -39,7 +39,7 @@ class StackIndirectReferenceTable { ~StackIndirectReferenceTable() {} - // Number of references contained within this SIRT + // Number of references contained within this SIRT. uint32_t NumberOfReferences() const { return number_of_references_; } @@ -51,7 +51,13 @@ class StackIndirectReferenceTable { return header_size + data_size; } - // Link to previous SIRT or NULL + // Get the size of the SIRT for the number of entries, with padding added for potential alignment. + static size_t GetAlignedSirtSize(uint32_t num_references) { + size_t sirt_size = SizeOf(num_references); + return RoundUp(sirt_size, 8); + } + + // Link to previous SIRT or NULL. StackIndirectReferenceTable* GetLink() const { return link_; } @@ -72,6 +78,12 @@ class StackIndirectReferenceTable { return references_[i].AsMirrorPtr(); } + StackReference<mirror::Object>* GetStackReference(size_t i) + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { + DCHECK_LT(i, number_of_references_); + return &references_[i]; + } + void SetReference(size_t i, mirror::Object* object) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { DCHECK_LT(i, number_of_references_); references_[i].Assign(object); |