Revert^2 "Add code size to CodeInfo"
This temporarily adds 0.25% to oat file size.
The space will be reclaimed back in follow-up CL.
This reverts commit 8f20a23a35fa6fbe4dcb4ff70268a24dc7fb2a24.
Reason for revert: Reland as-is after CL/903819
Bug: 123510633
Test: DCHECK compare the two stored code sizes.
Change-Id: Ia3ab31c208948f4996188764fcdcba13d9977d19
diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc
index 60ca61c..e87f3c8 100644
--- a/compiler/optimizing/stack_map_stream.cc
+++ b/compiler/optimizing/stack_map_stream.cc
@@ -54,9 +54,10 @@
num_dex_registers_ = num_dex_registers;
}
-void StackMapStream::EndMethod() {
+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_);
// Read the stack masks now. The compiler might have updated them.
for (size_t i = 0; i < lazy_stack_masks_.size(); i++) {
@@ -66,6 +67,10 @@
stack_masks_.Dedup(stack_mask->GetRawStorage(), stack_mask->GetNumberOfBits());
}
}
+
+ for (size_t i = 0; i < stack_maps_.size(); i++) {
+ DCHECK_LE(stack_maps_[i][StackMap::kPackedNativePc], packed_code_size_);
+ }
}
void StackMapStream::BeginStackMapEntry(uint32_t dex_pc,
@@ -296,6 +301,7 @@
ScopedArenaVector<uint8_t> buffer(allocator_->Adapter(kArenaAllocStackMapStream));
BitMemoryWriter<ScopedArenaVector<uint8_t>> out(&buffer);
+ out.WriteVarint(packed_code_size_);
out.WriteVarint(packed_frame_size_);
out.WriteVarint(core_spill_mask_);
out.WriteVarint(fp_spill_mask_);