diff options
| author | 2018-08-02 15:11:02 +0000 | |
|---|---|---|
| committer | 2018-08-02 15:11:02 +0000 | |
| commit | 1bfd891d06e276d602b4a6ccf1a9f70967195218 (patch) | |
| tree | ce0fedeafdffed1333aab4d751906a24b7e46c2f /compiler/optimizing/stack_map_stream.cc | |
| parent | e8d8755abbf6543b41e03c6b86a5e1db31289868 (diff) | |
| parent | 3aaaa21055ab73562b8da7968ac4fa5fe9d44695 (diff) | |
Merge "Encode frame info using varints."
Diffstat (limited to 'compiler/optimizing/stack_map_stream.cc')
| -rw-r--r-- | compiler/optimizing/stack_map_stream.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc index 429054cec7..b26b53fc9f 100644 --- a/compiler/optimizing/stack_map_stream.cc +++ b/compiler/optimizing/stack_map_stream.cc @@ -45,9 +45,10 @@ void StackMapStream::BeginMethod(size_t frame_size_in_bytes, uint32_t num_dex_registers) { DCHECK(!in_method_) << "Mismatched Begin/End calls"; in_method_ = true; - DCHECK_EQ(frame_size_in_bytes_, 0u) << "BeginMethod was already called"; + DCHECK_EQ(packed_frame_size_, 0u) << "BeginMethod was already called"; - frame_size_in_bytes_ = frame_size_in_bytes; + DCHECK_ALIGNED(frame_size_in_bytes, kStackAlignment); + packed_frame_size_ = frame_size_in_bytes / kStackAlignment; core_spill_mask_ = core_spill_mask; fp_spill_mask_ = fp_spill_mask; num_dex_registers_ = num_dex_registers; @@ -292,11 +293,11 @@ size_t StackMapStream::PrepareForFillIn() { } } - EncodeUnsignedLeb128(&out_, frame_size_in_bytes_); - EncodeUnsignedLeb128(&out_, core_spill_mask_); - EncodeUnsignedLeb128(&out_, fp_spill_mask_); - EncodeUnsignedLeb128(&out_, num_dex_registers_); - BitMemoryWriter<ScopedArenaVector<uint8_t>> out(&out_, out_.size() * kBitsPerByte); + BitMemoryWriter<ScopedArenaVector<uint8_t>> out(&out_); + EncodeVarintBits(out, packed_frame_size_); + EncodeVarintBits(out, core_spill_mask_); + EncodeVarintBits(out, fp_spill_mask_); + EncodeVarintBits(out, num_dex_registers_); EncodeTable(out, stack_maps_); EncodeTable(out, inline_infos_); EncodeTable(out, method_infos_); |