From 4f2e957b07c8b6e48bbd7593bb64f3c5214fa489 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Thu, 16 Mar 2017 13:13:31 -0700 Subject: Ensure the GC visits Obsolete Methods We were previously not visiting obsolete methods during GCs. This could lead to the use of stale pointers. Bug: 36335999 Test: ./test/testrunner/testrunner.py --host --interp-ac --gcstress -j40 Change-Id: I2b5c7c75b29f9037204a860501fcdb78104b5e7a --- runtime/mirror/class_ext.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'runtime/mirror/class_ext.cc') diff --git a/runtime/mirror/class_ext.cc b/runtime/mirror/class_ext.cc index 7270079a8f..5dc3aca094 100644 --- a/runtime/mirror/class_ext.cc +++ b/runtime/mirror/class_ext.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "class_ext.h" +#include "class_ext-inl.h" #include "art_method-inl.h" #include "base/casts.h" @@ -24,7 +24,6 @@ #include "gc/accounting/card_table-inl.h" #include "object-inl.h" #include "object_array.h" -#include "object_array-inl.h" #include "stack_trace_element.h" #include "utils.h" #include "well_known_classes.h" @@ -34,6 +33,11 @@ namespace mirror { GcRoot ClassExt::dalvik_system_ClassExt_; +uint32_t ClassExt::ClassSize(PointerSize pointer_size) { + uint32_t vtable_entries = Object::kVTableLength; + return Class::ComputeClassSize(true, vtable_entries, 0, 0, 0, 0, 0, pointer_size); +} + void ClassExt::SetObsoleteArrays(ObjPtr methods, ObjPtr> dex_caches) { DCHECK_EQ(GetLockOwnerThreadId(), Thread::Current()->GetThreadId()) -- cgit v1.2.3-59-g8ed1b