diff options
| author | 2018-08-22 16:16:58 -0700 | |
|---|---|---|
| committer | 2018-09-27 12:45:36 -0700 | |
| commit | 2386636e0330051a96fe7d577524e929d81e9ba8 (patch) | |
| tree | 5624040f2dedfecffabb395b0df0fe57fe3c2bc1 /runtime/class_linker.cc | |
| parent | eaa4f836706f82614d0745e401c5ea805ac9d69b (diff) | |
Preparing for work on string interning for AppImages.
* Allow classes that have string fields to be put into AppImages.
* Updated tracing messages to be more descriptive and searchable.
* Added new tracing objects to more accurately report time spent in
handling AppImages.
Test: Built image / flashed device / ran applications
(cherry picked from commit e3015b59fb297d236f0b3ce844eef81c67e423d3)
Change-Id: I6e5fba8c8ddeff8e077672b799d244e767478373
Diffstat (limited to 'runtime/class_linker.cc')
| -rw-r--r-- | runtime/class_linker.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index bcc3a22c86..d95f71a315 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -1251,6 +1251,8 @@ void AppImageClassLoadersAndDexCachesHelper::Update( ClassTable::ClassSet* new_class_set) REQUIRES(!Locks::dex_lock_) REQUIRES_SHARED(Locks::mutator_lock_) { + ScopedTrace app_image_timing("AppImage:Updating"); + Thread* const self = Thread::Current(); gc::Heap* const heap = Runtime::Current()->GetHeap(); const ImageHeader& header = space->GetImageHeader(); @@ -1311,7 +1313,7 @@ void AppImageClassLoadersAndDexCachesHelper::Update( } if (ClassLinker::kAppImageMayContainStrings) { // Fixup all the literal strings happens at app images which are supposed to be interned. - ScopedTrace timing("Fixup String Intern in image and dex_cache"); + ScopedTrace timing("AppImage:InternString"); const auto& image_header = space->GetImageHeader(); const auto bitmap = space->GetMarkBitmap(); // bitmap of objects const uint8_t* target_base = space->GetMemMap()->Begin(); @@ -1324,7 +1326,7 @@ void AppImageClassLoadersAndDexCachesHelper::Update( bitmap->VisitMarkedRange(objects_begin, objects_end, fixup_intern_visitor); } if (kVerifyArtMethodDeclaringClasses) { - ScopedTrace timing("Verify declaring classes"); + ScopedTrace timing("AppImage:VerifyDeclaringClasses"); ReaderMutexLock rmu(self, *Locks::heap_bitmap_lock_); VerifyDeclaringClassVisitor visitor; header.VisitPackedArtMethods(&visitor, space->Begin(), kRuntimePointerSize); @@ -1842,7 +1844,7 @@ bool ClassLinker::AddImageSpace( // Force every app image class's SubtypeCheck to be at least kIninitialized. // // See also ImageWriter::FixupClass. - ScopedTrace trace("Recalculate app image SubtypeCheck bitstrings"); + ScopedTrace trace("AppImage:RecacluateSubtypeCheckBitstrings"); MutexLock subtype_check_lock(Thread::Current(), *Locks::subtype_check_lock_); for (const ClassTable::TableSlot& root : temp_set) { SubtypeCheck<ObjPtr<mirror::Class>>::EnsureInitialized(root.Read()); @@ -1862,7 +1864,7 @@ bool ClassLinker::AddImageSpace( if (kIsDebugBuild && app_image) { // This verification needs to happen after the classes have been added to the class loader. // Since it ensures classes are in the class table. - ScopedTrace trace("VerifyAppImage"); + ScopedTrace trace("AppImage:Verify"); VerifyAppImage(header, class_loader, dex_caches, class_table, space); } |