Also encode the InvokeType in an InlineInfo.
This will be needed to recover the call stack.
Change-Id: I2fe10785eb1167939c8cce1862b2d7f4066e16ec
diff --git a/runtime/stack_map.h b/runtime/stack_map.h
index 16ae772..f07fb74 100644
--- a/runtime/stack_map.h
+++ b/runtime/stack_map.h
@@ -735,31 +735,43 @@
}
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 @@
}
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 @@
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;