From 8cd54547cec8a4537db5682c2da8be22843b1310 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Sun, 15 Jul 2018 23:58:44 +0100 Subject: 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 --- compiler/optimizing/stack_map_stream.cc | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'compiler/optimizing/stack_map_stream.cc') diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc index e1b657554f..429054cec7 100644 --- a/compiler/optimizing/stack_map_stream.cc +++ b/compiler/optimizing/stack_map_stream.cc @@ -196,7 +196,7 @@ void StackMapStream::BeginInlineInfoEntry(ArtMethod* method, if (encode_art_method) { CHECK_EQ(inline_info.GetArtMethod(), method); } else { - CHECK_EQ(method_infos_[inline_info.GetMethodInfoIndex()][0], method->GetDexMethodIndex()); + CHECK_EQ(code_info.GetMethodIndexOf(inline_info), method->GetDexMethodIndex()); } }); } @@ -274,24 +274,6 @@ void StackMapStream::CreateDexRegisterMap() { } } -void StackMapStream::FillInMethodInfo(MemoryRegion region) { - { - MethodInfo info(region.begin(), method_infos_.size()); - for (size_t i = 0; i < method_infos_.size(); ++i) { - info.SetMethodIndex(i, method_infos_[i][0]); - } - } - if (kVerifyStackMaps) { - // Check the data matches. - MethodInfo info(region.begin()); - const size_t count = info.NumMethodIndices(); - DCHECK_EQ(count, method_infos_.size()); - for (size_t i = 0; i < count; ++i) { - DCHECK_EQ(info.GetMethodIndex(i), method_infos_[i][0]); - } - } -} - template ALWAYS_INLINE static void EncodeTable(Writer& out, const Builder& bit_table) { out.WriteBit(false); // Is not deduped. @@ -317,6 +299,7 @@ size_t StackMapStream::PrepareForFillIn() { BitMemoryWriter> out(&out_, out_.size() * kBitsPerByte); EncodeTable(out, stack_maps_); EncodeTable(out, inline_infos_); + EncodeTable(out, method_infos_); EncodeTable(out, register_masks_); EncodeTable(out, stack_masks_); EncodeTable(out, dex_register_masks_); @@ -347,9 +330,4 @@ void StackMapStream::FillInCodeInfo(MemoryRegion region) { } } -size_t StackMapStream::ComputeMethodInfoSize() const { - DCHECK_NE(0u, out_.size()) << "PrepareForFillIn not called before " << __FUNCTION__; - return MethodInfo::ComputeSize(method_infos_.size()); -} - } // namespace art -- cgit v1.2.3-59-g8ed1b