From 73f21d45a41aaad1a02eecdf3bbdbf78ef599d5e Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 2 Jan 2018 14:26:50 -0800 Subject: Remove CodeItem accessor functions These are replaced by the accessor helpers. Bug: 63756964 Test: test-art-host Test: test/testrunner/testrunner.py --host -j30 Change-Id: Ic93d60b68b684eeb5f69be286b4e15b8f8f97542 --- compiler/driver/compiler_driver.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'compiler/driver/compiler_driver.cc') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 68f963e3ab..5d4ed4676b 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -702,6 +702,7 @@ void CompilerDriver::Resolve(jobject class_loader, // stable order. static void ResolveConstStrings(Handle dex_cache, + const DexFile* dex_file, const DexFile::CodeItem* code_item) REQUIRES_SHARED(Locks::mutator_lock_) { if (code_item == nullptr) { @@ -710,7 +711,7 @@ static void ResolveConstStrings(Handle dex_cache, } ClassLinker* const class_linker = Runtime::Current()->GetClassLinker(); - for (const DexInstructionPcPair& inst : code_item->Instructions()) { + for (const DexInstructionPcPair& inst : CodeItemInstructionAccessor(dex_file, code_item)) { switch (inst->Opcode()) { case Instruction::CONST_STRING: case Instruction::CONST_STRING_JUMBO: { @@ -772,7 +773,7 @@ static void ResolveConstStrings(CompilerDriver* driver, continue; } previous_method_idx = method_idx; - ResolveConstStrings(dex_cache, it.GetMethodCodeItem()); + ResolveConstStrings(dex_cache, dex_file, it.GetMethodCodeItem()); it.Next(); } DCHECK(!it.HasNext()); @@ -2352,9 +2353,7 @@ class InitializeClassVisitor : public CompilationVisitor { // Intern strings seen in . ArtMethod* clinit = klass->FindClassInitializer(class_linker->GetImagePointerSize()); if (clinit != nullptr) { - const DexFile::CodeItem* code_item = clinit->GetCodeItem(); - DCHECK(code_item != nullptr); - for (const DexInstructionPcPair& inst : code_item->Instructions()) { + for (const DexInstructionPcPair& inst : clinit->DexInstructions()) { if (inst->Opcode() == Instruction::CONST_STRING) { ObjPtr s = class_linker->ResolveString( dex::StringIndex(inst->VRegB_21c()), dex_cache); -- cgit v1.2.3-59-g8ed1b