summaryrefslogtreecommitdiff
path: root/runtime/mirror/dex_cache-inl.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2022-11-02 10:26:30 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2022-11-03 13:28:43 +0000
commitb317e651e9b9600029241ccb68e21ac05597cfe6 (patch)
tree2fae5112181fd48dfd3ff38ca26049ed35d576d2 /runtime/mirror/dex_cache-inl.h
parente19d74b51ad8efd43c1583887cbde123ae769f7b (diff)
Optimistically update field and method cache on type update.
To save on future lookups, update the method and field caches as soon as we update the type cache, when the type has the same dex cache, and the dex cache is using full arrays. This saves the number of lookup of maps startup by ~30% (2100 -> 1500). Test: test.py Change-Id: I4cb708a04fb491fe65a75412bb2a8b9306e81f78
Diffstat (limited to 'runtime/mirror/dex_cache-inl.h')
-rw-r--r--runtime/mirror/dex_cache-inl.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h
index 5a44fff665..3452f17d70 100644
--- a/runtime/mirror/dex_cache-inl.h
+++ b/runtime/mirror/dex_cache-inl.h
@@ -164,18 +164,6 @@ inline Class* DexCache::GetResolvedType(dex::TypeIndex type_idx) {
return GetResolvedTypesEntry(type_idx.index_);
}
-inline void DexCache::SetResolvedType(dex::TypeIndex type_idx, ObjPtr<Class> resolved) {
- DCHECK(resolved != nullptr);
- DCHECK(resolved->IsResolved()) << resolved->GetStatus();
- // TODO default transaction support.
- // Use a release store for SetResolvedType. This is done to prevent other threads from seeing a
- // class but not necessarily seeing the loaded members like the static fields array.
- // See b/32075261.
- SetResolvedTypesEntry(type_idx.index_, resolved.Ptr());
- // TODO: Fine-grained marking, so that we don't need to go through all arrays in full.
- WriteBarrier::ForEveryFieldWrite(this);
-}
-
inline void DexCache::ClearResolvedType(dex::TypeIndex type_idx) {
DCHECK(Runtime::Current()->IsAotCompiler());
auto* array = GetResolvedTypesArray();