summaryrefslogtreecommitdiff
path: root/runtime/mirror/dex_cache.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mirror/dex_cache.cc')
-rw-r--r--runtime/mirror/dex_cache.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/mirror/dex_cache.cc b/runtime/mirror/dex_cache.cc
index 7d0c97ffda..d758c978a0 100644
--- a/runtime/mirror/dex_cache.cc
+++ b/runtime/mirror/dex_cache.cc
@@ -165,5 +165,21 @@ ObjPtr<ClassLoader> DexCache::GetClassLoader() {
return GetFieldObject<ClassLoader>(OFFSET_OF_OBJECT_MEMBER(DexCache, class_loader_));
}
+bool DexCache::AtStartup() {
+ return !Runtime::Current()->GetStartupCompleted();
+}
+
+void DexCache::UnlinkStartupCaches() {
+ if (GetDexFile() == nullptr) {
+ // Unused dex cache.
+ return;
+ }
+ UnlinkStringsArrayIfStartup();
+ UnlinkResolvedFieldsArrayIfStartup();
+ UnlinkResolvedMethodsArrayIfStartup();
+ UnlinkResolvedTypesArrayIfStartup();
+ UnlinkResolvedMethodTypesArrayIfStartup();
+}
+
} // namespace mirror
} // namespace art