Don't pack code size in CodeInfo.
The unpacking is tricky for host tooling as we need to propagate ISA.
This adds 0.05% to oat file size.
Bug: 123510633
Change-Id: I5618db5e5dbe83d8a2bb89aef61cb0b10e336f40
diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc
index e87f3c8..c0e3206 100644
--- a/compiler/optimizing/stack_map_stream.cc
+++ b/compiler/optimizing/stack_map_stream.cc
@@ -57,7 +57,7 @@
void StackMapStream::EndMethod(size_t code_size) {
DCHECK(in_method_) << "Mismatched Begin/End calls";
in_method_ = false;
- packed_code_size_ = StackMap::PackNativePc(code_size, instruction_set_);
+ code_size_ = code_size;
// Read the stack masks now. The compiler might have updated them.
for (size_t i = 0; i < lazy_stack_masks_.size(); i++) {
@@ -68,8 +68,9 @@
}
}
+ uint32_t packed_code_size = StackMap::PackNativePc(code_size, instruction_set_);
for (size_t i = 0; i < stack_maps_.size(); i++) {
- DCHECK_LE(stack_maps_[i][StackMap::kPackedNativePc], packed_code_size_);
+ DCHECK_LE(stack_maps_[i][StackMap::kPackedNativePc], packed_code_size);
}
}
@@ -301,7 +302,7 @@
ScopedArenaVector<uint8_t> buffer(allocator_->Adapter(kArenaAllocStackMapStream));
BitMemoryWriter<ScopedArenaVector<uint8_t>> out(&buffer);
- out.WriteVarint(packed_code_size_);
+ out.WriteVarint(code_size_);
out.WriteVarint(packed_frame_size_);
out.WriteVarint(core_spill_mask_);
out.WriteVarint(fp_spill_mask_);