diff options
Diffstat (limited to 'libart')
-rw-r--r-- | libart/src/main/java/java/lang/Class.java | 4 | ||||
-rw-r--r-- | libart/src/main/java/java/lang/reflect/ArtMethod.java | 10 |
2 files changed, 4 insertions, 10 deletions
diff --git a/libart/src/main/java/java/lang/Class.java b/libart/src/main/java/java/lang/Class.java index a833f6c..d766385 100644 --- a/libart/src/main/java/java/lang/Class.java +++ b/libart/src/main/java/java/lang/Class.java @@ -138,6 +138,9 @@ public final class Class<T> implements Serializable, AnnotatedElement, GenericDe */ private transient DexCache dexCache; + /** Short-cut to dexCache.strings */ + private transient String[] dexCacheStrings; + /** static, private, and <init> methods. */ private transient ArtMethod[] directMethods; @@ -453,7 +456,6 @@ public final class Class<T> implements Serializable, AnnotatedElement, GenericDe * @hide */ public String getDexCacheString(Dex dex, int dexStringIndex) { - String[] dexCacheStrings = dexCache.strings; String s = dexCacheStrings[dexStringIndex]; if (s == null) { s = dex.strings().get(dexStringIndex).intern(); diff --git a/libart/src/main/java/java/lang/reflect/ArtMethod.java b/libart/src/main/java/java/lang/reflect/ArtMethod.java index 07cc30c..95e03c6 100644 --- a/libart/src/main/java/java/lang/reflect/ArtMethod.java +++ b/libart/src/main/java/java/lang/reflect/ArtMethod.java @@ -53,9 +53,6 @@ public final class ArtMethod { /** Short-cut to declaringClass.dexCache.resolvedTypes */ /* package */ Class<?>[] dexCacheResolvedTypes; - /** Short-cut to declaringClass.dexCache.strings */ - private String[] dexCacheStrings; - /** Bits encoding access (e.g. public, private) as well as other runtime specific flags */ private int accessFlags; @@ -180,12 +177,7 @@ public final class ArtMethod { * Method we can avoid one indirection. */ private String getDexCacheString(Dex dex, int dexStringIndex) { - String s = (String) dexCacheStrings[dexStringIndex]; - if (s == null) { - s = dex.strings().get(dexStringIndex).intern(); - dexCacheStrings[dexStringIndex] = s; - } - return s; + return declaringClass.getDexCacheString(dex, dexStringIndex); } /** |