Move dex cache strings from ArtMethod -> Class
Adds one load for const strings which are not direct.
Saves >= 60KB of memory avg per app.
Image size: -350KB.
Bug: 17643507
Change-Id: I2d1a3253d9de09682be9bc6b420a29513d592cc8
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index 63aa675..5f21c35 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -1017,6 +1017,13 @@
bool GetSlowPathEnabled() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
void SetSlowPath(bool enabled) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ ObjectArray<String>* GetDexCacheStrings() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ void SetDexCacheStrings(ObjectArray<String>* new_dex_cache_strings)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ static MemberOffset DexCacheStringsOffset() {
+ return OFFSET_OF_OBJECT_MEMBER(Class, dex_cache_strings_);
+ }
+
// Used to initialize a class in the allocation code path to ensure it is guarded by a StoreStore
// fence.
class InitializeClassVisitor {
@@ -1062,6 +1069,9 @@
// runtime such as arrays and primitive classes).
HeapReference<DexCache> dex_cache_;
+ // Short cuts to dex_cache_ member for fast compiled code access.
+ HeapReference<ObjectArray<String>> dex_cache_strings_;
+
// static, private, and <init> methods
HeapReference<ObjectArray<ArtMethod>> direct_methods_;