diff options
author | 2018-07-25 21:45:54 +0100 | |
---|---|---|
committer | 2018-07-26 11:45:54 +0100 | |
commit | 6ee06e97cef5ee92944deaeba0da4d10c4c33a2a (patch) | |
tree | 77d69c85d37864b4d3ee970be4b7fd1246adee7b /runtime/stack_map.cc | |
parent | f5dcd31d89282b6c9324fdc960e6e7e2281c16f1 (diff) |
Decode only the needed tables from CodeInfo.
Most use cases need only the first two bit tables from CodeInfo.
Add flag to the decode method so that only those two are loaded.
We only touched the table header but that still made difference.
This speeds up pmd by over 10%.
Test: test-art-host-gtest
Change-Id: I7740081bf18205dd69864503b5bcec7de5e1a901
Diffstat (limited to 'runtime/stack_map.cc')
-rw-r--r-- | runtime/stack_map.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/stack_map.cc b/runtime/stack_map.cc index 9fa9d84993..62b9f35341 100644 --- a/runtime/stack_map.cc +++ b/runtime/stack_map.cc @@ -27,11 +27,11 @@ namespace art { -CodeInfo::CodeInfo(const OatQuickMethodHeader* header) - : CodeInfo(header->GetOptimizedCodeInfoPtr()) { +CodeInfo::CodeInfo(const OatQuickMethodHeader* header, DecodeFlags flags) + : CodeInfo(header->GetOptimizedCodeInfoPtr(), flags) { } -void CodeInfo::Decode(const uint8_t* data) { +void CodeInfo::Decode(const uint8_t* data, DecodeFlags flags) { const uint8_t* begin = data; frame_size_in_bytes_ = DecodeUnsignedLeb128(&data); core_spill_mask_ = DecodeUnsignedLeb128(&data); @@ -39,9 +39,12 @@ void CodeInfo::Decode(const uint8_t* data) { number_of_dex_registers_ = DecodeUnsignedLeb128(&data); BitMemoryReader reader(data, /* bit_offset */ 0); stack_maps_.Decode(reader); + inline_infos_.Decode(reader); + if (flags & DecodeFlags::InlineInfoOnly) { + return; + } register_masks_.Decode(reader); stack_masks_.Decode(reader); - inline_infos_.Decode(reader); dex_register_masks_.Decode(reader); dex_register_maps_.Decode(reader); dex_register_catalog_.Decode(reader); |