From 45aa598cd1773f5eb1705dec13bea059238e054d Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Fri, 18 Mar 2016 02:15:09 +0000 Subject: Deduplicate stack masks The stack masks repeat often enough so that it is worth deduplicating them. Oat size for a large app: 98143600 -> 96722288 (-1.44%) Bug: 34621054 Test: test-art-host Change-Id: If73d51e46066357049d5be2e406ae9a32b7ff1f4 --- compiler/optimizing/stack_map_stream.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler/optimizing/stack_map_stream.h') diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h index 8fec472437..e2e16e8203 100644 --- a/compiler/optimizing/stack_map_stream.h +++ b/compiler/optimizing/stack_map_stream.h @@ -68,6 +68,7 @@ class StackMapStream : public ValueObject { location_catalog_entries_indices_(allocator->Adapter(kArenaAllocStackMapStream)), dex_register_locations_(allocator->Adapter(kArenaAllocStackMapStream)), inline_infos_(allocator->Adapter(kArenaAllocStackMapStream)), + stack_masks_(allocator->Adapter(kArenaAllocStackMapStream)), stack_mask_max_(-1), dex_pc_max_(0), register_mask_max_(0), @@ -107,6 +108,7 @@ class StackMapStream : public ValueObject { BitVector* live_dex_registers_mask; uint32_t dex_register_map_hash; size_t same_dex_register_map_as_; + uint32_t stack_mask_index; }; struct InlineInfoEntry { @@ -160,6 +162,9 @@ class StackMapStream : public ValueObject { CodeOffset ComputeMaxNativePcCodeOffset() const; + // Returns the number of unique stack masks. + size_t PrepareStackMasks(size_t entry_size_in_bits); + // Returns the index of an entry with the same dex register map as the current_entry, // or kNoSameDexMapFound if no such entry exists. size_t FindEntryWithTheSameDexMap(); @@ -193,6 +198,7 @@ class StackMapStream : public ValueObject { // A set of concatenated maps of Dex register locations indices to `location_catalog_entries_`. ArenaVector dex_register_locations_; ArenaVector inline_infos_; + ArenaVector stack_masks_; int stack_mask_max_; uint32_t dex_pc_max_; uint32_t register_mask_max_; -- cgit v1.2.3-59-g8ed1b