diff options
| author | 2015-11-09 11:16:49 -0800 | |
|---|---|---|
| committer | 2016-01-22 15:01:55 -0800 | |
| commit | f7fd970244f143b1abb956e29794c446e4d57f46 (patch) | |
| tree | aac1f57ac70747957f609bb46305dfeca87645a1 /runtime/mirror/class_loader-inl.h | |
| parent | 95005291d8ebdd1d2ac58ffc5181fef4fbbf2383 (diff) | |
Load app images
Support in-place patching of the app image based on boot image
location and app oat location. Only loads for art run test so far
since we do not automatically generate app images for app installs.
N5 maps launch time (~200 runs):
Before: 930ms
After: 878.18ms
After + image class table: 864.57ms
TODO:
Oatdump support.
Store class loaders as class roots in image.
Bug: 22858531
Change-Id: I9cbc645645e62ea2ed1ad8e139e91af7d88514c1
Diffstat (limited to 'runtime/mirror/class_loader-inl.h')
| -rw-r--r-- | runtime/mirror/class_loader-inl.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/runtime/mirror/class_loader-inl.h b/runtime/mirror/class_loader-inl.h index e22ddd7e90..84fa80f023 100644 --- a/runtime/mirror/class_loader-inl.h +++ b/runtime/mirror/class_loader-inl.h @@ -25,15 +25,20 @@ namespace art { namespace mirror { -template <VerifyObjectFlags kVerifyFlags, typename Visitor> +template <bool kVisitClasses, + VerifyObjectFlags kVerifyFlags, + ReadBarrierOption kReadBarrierOption, + typename Visitor> inline void ClassLoader::VisitReferences(mirror::Class* klass, const Visitor& visitor) { // Visit instance fields first. - VisitInstanceFieldsReferences(klass, visitor); - // Visit classes loaded after. - ReaderMutexLock mu(Thread::Current(), *Locks::classlinker_classes_lock_); - ClassTable* const class_table = GetClassTable(); - if (class_table != nullptr) { - class_table->VisitRoots(visitor); + VisitInstanceFieldsReferences<kVerifyFlags, kReadBarrierOption>(klass, visitor); + if (kVisitClasses) { + // Visit classes loaded after. + ReaderMutexLock mu(Thread::Current(), *Locks::classlinker_classes_lock_); + ClassTable* const class_table = GetClassTable(); + if (class_table != nullptr) { + class_table->VisitRoots(visitor); + } } } |