From 1e3926ae224c6418c6e1209bb134c28116a2c1fb Mon Sep 17 00:00:00 2001 From: Alex Light Date: Fri, 7 Apr 2017 10:38:06 -0700 Subject: Free unneeded obsolete maps In cases where there are no new obsolete methods we can get rid of the obsolete maps arrays. Bug: 31455788 Test: ./test.py --host -j40 Change-Id: I4a8cd96b4293439c6e67d9426011b92125cc7b03 --- runtime/mirror/class_ext.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'runtime/mirror/class_ext.cc') diff --git a/runtime/mirror/class_ext.cc b/runtime/mirror/class_ext.cc index 94e4b88f6c..32d49bbc10 100644 --- a/runtime/mirror/class_ext.cc +++ b/runtime/mirror/class_ext.cc @@ -40,8 +40,6 @@ uint32_t ClassExt::ClassSize(PointerSize pointer_size) { void ClassExt::SetObsoleteArrays(ObjPtr methods, ObjPtr> dex_caches) { - DCHECK_EQ(GetLockOwnerThreadId(), Thread::Current()->GetThreadId()) - << "Obsolete arrays are set without synchronization!"; CHECK_EQ(methods.IsNull(), dex_caches.IsNull()); auto obsolete_dex_cache_off = OFFSET_OF_OBJECT_MEMBER(ClassExt, obsolete_dex_caches_); auto obsolete_methods_off = OFFSET_OF_OBJECT_MEMBER(ClassExt, obsolete_methods_); @@ -54,8 +52,7 @@ void ClassExt::SetObsoleteArrays(ObjPtr methods, // these arrays are written into without all threads being suspended we have a race condition! This // race could cause obsolete methods to be missed. bool ClassExt::ExtendObsoleteArrays(Thread* self, uint32_t increase) { - DCHECK_EQ(GetLockOwnerThreadId(), Thread::Current()->GetThreadId()) - << "Obsolete arrays are set without synchronization!"; + // TODO It would be good to check that we have locked the class associated with this ClassExt. StackHandleScope<5> hs(self); Handle h_this(hs.NewHandle(this)); Handle old_methods(hs.NewHandle(h_this->GetObsoleteMethods())); -- cgit v1.2.3-59-g8ed1b