Optimize stack maps: add fast path for no inline info.
Consumers of CodeInfo can skip significant chunks of work
if they can quickly determine that method has no inlining.
Store this fact as a flag bit at the start of code info.
This changes binary format and adds <0.1% to oat size.
I added the extra flag field as the simplest solution for now,
although I would like to use it for more things in the future.
(e.g. store the special cases of empty/deduped tables in it)
This improves app startup by 0.4% (maps,speed).
PMD on golem seems to gets around 15% faster.
Bug: 133257467
Test: ./art/test.py -b --host --64
Change-Id: Ia498a31bafc74b51cc95b8c70cf1da4b0e3d894e
diff --git a/runtime/stack_map.cc b/runtime/stack_map.cc
index 6585a3b..eef7378 100644
--- a/runtime/stack_map.cc
+++ b/runtime/stack_map.cc
@@ -47,16 +47,20 @@
void CodeInfo::Decode(const uint8_t* data, DecodeFlags flags) {
BitMemoryReader reader(data);
- uint32_t header[4];
+ uint32_t header[5];
reader.ReadVarints(header);
- packed_frame_size_ = header[0];
- core_spill_mask_ = header[1];
- fp_spill_mask_ = header[2];
- number_of_dex_registers_ = header[3];
+ flags_ = header[0];
+ packed_frame_size_ = header[1];
+ core_spill_mask_ = header[2];
+ fp_spill_mask_ = header[3];
+ number_of_dex_registers_ = header[4];
ForEachBitTableField([this, &reader](auto member_pointer) {
DecodeTable(this->*member_pointer, reader);
}, flags);
size_in_bits_ = reader.NumberOfReadBits();
+ if (flags == AllTables) {
+ DCHECK_EQ(HasInlineInfo(data), HasInlineInfo());
+ }
}
size_t CodeInfo::Deduper::Dedupe(const uint8_t* code_info_data) {
@@ -230,6 +234,7 @@
bool verbose,
InstructionSet instruction_set) const {
vios->Stream() << "CodeInfo BitSize=" << size_in_bits_
+ << " Flags:" << flags_
<< " FrameSize:" << packed_frame_size_ * kStackAlignment
<< " CoreSpillMask:" << std::hex << core_spill_mask_
<< " FpSpillMask:" << std::hex << fp_spill_mask_