From d776ff08e07494327716f0d2ea1a774b2ebfbca9 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 17 Jan 2017 09:32:18 -0800 Subject: Add invoke infos to stack maps Invoke info records the invoke type and dex method index for invokes that may reach artQuickResolutionTrampoline. Having this information recorded allows the runtime to avoid reading the dex code and pulling in extra pages. Code size increase for a large app: 93886360 -> 95811480 (2.05% increase) 1/2 of the code size increase is from making less stack maps deduped. I suspect there is less deduping because of the invoke info method index. Merged disabled until we measure the RAM savings. Test: test-art-host, N6P boots Bug: 34109702 Change-Id: I6c5e4a60675a1d7c76dee0561a12909e4ab6d5d9 --- compiler/optimizing/stack_map_stream.h | 12 ++++++++++++ 1 file changed, 12 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 bba3d51e62..4225a875b9 100644 --- a/compiler/optimizing/stack_map_stream.h +++ b/compiler/optimizing/stack_map_stream.h @@ -118,6 +118,8 @@ class StackMapStream : public ValueObject { uint32_t register_mask_index; DexRegisterMapEntry dex_register_entry; size_t dex_register_map_index; + InvokeType invoke_type; + uint32_t dex_method_index; }; struct InlineInfoEntry { @@ -138,6 +140,8 @@ class StackMapStream : public ValueObject { void AddDexRegisterEntry(DexRegisterLocation::Kind kind, int32_t value); + void AddInvoke(InvokeType type, uint32_t dex_method_index); + void BeginInlineInfoEntry(ArtMethod* method, uint32_t dex_pc, uint32_t num_dex_registers, @@ -183,6 +187,14 @@ class StackMapStream : public ValueObject { // Return true if the two dex register map entries are equal. bool DexRegisterMapEntryEquals(const DexRegisterMapEntry& a, const DexRegisterMapEntry& b) const; + // Fill in the corresponding entries of a register map. + void ComputeInvokeInfoEncoding(CodeInfoEncoding* encoding); + + // 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(); + bool HaveTheSameDexMaps(const StackMapEntry& a, const StackMapEntry& b) const; + // Fill in the corresponding entries of a register map. void FillInDexRegisterMap(DexRegisterMap dex_register_map, uint32_t num_dex_registers, -- cgit v1.2.3-59-g8ed1b