diff options
author | 2019-05-23 15:32:18 +0100 | |
---|---|---|
committer | 2019-05-25 10:30:57 +0000 | |
commit | 67ba872df798271d2960be27c7f1e813259feabc (patch) | |
tree | 93bb6a90a1e1810799faa0ab1e0d672ce041c0ed /compiler/optimizing/stack_map_stream.cc | |
parent | 436f6c1e53b735ace36fbfe48c337ece07d76e62 (diff) |
Optimize stack map decoding.
We usually read several consecutive varints.
Add helper method optimized for that use case
(ideally reading 8 varints from single load).
This improves app startup by 0.4% (maps,speed).
PMD on golem seems to get around 5% faster.
CodeInfo::Decode on its own is 25% faster.
Bug: 133257467
Test: ./art/test.py -b --host --64
Change-Id: Iaf7e8469ed6397b1d1d4102e409b5731f7229557
Diffstat (limited to 'compiler/optimizing/stack_map_stream.cc')
-rw-r--r-- | compiler/optimizing/stack_map_stream.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc index 60ca61c133..8c3664312d 100644 --- a/compiler/optimizing/stack_map_stream.cc +++ b/compiler/optimizing/stack_map_stream.cc @@ -52,6 +52,15 @@ void StackMapStream::BeginMethod(size_t frame_size_in_bytes, core_spill_mask_ = core_spill_mask; fp_spill_mask_ = fp_spill_mask; num_dex_registers_ = num_dex_registers; + + if (kVerifyStackMaps) { + dchecks_.emplace_back([=](const CodeInfo& code_info) { + DCHECK_EQ(code_info.packed_frame_size_, frame_size_in_bytes / kStackAlignment); + DCHECK_EQ(code_info.core_spill_mask_, core_spill_mask); + DCHECK_EQ(code_info.fp_spill_mask_, fp_spill_mask); + DCHECK_EQ(code_info.number_of_dex_registers_, num_dex_registers); + }); + } } void StackMapStream::EndMethod() { |