From e7a9194558379ee24fde82fcaeaee29542df1520 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Wed, 1 Aug 2018 17:23:53 +0100 Subject: Simplify StackMapStream encoding. Test: test-art-host-gtest-stack_map_test Change-Id: Ife021d03e4e486043ec609f9af8673ace7bde497 --- compiler/optimizing/stack_map_stream.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'compiler/optimizing/stack_map_stream.h') diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h index cd04ff042c..df11709f03 100644 --- a/compiler/optimizing/stack_map_stream.h +++ b/compiler/optimizing/stack_map_stream.h @@ -37,7 +37,8 @@ namespace art { class StackMapStream : public DeletableArenaObject { public: explicit StackMapStream(ScopedArenaAllocator* allocator, InstructionSet instruction_set) - : instruction_set_(instruction_set), + : allocator_(allocator), + instruction_set_(instruction_set), stack_maps_(allocator), inline_infos_(allocator), method_infos_(allocator), @@ -46,7 +47,6 @@ class StackMapStream : public DeletableArenaObject { dex_register_masks_(allocator), dex_register_maps_(allocator), dex_register_catalog_(allocator), - out_(allocator->Adapter(kArenaAllocStackMapStream)), lazy_stack_masks_(allocator->Adapter(kArenaAllocStackMapStream)), current_stack_map_(), current_inline_infos_(allocator->Adapter(kArenaAllocStackMapStream)), @@ -88,16 +88,16 @@ class StackMapStream : public DeletableArenaObject { uint32_t GetStackMapNativePcOffset(size_t i); void SetStackMapNativePcOffset(size_t i, uint32_t native_pc_offset); - // Prepares the stream to fill in a memory region. Must be called before FillIn. - // Returns the size (in bytes) needed to store this stream. - size_t PrepareForFillIn(); - void FillInCodeInfo(MemoryRegion region); + // Encode all stack map data. + // The returned vector is allocated using the allocator passed to the StackMapStream. + ScopedArenaVector Encode(); private: static constexpr uint32_t kNoValue = -1; void CreateDexRegisterMap(); + ScopedArenaAllocator* allocator_; const InstructionSet instruction_set_; uint32_t packed_frame_size_ = 0; uint32_t core_spill_mask_ = 0; @@ -111,7 +111,6 @@ class StackMapStream : public DeletableArenaObject { BitmapTableBuilder dex_register_masks_; BitTableBuilder dex_register_maps_; BitTableBuilder dex_register_catalog_; - ScopedArenaVector out_; ScopedArenaVector lazy_stack_masks_; -- cgit v1.2.3-59-g8ed1b