From da7c650022a974be10e2f00fa07d5109e3d8826f Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 23 Jul 2015 16:01:26 -0700 Subject: Visit class native roots from VisitReferences Visit class roots when we call Class::VisitReferences instead of in the class linker. This makes it easier to implement class unloading since unmarked classes won't have their roots visited by the class linker. Bug: 22181835 Change-Id: I63f31e5ebef7b2a0b764b3ba3cb038b3f561b379 --- compiler/driver/compiler_driver.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'compiler/driver/compiler_driver.cc') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 05705a2d31..a35f306612 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -883,8 +883,13 @@ class ClinitImageUpdate { } // java.lang.Reference visitor for VisitReferences. - void operator()(mirror::Class* /* klass */, mirror::Reference* /* ref */) const { - } + void operator()(mirror::Class* klass ATTRIBUTE_UNUSED, mirror::Reference* ref ATTRIBUTE_UNUSED) + const {} + + // Ignore class native roots. + void VisitRootIfNonNull(mirror::CompressedReference* root ATTRIBUTE_UNUSED) + const {} + void VisitRoot(mirror::CompressedReference* root ATTRIBUTE_UNUSED) const {} void Walk() SHARED_REQUIRES(Locks::mutator_lock_) { // Use the initial classes as roots for a search. -- cgit v1.2.3-59-g8ed1b