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
diff --git a/runtime/stack_map.h b/runtime/stack_map.h
index 26b95b0..928f0f2 100644
--- a/runtime/stack_map.h
+++ b/runtime/stack_map.h
@@ -268,15 +268,22 @@
  */
 class CodeInfo {
  public:
-  explicit CodeInfo(const void* data) {
-    Decode(reinterpret_cast<const uint8_t*>(data));
+  enum DecodeFlags {
+    Default = 0,
+    // Limits the decoding only to the main stack map table and inline info table.
+    // This is sufficient for many use cases and makes the header decoding faster.
+    InlineInfoOnly = 1,
+  };
+
+  explicit CodeInfo(const uint8_t* data, DecodeFlags flags = DecodeFlags::Default) {
+    Decode(reinterpret_cast<const uint8_t*>(data), flags);
   }
 
   explicit CodeInfo(MemoryRegion region) : CodeInfo(region.begin()) {
     DCHECK_EQ(Size(), region.size());
   }
 
-  explicit CodeInfo(const OatQuickMethodHeader* header);
+  explicit CodeInfo(const OatQuickMethodHeader* header, DecodeFlags flags = DecodeFlags::Default);
 
   size_t Size() const {
     return BitsToBytesRoundUp(size_in_bits_);
@@ -421,20 +428,20 @@
                             uint32_t first_dex_register,
                             /*out*/ DexRegisterMap* map) const;
 
-  void Decode(const uint8_t* data);
+  void Decode(const uint8_t* data, DecodeFlags flags);
 
   uint32_t frame_size_in_bytes_;
   uint32_t core_spill_mask_;
   uint32_t fp_spill_mask_;
   uint32_t number_of_dex_registers_;
   BitTable<StackMap> stack_maps_;
+  BitTable<InlineInfo> inline_infos_;
   BitTable<RegisterMask> register_masks_;
   BitTable<MaskInfo> stack_masks_;
-  BitTable<InlineInfo> inline_infos_;
   BitTable<MaskInfo> dex_register_masks_;
   BitTable<DexRegisterMapInfo> dex_register_maps_;
   BitTable<DexRegisterInfo> dex_register_catalog_;
-  uint32_t size_in_bits_;
+  uint32_t size_in_bits_ = 0;
 };
 
 #undef ELEMENT_BYTE_OFFSET_AFTER