diff options
| author | 2014-11-24 18:29:54 -0800 | |
|---|---|---|
| committer | 2014-11-25 16:02:04 -0800 | |
| commit | eace45873190a27302b3644c32ec82854b59d299 (patch) | |
| tree | 73fbf327839263b6847bdc4359ac1dbea2b897e3 /runtime/class_linker.cc | |
| parent | 8ac8d5556fae9c728bcebcc9036a1bbf40087c76 (diff) | |
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/class_linker.cc')
| -rw-r--r-- | runtime/class_linker.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 677fdc9462..f092772239 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2780,6 +2780,7 @@ void ClassLinker::LoadClass(Thread* self, const DexFile& dex_file, klass->SetDexClassDefIndex(dex_file.GetIndexForClassDef(dex_class_def)); klass->SetDexTypeIndex(dex_class_def.class_idx_); + klass->SetDexCacheStrings(klass->GetDexCache()->GetStrings()); const uint8_t* class_data = dex_file.GetClassData(dex_class_def); if (class_data == nullptr) { @@ -2935,7 +2936,6 @@ mirror::ArtMethod* ClassLinker::LoadMethod(Thread* self, const DexFile& dex_file dst->SetDeclaringClass(klass.Get()); dst->SetCodeItemOffset(it.GetMethodCodeItemOffset()); - dst->SetDexCacheStrings(klass->GetDexCache()->GetStrings()); dst->SetDexCacheResolvedMethods(klass->GetDexCache()->GetResolvedMethods()); dst->SetDexCacheResolvedTypes(klass->GetDexCache()->GetResolvedTypes()); @@ -4063,7 +4063,6 @@ static void CheckProxyMethod(Handle<mirror::ArtMethod> method, // The proxy method doesn't have its own dex cache or dex file and so it steals those of its // interface prototype. The exception to this are Constructors and the Class of the Proxy itself. - CHECK_EQ(prototype->GetDexCacheStrings(), method->GetDexCacheStrings()); CHECK(prototype->HasSameDexCacheResolvedMethods(method.Get())); CHECK(prototype->HasSameDexCacheResolvedTypes(method.Get())); CHECK_EQ(prototype->GetDexMethodIndex(), method->GetDexMethodIndex()); |