diff options
Diffstat (limited to 'runtime/mirror/dex_cache-inl.h')
-rw-r--r-- | runtime/mirror/dex_cache-inl.h | 14 |
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); |