diff options
-rw-r--r-- | runtime/class_linker.cc | 10 | ||||
-rw-r--r-- | runtime/class_linker.h | 2 | ||||
-rw-r--r-- | runtime/oat_file_manager.cc | 2 |
3 files changed, 9 insertions, 5 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); } diff --git a/runtime/class_linker.h b/runtime/class_linker.h index efe29d3127..e06a398089 100644 --- a/runtime/class_linker.h +++ b/runtime/class_linker.h @@ -111,7 +111,7 @@ class AllocatorVisitor { class ClassLinker { public: - static constexpr bool kAppImageMayContainStrings = false; + static constexpr bool kAppImageMayContainStrings = true; explicit ClassLinker(InternTable* intern_table); virtual ~ClassLinker(); diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc index 92d2d44699..a9ef9a3fa9 100644 --- a/runtime/oat_file_manager.cc +++ b/runtime/oat_file_manager.cc @@ -526,6 +526,8 @@ std::vector<std::unique_ptr<const DexFile>> OatFileManager::OpenDexFilesFromOat( if (source_oat_file != nullptr) { bool added_image_space = false; if (source_oat_file->IsExecutable()) { + ScopedTrace app_image_timing("AppImage:Loading"); + // We need to throw away the image space if we are debuggable but the oat-file source of the // image is not otherwise we might get classes with inlined methods or other such things. std::unique_ptr<gc::space::ImageSpace> image_space; |