diff options
author | 2018-07-25 21:45:54 +0100 | |
---|---|---|
committer | 2018-07-26 11:45:54 +0100 | |
commit | 6ee06e97cef5ee92944deaeba0da4d10c4c33a2a (patch) | |
tree | 77d69c85d37864b4d3ee970be4b7fd1246adee7b /libartbase/base/bit_table.h | |
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 'libartbase/base/bit_table.h')
-rw-r--r-- | libartbase/base/bit_table.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libartbase/base/bit_table.h b/libartbase/base/bit_table.h index ee477215e7..1c7614b695 100644 --- a/libartbase/base/bit_table.h +++ b/libartbase/base/bit_table.h @@ -93,6 +93,7 @@ class BitTableBase { } ALWAYS_INLINE uint32_t Get(uint32_t row, uint32_t column = 0) const { + DCHECK_NE(header_bit_size_, 0u) << "Table has not been loaded"; DCHECK_LT(row, num_rows_); DCHECK_LT(column, kNumColumns); size_t offset = row * NumRowBits() + column_offset_[column]; @@ -100,6 +101,7 @@ class BitTableBase { } ALWAYS_INLINE BitMemoryRegion GetBitMemoryRegion(uint32_t row, uint32_t column = 0) const { + DCHECK_NE(header_bit_size_, 0u) << "Table has not been loaded"; DCHECK_LT(row, num_rows_); DCHECK_LT(column, kNumColumns); size_t offset = row * NumRowBits() + column_offset_[column]; |