From 078d7ba2c20d7778f8988e89a70d47e07372cc5a Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Thu, 21 Jun 2018 15:36:48 +0100 Subject: Implement BitMemory{Reader,Writer} Two simple classes which replace the need to pass the (BitMemoryRegion, bit_offset) tuple everywhere. The slightly simplifies the code and it also makes it possible to optimize those classes in the future. Test: test-art-host-gtest-stack_map_test Test: test-art-host-gtest-bit_table_test Change-Id: I4806c805149a07e1a11b76405ca27960a0012c69 --- compiler/optimizing/stack_map_stream.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'compiler/optimizing') diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc index e8b333047d..57f47af777 100644 --- a/compiler/optimizing/stack_map_stream.cc +++ b/compiler/optimizing/stack_map_stream.cc @@ -301,16 +301,16 @@ size_t StackMapStream::PrepareForFillIn() { } } - size_t bit_offset = 0; - stack_maps_.Encode(&out_, &bit_offset); - register_masks_.Encode(&out_, &bit_offset); - stack_masks_.Encode(&out_, &bit_offset); - invoke_infos_.Encode(&out_, &bit_offset); - inline_infos_.Encode(&out_, &bit_offset); - dex_register_masks_.Encode(&out_, &bit_offset); - dex_register_maps_.Encode(&out_, &bit_offset); - dex_register_catalog_.Encode(&out_, &bit_offset); - EncodeVarintBits(&out_, &bit_offset, num_dex_registers_); + BitMemoryWriter> out(&out_); + stack_maps_.Encode(out); + register_masks_.Encode(out); + stack_masks_.Encode(out); + invoke_infos_.Encode(out); + inline_infos_.Encode(out); + dex_register_masks_.Encode(out); + dex_register_maps_.Encode(out); + dex_register_catalog_.Encode(out); + EncodeVarintBits(out, num_dex_registers_); return UnsignedLeb128Size(out_.size()) + out_.size(); } -- cgit v1.2.3-59-g8ed1b