diff options
author | David Srbecky <dsrbecky@google.com> | 2018-08-01 17:23:53 +0100 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2018-08-03 12:48:49 +0100 |
commit | e7a9194558379ee24fde82fcaeaee29542df1520 (patch) | |
tree | 30f3c43f2d64f159503bb8c3442aa39cc6cb612e /compiler/optimizing/stack_map_stream.h | |
parent | f50419eee7290542db07bff23c4f65e693ba037f (diff) |
Simplify StackMapStream encoding.
Test: test-art-host-gtest-stack_map_test
Change-Id: Ife021d03e4e486043ec609f9af8673ace7bde497
Diffstat (limited to 'compiler/optimizing/stack_map_stream.h')
-rw-r--r-- | compiler/optimizing/stack_map_stream.h | 13 |
1 files changed, 6 insertions, 7 deletions
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<kArenaAllocStackMapStream> { 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<kArenaAllocStackMapStream> { 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<kArenaAllocStackMapStream> { 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<uint8_t> 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<kArenaAllocStackMapStream> { BitmapTableBuilder dex_register_masks_; BitTableBuilder<MaskInfo> dex_register_maps_; BitTableBuilder<DexRegisterInfo> dex_register_catalog_; - ScopedArenaVector<uint8_t> out_; ScopedArenaVector<BitVector*> lazy_stack_masks_; |