From 6ee06e97cef5ee92944deaeba0da4d10c4c33a2a Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Wed, 25 Jul 2018 21:45:54 +0100 Subject: 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 --- runtime/stack_map.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'runtime/stack_map.cc') 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); -- cgit v1.2.3-59-g8ed1b