diff options
author | 2017-12-08 16:27:49 +0000 | |
---|---|---|
committer | 2017-12-11 11:40:35 +0000 | |
commit | a64b52deb0c792b8a0d47546edb8a2f8a7816c33 (patch) | |
tree | 0f98c035e2da07a17501debc4d1f49281d2f9e41 /compiler/driver/compiler_driver.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 'compiler/driver/compiler_driver.cc')
-rw-r--r-- | compiler/driver/compiler_driver.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 2d43476d5a..d51bded7eb 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -701,7 +701,6 @@ void CompilerDriver::Resolve(jobject class_loader, // stable order. static void ResolveConstStrings(Handle<mirror::DexCache> dex_cache, - const DexFile& dex_file, const DexFile::CodeItem* code_item) REQUIRES_SHARED(Locks::mutator_lock_) { if (code_item == nullptr) { @@ -717,8 +716,7 @@ static void ResolveConstStrings(Handle<mirror::DexCache> dex_cache, dex::StringIndex string_index((inst->Opcode() == Instruction::CONST_STRING) ? inst->VRegB_21c() : inst->VRegB_31c()); - ObjPtr<mirror::String> string = - class_linker->ResolveString(dex_file, string_index, dex_cache); + ObjPtr<mirror::String> string = class_linker->ResolveString(string_index, dex_cache); CHECK(string != nullptr) << "Could not allocate a string when forcing determinism"; break; } @@ -773,7 +771,7 @@ static void ResolveConstStrings(CompilerDriver* driver, continue; } previous_method_idx = method_idx; - ResolveConstStrings(dex_cache, *dex_file, it.GetMethodCodeItem()); + ResolveConstStrings(dex_cache, it.GetMethodCodeItem()); it.Next(); } DCHECK(!it.HasNext()); @@ -2331,7 +2329,6 @@ class InitializeClassVisitor : public CompilationVisitor { StackHandleScope<1> hs(Thread::Current()); Handle<mirror::DexCache> dex_cache = hs.NewHandle(klass->GetDexCache()); - const DexFile* dex_file = manager_->GetDexFile(); const DexFile::ClassDef* class_def = klass->GetClassDef(); ClassLinker* class_linker = manager_->GetClassLinker(); @@ -2344,7 +2341,7 @@ class InitializeClassVisitor : public CompilationVisitor { if (value_it.GetValueType() == annotations::RuntimeEncodedStaticFieldValueIterator::kString) { // Resolve the string. This will intern the string. art::ObjPtr<mirror::String> resolved = class_linker->ResolveString( - *dex_file, dex::StringIndex(value_it.GetJavaValue().i), dex_cache); + dex::StringIndex(value_it.GetJavaValue().i), dex_cache); CHECK(resolved != nullptr); } } @@ -2357,11 +2354,11 @@ class InitializeClassVisitor : public CompilationVisitor { for (const DexInstructionPcPair& inst : code_item->Instructions()) { if (inst->Opcode() == Instruction::CONST_STRING) { ObjPtr<mirror::String> s = class_linker->ResolveString( - *dex_file, dex::StringIndex(inst->VRegB_21c()), dex_cache); + dex::StringIndex(inst->VRegB_21c()), dex_cache); CHECK(s != nullptr); } else if (inst->Opcode() == Instruction::CONST_STRING_JUMBO) { ObjPtr<mirror::String> s = class_linker->ResolveString( - *dex_file, dex::StringIndex(inst->VRegB_31c()), dex_cache); + dex::StringIndex(inst->VRegB_31c()), dex_cache); CHECK(s != nullptr); } } |