From 575d3e60c68b5cf481b615dde4a16283507b19ed Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Mon, 6 Feb 2017 11:00:40 -0800 Subject: Clean up code info table layout Previously: Table layout was computed multiple places like stack_map_stream, and getters. This made it difficult to add new stack map tables and made the code hard to understand. This change makes the table layout specified all inside of the code info. Updating the layout only requires changing ComputeTableOffsets. Changed the stack map inline info offset to be an index, so that it is not require the inline infos are directly after the dex register table. Oat file size for a large app: 94459576 -> 93882040 (-0.61%) Updated oatdump and fixed a bug that was incorrectly computing the register mask bytes. Bug: 34621054 Test: test-art-host Change-Id: I3a7f141e09d5a18bce2bc6c9439835244a22016e --- compiler/optimizing/stack_map_stream.h | 19 ++----------------- 1 file changed, 2 insertions(+), 17 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 b1069a17be..08c1d3e3c0 100644 --- a/compiler/optimizing/stack_map_stream.h +++ b/compiler/optimizing/stack_map_stream.h @@ -79,13 +79,6 @@ class StackMapStream : public ValueObject { current_entry_(), current_inline_info_(), code_info_encoding_(allocator->Adapter(kArenaAllocStackMapStream)), - inline_info_size_(0), - dex_register_maps_size_(0), - stack_maps_size_(0), - dex_register_location_catalog_size_(0), - dex_register_location_catalog_start_(0), - dex_register_maps_start_(0), - inline_infos_start_(0), needed_size_(0), current_dex_register_(0), in_inline_frame_(false) { @@ -160,7 +153,8 @@ class StackMapStream : public ValueObject { size_t ComputeDexRegisterMapSize(uint32_t num_dex_registers, const BitVector* live_dex_registers_mask) const; size_t ComputeDexRegisterMapsSize() const; - void ComputeInlineInfoEncoding(); + void ComputeInlineInfoEncoding(InlineInfoEncoding* encoding, + size_t dex_register_maps_bytes); CodeOffset ComputeMaxNativePcCodeOffset() const; @@ -214,16 +208,7 @@ class StackMapStream : public ValueObject { StackMapEntry current_entry_; InlineInfoEntry current_inline_info_; - StackMapEncoding stack_map_encoding_; - InlineInfoEncoding inline_info_encoding_; ArenaVector code_info_encoding_; - size_t inline_info_size_; - size_t dex_register_maps_size_; - size_t stack_maps_size_; - size_t dex_register_location_catalog_size_; - size_t dex_register_location_catalog_start_; - size_t dex_register_maps_start_; - size_t inline_infos_start_; size_t needed_size_; uint32_t current_dex_register_; bool in_inline_frame_; -- cgit v1.2.3-59-g8ed1b