diff options
author | 2018-07-15 23:58:44 +0100 | |
---|---|---|
committer | 2018-08-01 14:49:40 +0100 | |
commit | 8cd54547cec8a4537db5682c2da8be22843b1310 (patch) | |
tree | fb1158993bab2e027984cedab59b402c051a45a7 /runtime/stack_map.h | |
parent | 91f0fdb4372d3f2bcfcd9db67afcbe7ee1901048 (diff) |
Move MethodInfo to CodeInfo.
There is no need to treat it specially any more,
because of the de-duplication at BitTable level.
This saves 0.6% of oat file size.
Test: test-art-host-gtest
Change-Id: Ife7927d736243879a41d6f325d49ebf6930a63f6
Diffstat (limited to 'runtime/stack_map.h')
-rw-r--r-- | runtime/stack_map.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/runtime/stack_map.h b/runtime/stack_map.h index 909aaa5576..8bfae7c39f 100644 --- a/runtime/stack_map.h +++ b/runtime/stack_map.h @@ -28,7 +28,6 @@ #include "base/memory_region.h" #include "dex/dex_file_types.h" #include "dex_register_location.h" -#include "method_info.h" #include "quick/quick_method_frame_info.h" namespace art { @@ -164,7 +163,6 @@ class StackMap : public BitTableAccessor<8> { void Dump(VariableIndentationOutputStream* vios, const CodeInfo& code_info, - const MethodInfo& method_info, uint32_t code_offset, InstructionSet instruction_set) const; }; @@ -188,10 +186,6 @@ class InlineInfo : public BitTableAccessor<6> { static constexpr uint32_t kLast = -1; static constexpr uint32_t kMore = 0; - uint32_t GetMethodIndex(const MethodInfo& method_info) const { - return method_info.GetMethodIndex(GetMethodInfoIndex()); - } - bool EncodesArtMethod() const { return HasArtMethodLo(); } @@ -204,8 +198,7 @@ class InlineInfo : public BitTableAccessor<6> { void Dump(VariableIndentationOutputStream* vios, const CodeInfo& info, - const StackMap& stack_map, - const MethodInfo& method_info) const; + const StackMap& stack_map) const; }; class MaskInfo : public BitTableAccessor<1> { @@ -262,6 +255,14 @@ class RegisterMask : public BitTableAccessor<2> { } }; +// Method indices are not very dedup friendly. +// Separating them greatly improves dedup efficiency of the other tables. +class MethodInfo : public BitTableAccessor<1> { + public: + BIT_TABLE_HEADER() + BIT_TABLE_COLUMN(0, MethodIndex) +}; + /** * Wrapper around all compiler information collected for a method. * See the Decode method at the end for the precise binary format. @@ -329,6 +330,10 @@ class CodeInfo { return stack_maps_.NumRows(); } + uint32_t GetMethodIndexOf(InlineInfo inline_info) const { + return method_infos_.GetRow(inline_info.GetMethodInfoIndex()).GetMethodIndex(); + } + ALWAYS_INLINE DexRegisterMap GetDexRegisterMapOf(StackMap stack_map) const { if (stack_map.HasDexRegisterMap()) { DexRegisterMap map(number_of_dex_registers_, DexRegisterLocation::Invalid()); @@ -405,8 +410,7 @@ class CodeInfo { void Dump(VariableIndentationOutputStream* vios, uint32_t code_offset, bool verbose, - InstructionSet instruction_set, - const MethodInfo& method_info) const; + InstructionSet instruction_set) const; // Accumulate code info size statistics into the given Stats tree. void AddSizeStats(/*out*/ Stats* parent) const; @@ -446,6 +450,7 @@ class CodeInfo { uint32_t number_of_dex_registers_; BitTable<StackMap> stack_maps_; BitTable<InlineInfo> inline_infos_; + BitTable<MethodInfo> method_infos_; BitTable<RegisterMask> register_masks_; BitTable<MaskInfo> stack_masks_; BitTable<MaskInfo> dex_register_masks_; |