diff options
author | 2017-12-08 16:27:49 +0000 | |
---|---|---|
committer | 2017-12-11 11:40:35 +0000 | |
commit | a64b52deb0c792b8a0d47546edb8a2f8a7816c33 (patch) | |
tree | 0f98c035e2da07a17501debc4d1f49281d2f9e41 /runtime/class_linker.cc | |
parent | af94020190a2153834e30fc962e28c3b63d7ffc2 (diff) |
Do not pass DexFile to ClassLinker::Lookup/ResolveString().
The DexFile can be easily retrieved from the DexCache,
so reduce the number of arguments that need to be passed.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I8c4cec43b31b27de7e4e94374fdd69c6d6ca6c13
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 012e2a4548..093ec6540c 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -7726,8 +7726,7 @@ void ClassLinker::CreateReferenceInstanceOffsets(Handle<mirror::Class> klass) { klass->SetReferenceInstanceOffsets(reference_offsets); } -ObjPtr<mirror::String> ClassLinker::ResolveString(const DexFile& dex_file, - dex::StringIndex string_idx, +ObjPtr<mirror::String> ClassLinker::ResolveString(dex::StringIndex string_idx, Handle<mirror::DexCache> dex_cache) { DCHECK(dex_cache != nullptr); Thread::PoisonObjectPointersIfDebug(); @@ -7735,6 +7734,7 @@ ObjPtr<mirror::String> ClassLinker::ResolveString(const DexFile& dex_file, if (resolved != nullptr) { return resolved; } + const DexFile& dex_file = *dex_cache->GetDexFile(); uint32_t utf16_length; const char* utf8_data = dex_file.StringDataAndUtf16LengthByIdx(string_idx, &utf16_length); ObjPtr<mirror::String> string = intern_table_->InternStrong(utf16_length, utf8_data); @@ -7744,14 +7744,14 @@ ObjPtr<mirror::String> ClassLinker::ResolveString(const DexFile& dex_file, return string; } -ObjPtr<mirror::String> ClassLinker::LookupString(const DexFile& dex_file, - dex::StringIndex string_idx, +ObjPtr<mirror::String> ClassLinker::LookupString(dex::StringIndex string_idx, ObjPtr<mirror::DexCache> dex_cache) { DCHECK(dex_cache != nullptr); ObjPtr<mirror::String> resolved = dex_cache->GetResolvedString(string_idx); if (resolved != nullptr) { return resolved; } + const DexFile& dex_file = *dex_cache->GetDexFile(); uint32_t utf16_length; const char* utf8_data = dex_file.StringDataAndUtf16LengthByIdx(string_idx, &utf16_length); ObjPtr<mirror::String> string = |