diff options
Diffstat (limited to 'runtime/stack_map.cc')
-rw-r--r-- | runtime/stack_map.cc | 15 |
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 { |