diff options
author | 2018-06-26 18:13:49 +0100 | |
---|---|---|
committer | 2018-06-27 10:15:32 +0100 | |
commit | a38e6cf2aaf4fd3d92b05c0a7a146fb5525ea72d (patch) | |
tree | 377c74c834776b9942bb7c2853e44447dac27f83 /runtime/stack_map.h | |
parent | f6ba5b316b51d0fb9f91cb51a42e51dfeee62ee4 (diff) |
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
Diffstat (limited to 'runtime/stack_map.h')
-rw-r--r-- | runtime/stack_map.h | 7 |
1 files changed, 3 insertions, 4 deletions
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<MaskInfo> dex_register_masks_; BitTable<DexRegisterMapInfo> dex_register_maps_; BitTable<DexRegisterInfo> dex_register_catalog_; + uint32_t size_in_bits_; }; #undef ELEMENT_BYTE_OFFSET_AFTER |