From c945e0d410ca8d4e9ba09272e8727a3192f1e449 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 18 Jul 2018 17:26:45 +0100 Subject: Remove ArtMethod's declaring class state checks. This check was not very useful because the Class is already in a state to pass the check when we're constructing the ArtMethod and it can never revert to an earlier state, so the check is essentially a weak protection against GC bugs. Besides not being very useful, the check had the ability to invalidate ObjPtr<> cookies (when called in non-runnable state), making it difficult to fully ObjPtr<>-ify the code. Also remove a lot of kReadBarrierOption template parameters which were needed specifically for this check. This removes unnecessary maintence burden as shown by past bugs dealing with carefully adding those parameters where necessary. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 74373650 Bug: 31113334 Change-Id: I87f2999fc4e7c27b5c2307139269b4b5f6649d16 --- compiler/optimizing/stack_map_stream.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 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 a65fbcc514..d74d7b695c 100644 --- a/compiler/optimizing/stack_map_stream.cc +++ b/compiler/optimizing/stack_map_stream.cc @@ -179,7 +179,7 @@ void StackMapStream::BeginInlineInfoEntry(ArtMethod* method, ScopedObjectAccess soa(Thread::Current()); DCHECK(IsSameDexFile(*outer_dex_file, *method->GetDexFile())); } - uint32_t dex_method_index = method->GetDexMethodIndexUnchecked(); + uint32_t dex_method_index = method->GetDexMethodIndex(); entry[InlineInfo::kMethodInfoIndex] = method_infos_.Dedup({dex_method_index}); } current_inline_infos_.push_back(entry); @@ -196,8 +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->GetDexMethodIndexUnchecked()); + CHECK_EQ(method_infos_[inline_info.GetMethodInfoIndex()][0], method->GetDexMethodIndex()); } }); } -- cgit v1.2.3-59-g8ed1b