summaryrefslogtreecommitdiffstats
path: root/runtime/mirror/class.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-11-24 18:29:54 -0800
committerMathieu Chartier <mathieuc@google.com>2014-11-25 16:02:04 -0800
commiteace45873190a27302b3644c32ec82854b59d299 (patch)
tree73fbf327839263b6847bdc4359ac1dbea2b897e3 /runtime/mirror/class.h
parent8ac8d5556fae9c728bcebcc9036a1bbf40087c76 (diff)
downloadart-eace45873190a27302b3644c32ec82854b59d299.zip
art-eace45873190a27302b3644c32ec82854b59d299.tar.gz
art-eace45873190a27302b3644c32ec82854b59d299.tar.bz2
Move dexCacheStrings from ArtMethod to 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 (cherry picked from commit f521f423b66e952f746885dd9f6cf8ef2788955d)
Diffstat (limited to 'runtime/mirror/class.h')
-rw-r--r--runtime/mirror/class.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index 82425b5..a77972e 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -1020,6 +1020,13 @@ class MANAGED Class FINAL : public Object {
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 {
@@ -1065,6 +1072,9 @@ class MANAGED Class FINAL : public Object {
// 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_;