Revert "Don't pack code size in CodeInfo."
This reverts commit e35ac04a1a9a22b1c4386b27f3a30cd840aa17b1.
Bug: 123510633
Bug: 127305289
Reason for revert: b/127305289
Change-Id: I18c2d9291411b31641333c14c47da8c4fdf317f7
diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc
index c0e3206..e87f3c8 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;
- code_size_ = code_size;
+ 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++) {
@@ -68,9 +68,8 @@
}
}
- 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_);
}
}
@@ -302,7 +301,7 @@
ScopedArenaVector<uint8_t> buffer(allocator_->Adapter(kArenaAllocStackMapStream));
BitMemoryWriter<ScopedArenaVector<uint8_t>> out(&buffer);
- out.WriteVarint(code_size_);
+ out.WriteVarint(packed_code_size_);
out.WriteVarint(packed_frame_size_);
out.WriteVarint(core_spill_mask_);
out.WriteVarint(fp_spill_mask_);