diff options
author | 2015-05-20 18:48:31 +0100 | |
---|---|---|
committer | 2015-05-21 12:10:00 +0100 | |
commit | b176d7c6c8c01a50317f837a78de5da57ee84fb2 (patch) | |
tree | 81ec0c16267c527bdc64923b374be915206e6af9 /runtime/stack_map.h | |
parent | 713c59e813daa92da3f1678add6c4c7e16dcff11 (diff) |
Also encode the InvokeType in an InlineInfo.
This will be needed to recover the call stack.
Change-Id: I2fe10785eb1167939c8cce1862b2d7f4066e16ec
Diffstat (limited to 'runtime/stack_map.h')
-rw-r--r-- | runtime/stack_map.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/runtime/stack_map.h b/runtime/stack_map.h index 16ae772caf..f07fb74eb4 100644 --- a/runtime/stack_map.h +++ b/runtime/stack_map.h @@ -735,31 +735,43 @@ class InlineInfo { } uint32_t GetMethodIndexAtDepth(uint8_t depth) const { - return region_.LoadUnaligned<uint32_t>(kFixedSize + depth * SingleEntrySize()); + return region_.LoadUnaligned<uint32_t>( + kFixedSize + depth * SingleEntrySize() + kMethodIndexOffset); } void SetMethodIndexAtDepth(uint8_t depth, uint32_t index) { - region_.StoreUnaligned<uint32_t>(kFixedSize + depth * SingleEntrySize(), index); + region_.StoreUnaligned<uint32_t>( + kFixedSize + depth * SingleEntrySize() + kMethodIndexOffset, index); } uint32_t GetDexPcAtDepth(uint8_t depth) const { return region_.LoadUnaligned<uint32_t>( - kFixedSize + depth * SingleEntrySize() + sizeof(uint32_t)); + kFixedSize + depth * SingleEntrySize() + kDexPcOffset); } void SetDexPcAtDepth(uint8_t depth, uint32_t dex_pc) { region_.StoreUnaligned<uint32_t>( - kFixedSize + depth * SingleEntrySize() + sizeof(uint32_t), dex_pc); + kFixedSize + depth * SingleEntrySize() + kDexPcOffset, dex_pc); + } + + uint8_t GetInvokeTypeAtDepth(uint8_t depth) const { + return region_.LoadUnaligned<uint8_t>( + kFixedSize + depth * SingleEntrySize() + kInvokeTypeOffset); + } + + void SetInvokeTypeAtDepth(uint8_t depth, uint8_t invoke_type) { + region_.StoreUnaligned<uint8_t>( + kFixedSize + depth * SingleEntrySize() + kInvokeTypeOffset, invoke_type); } uint32_t GetDexRegisterMapOffsetAtDepth(uint8_t depth) const { return region_.LoadUnaligned<uint32_t>( - kFixedSize + depth * SingleEntrySize() + sizeof(uint32_t) + sizeof(uint32_t)); + kFixedSize + depth * SingleEntrySize() + kDexRegisterMapOffset); } void SetDexRegisterMapOffsetAtDepth(uint8_t depth, uint32_t offset) { region_.StoreUnaligned<uint32_t>( - kFixedSize + depth * SingleEntrySize() + sizeof(uint32_t) + sizeof(uint32_t), offset); + kFixedSize + depth * SingleEntrySize() + kDexRegisterMapOffset, offset); } bool HasDexRegisterMapAtDepth(uint8_t depth) const { @@ -767,7 +779,7 @@ class InlineInfo { } static size_t SingleEntrySize() { - return sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint32_t); + return kFixedEntrySize; } void Dump(std::ostream& os, const CodeInfo& info, uint16_t* number_of_dex_registers) const; @@ -778,6 +790,12 @@ class InlineInfo { static constexpr int kDepthOffset = 0; static constexpr int kFixedSize = kDepthOffset + sizeof(uint8_t); + static constexpr int kMethodIndexOffset = 0; + static constexpr int kDexPcOffset = kMethodIndexOffset + sizeof(uint32_t); + static constexpr int kInvokeTypeOffset = kDexPcOffset + sizeof(uint32_t); + static constexpr int kDexRegisterMapOffset = kInvokeTypeOffset + sizeof(uint8_t); + static constexpr int kFixedEntrySize = kDexRegisterMapOffset + sizeof(uint32_t); + MemoryRegion region_; friend class CodeInfo; |