From f6ba5b316b51d0fb9f91cb51a42e51dfeee62ee4 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Sat, 23 Jun 2018 22:05:49 +0100 Subject: 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 --- runtime/stack_map.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'runtime/stack_map.h') diff --git a/runtime/stack_map.h b/runtime/stack_map.h index 83f0c05501..cb43ced2a5 100644 --- a/runtime/stack_map.h +++ b/runtime/stack_map.h @@ -19,6 +19,7 @@ #include +#include "arch/instruction_set.h" #include "base/bit_memory_region.h" #include "base/bit_table.h" #include "base/bit_utils.h" @@ -28,10 +29,11 @@ #include "dex/dex_file_types.h" #include "dex_register_location.h" #include "method_info.h" -#include "oat_quick_method_header.h" +#include "quick/quick_method_frame_info.h" namespace art { +class OatQuickMethodHeader; class VariableIndentationOutputStream; // Size of a frame slot, in bytes. This constant is a signed value, @@ -290,9 +292,7 @@ class CodeInfo { DCHECK_EQ(size_, region.size()); } - explicit CodeInfo(const OatQuickMethodHeader* header) - : CodeInfo(header->GetOptimizedCodeInfoPtr()) { - } + explicit CodeInfo(const OatQuickMethodHeader* header); size_t Size() const { return size_; @@ -435,6 +435,14 @@ class CodeInfo { // Accumulate code info size statistics into the given Stats tree. void AddSizeStats(/*out*/ Stats* parent) const; + ALWAYS_INLINE static QuickMethodFrameInfo DecodeFrameInfo(const uint8_t* data) { + DecodeUnsignedLeb128(&data); + return QuickMethodFrameInfo( + DecodeUnsignedLeb128(&data), + DecodeUnsignedLeb128(&data), + DecodeUnsignedLeb128(&data)); + } + private: // Returns lower bound (fist stack map which has pc greater or equal than the desired one). // It ignores catch stack maps at the end (it is the same as if they had maximum pc value). @@ -448,6 +456,10 @@ class CodeInfo { void Decode(const uint8_t* data); size_t size_; + uint32_t frame_size_in_bytes_; + uint32_t core_spill_mask_; + uint32_t fp_spill_mask_; + uint32_t number_of_dex_registers_; BitTable stack_maps_; BitTable register_masks_; BitTable stack_masks_; @@ -456,7 +468,6 @@ class CodeInfo { BitTable dex_register_masks_; BitTable dex_register_maps_; BitTable dex_register_catalog_; - uint32_t number_of_dex_registers_; // Excludes any inlined methods. }; #undef ELEMENT_BYTE_OFFSET_AFTER -- cgit v1.2.3-59-g8ed1b