summaryrefslogtreecommitdiff
path: root/runtime/stack_map.cc
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2018-06-23 22:05:49 +0100
committerDavid Srbecky <dsrbecky@google.com>2018-06-26 16:51:15 +0100
commitf6ba5b316b51d0fb9f91cb51a42e51dfeee62ee4 (patch)
treeac3b776ae3c20fc957949d06dd878ef3ffa6ffb5 /runtime/stack_map.cc
parentcca7cb9ffa56d8ab8fd0c5997c8bfd965d7426c1 (diff)
Add method frame info to CodeInfo.
The stored information will be used in follow-up CLs. This temporarily increases .oat file size by 0.7%. Test: test-art-host-gtest Change-Id: Ie7d898b06398ae44287bb1e8153861ab112a216c
Diffstat (limited to 'runtime/stack_map.cc')
-rw-r--r--runtime/stack_map.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/runtime/stack_map.cc b/runtime/stack_map.cc
index 7f7f6fce0a..42d24784de 100644
--- a/runtime/stack_map.cc
+++ b/runtime/stack_map.cc
@@ -22,14 +22,24 @@
#include "art_method.h"
#include "base/indenter.h"
#include "base/stats.h"
+#include "oat_quick_method_header.h"
#include "scoped_thread_state_change-inl.h"
namespace art {
+CodeInfo::CodeInfo(const OatQuickMethodHeader* header)
+ : CodeInfo(header->GetOptimizedCodeInfoPtr()) {
+}
+
void CodeInfo::Decode(const uint8_t* data) {
size_t non_header_size = DecodeUnsignedLeb128(&data);
size_ = UnsignedLeb128Size(non_header_size) + non_header_size;
- MemoryRegion region(const_cast<uint8_t*>(data), non_header_size);
+ const uint8_t* end = data + non_header_size;
+ frame_size_in_bytes_ = DecodeUnsignedLeb128(&data);
+ core_spill_mask_ = DecodeUnsignedLeb128(&data);
+ fp_spill_mask_ = DecodeUnsignedLeb128(&data);
+ number_of_dex_registers_ = DecodeUnsignedLeb128(&data);
+ MemoryRegion region(const_cast<uint8_t*>(data), end - data);
BitMemoryReader reader(BitMemoryRegion(region), /* bit_offset */ 0);
stack_maps_.Decode(reader);
register_masks_.Decode(reader);
@@ -39,8 +49,7 @@ void CodeInfo::Decode(const uint8_t* data) {
dex_register_masks_.Decode(reader);
dex_register_maps_.Decode(reader);
dex_register_catalog_.Decode(reader);
- number_of_dex_registers_ = DecodeVarintBits(reader);
- CHECK_EQ(non_header_size, BitsToBytesRoundUp(reader.GetBitOffset())) << "Invalid CodeInfo";
+ CHECK_EQ(BitsToBytesRoundUp(reader.GetBitOffset()), region.size()) << "Invalid CodeInfo";
}
BitTable<StackMap>::const_iterator CodeInfo::BinarySearchNativePc(uint32_t packed_pc) const {