From a38e6cf2aaf4fd3d92b05c0a7a146fb5525ea72d Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Tue, 26 Jun 2018 18:13:49 +0100 Subject: Remove explicit size from CodeInfo. It was mostly there since it was necessary to create the bound-checked MemoryRegion for loading. The new BitMemoryReader interface is much easier to tweak to avoid needing to know the size ahead of time. Keep the CHECK that the loader reads the expected number of bytes, but move it to FillInCodeInfo. This saves 0.2% of .oat file size. Test: test-art-host-gtest-stack_map_test Test: test-art-host-gtest-bit_table_test Change-Id: I92ee936e9fd004da61b90841aff9c9f2029fcfbf --- runtime/stack_map.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'runtime/stack_map.h') diff --git a/runtime/stack_map.h b/runtime/stack_map.h index cb43ced2a5..ad52f377cf 100644 --- a/runtime/stack_map.h +++ b/runtime/stack_map.h @@ -289,13 +289,13 @@ class CodeInfo { } explicit CodeInfo(MemoryRegion region) : CodeInfo(region.begin()) { - DCHECK_EQ(size_, region.size()); + DCHECK_EQ(Size(), region.size()); } explicit CodeInfo(const OatQuickMethodHeader* header); size_t Size() const { - return size_; + return BitsToBytesRoundUp(size_in_bits_); } bool HasInlineInfo() const { @@ -436,7 +436,6 @@ class CodeInfo { void AddSizeStats(/*out*/ Stats* parent) const; ALWAYS_INLINE static QuickMethodFrameInfo DecodeFrameInfo(const uint8_t* data) { - DecodeUnsignedLeb128(&data); return QuickMethodFrameInfo( DecodeUnsignedLeb128(&data), DecodeUnsignedLeb128(&data), @@ -455,7 +454,6 @@ 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_; @@ -468,6 +466,7 @@ class CodeInfo { BitTable dex_register_masks_; BitTable dex_register_maps_; BitTable dex_register_catalog_; + uint32_t size_in_bits_; }; #undef ELEMENT_BYTE_OFFSET_AFTER -- cgit v1.2.3-59-g8ed1b