summaryrefslogtreecommitdiff
path: root/runtime/mirror/dex_cache-inl.h
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2019-02-04 11:08:29 -0800
committer Mathieu Chartier <mathieuc@google.com> 2019-02-06 12:21:04 -0800
commita88abfa91af92e87b806529813a1787568fdb032 (patch)
tree632ae56a03fb3178f093e9722eccfe9c24a5fc1a /runtime/mirror/dex_cache-inl.h
parent2f34e59c10c30ea24fa5f4bc4e3d5a9dc6469c34 (diff)
Add feature flag for loading app image startup cache
Passed from the zygote. If false, app image string intern tables and preresolved strings are not loaded. This means the intern strings are generated by walking the image instead of looking at the app image intern table directly. Bug: 123524494 Bug: 116059983 Test: test-art-host Test: adb shell device_config put runtime_native use_app_image_startup_cache true (cherry picked from commit 5153419cba1cdfb6d5e5baba3e45fcf703c9daec) Merged-In: I6f800d1d989fd5e5b23166a115b1b241efac7ad2 Change-Id: I119948efd25c039a057f283c19b23431093659f4
Diffstat (limited to 'runtime/mirror/dex_cache-inl.h')
-rw-r--r--runtime/mirror/dex_cache-inl.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h
index 47b621ad1a..f0ad931837 100644
--- a/runtime/mirror/dex_cache-inl.h
+++ b/runtime/mirror/dex_cache-inl.h
@@ -110,8 +110,7 @@ inline void DexCache::SetResolvedString(dex::StringIndex string_idx, ObjPtr<Stri
WriteBarrier::ForEveryFieldWrite(this);
}
-inline void DexCache::SetPreResolvedString(dex::StringIndex string_idx,
- ObjPtr<String> resolved) {
+inline void DexCache::SetPreResolvedString(dex::StringIndex string_idx, ObjPtr<String> resolved) {
DCHECK(resolved != nullptr);
DCHECK_LT(string_idx.index_, GetDexFile()->NumStringIds());
GetPreResolvedStrings()[string_idx.index_] = GcRoot<mirror::String>(resolved);
@@ -122,6 +121,17 @@ inline void DexCache::SetPreResolvedString(dex::StringIndex string_idx,
WriteBarrier::ForEveryFieldWrite(this);
}
+inline void DexCache::ClearPreResolvedStrings() {
+ SetFieldPtr64</*kTransactionActive=*/false,
+ /*kCheckTransaction=*/false,
+ kVerifyNone,
+ GcRoot<mirror::String>*>(PreResolvedStringsOffset(), nullptr);
+ SetField32</*kTransactionActive=*/false,
+ /*bool kCheckTransaction=*/false,
+ kVerifyNone,
+ /*kIsVolatile=*/false>(NumPreResolvedStringsOffset(), 0);
+}
+
inline void DexCache::ClearString(dex::StringIndex string_idx) {
DCHECK(Runtime::Current()->IsAotCompiler());
uint32_t slot_idx = StringSlotIndex(string_idx);