summaryrefslogtreecommitdiff
path: root/runtime/mirror/class_loader.h
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-08-18 13:54:21 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-08-18 16:11:21 -0700
commit059ef3ddb2088f926ac452889e0953fdcd646a5e (patch)
tree36067457d7e4aba11be908ddd235734d29b7c4f2 /runtime/mirror/class_loader.h
parentf71ad9ede9ae322a897e8fe407208dc35c5dee65 (diff)
Always visit object class from VisitReferences
We don't want to unload classes which have instances. Slight increase in CMS GC time from ~6.5s to ~7.3s on EvaluateAndApplyChanges. Bug: 22720414 Change-Id: I467ff9c9d55163d2a90b999aef3bdd7b3f648bac
Diffstat (limited to 'runtime/mirror/class_loader.h')
-rw-r--r--runtime/mirror/class_loader.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/mirror/class_loader.h b/runtime/mirror/class_loader.h
index 21c652a941..f27b6155ce 100644
--- a/runtime/mirror/class_loader.h
+++ b/runtime/mirror/class_loader.h
@@ -46,14 +46,15 @@ class MANAGED ClassLoader : public Object {
SetField64<false>(OFFSET_OF_OBJECT_MEMBER(ClassLoader, class_table_),
reinterpret_cast<uint64_t>(class_table));
}
+
+ private:
// Visit instance fields of the class loader as well as its associated classes.
// Null class loader is handled by ClassLinker::VisitClassRoots.
- template <const bool kVisitClass, VerifyObjectFlags kVerifyFlags, typename Visitor>
+ template <VerifyObjectFlags kVerifyFlags, typename Visitor>
void VisitReferences(mirror::Class* klass, const Visitor& visitor)
SHARED_REQUIRES(Locks::mutator_lock_)
REQUIRES(!Locks::classlinker_classes_lock_);
- private:
// Field order required by test "ValidateFieldOrderOfJavaCppUnionClasses".
HeapReference<Object> packages_;
HeapReference<ClassLoader> parent_;
@@ -63,6 +64,7 @@ class MANAGED ClassLoader : public Object {
uint64_t class_table_;
friend struct art::ClassLoaderOffsets; // for verifying offset information
+ friend class Object; // For VisitReferences
DISALLOW_IMPLICIT_CONSTRUCTORS(ClassLoader);
};