From 6238c8331bf89ce35a377c6475034243a0791f28 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 4 Jan 2018 09:55:13 -0800 Subject: Remove DexFile direct accesses to CodeItem Motivation: StandardDexFile and CompactDexFile should be able to a have different layout for code items. Also addressed comments from a previous CL. Bug: 63756964 Test: test-art-host Change-Id: I5ea7a853b8095f68b4443ded0f599f2ac5efbd3a --- compiler/driver/compiler_driver.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/driver/compiler_driver.cc') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 5d4ed4676b..43e0db5671 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -702,7 +702,7 @@ void CompilerDriver::Resolve(jobject class_loader, // stable order. static void ResolveConstStrings(Handle dex_cache, - const DexFile* dex_file, + const DexFile& dex_file, const DexFile::CodeItem* code_item) REQUIRES_SHARED(Locks::mutator_lock_) { if (code_item == nullptr) { @@ -711,7 +711,7 @@ static void ResolveConstStrings(Handle dex_cache, } ClassLinker* const class_linker = Runtime::Current()->GetClassLinker(); - for (const DexInstructionPcPair& inst : CodeItemInstructionAccessor(dex_file, code_item)) { + for (const DexInstructionPcPair& inst : CodeItemInstructionAccessor(&dex_file, code_item)) { switch (inst->Opcode()) { case Instruction::CONST_STRING: case Instruction::CONST_STRING_JUMBO: { @@ -773,7 +773,7 @@ static void ResolveConstStrings(CompilerDriver* driver, continue; } previous_method_idx = method_idx; - ResolveConstStrings(dex_cache, dex_file, it.GetMethodCodeItem()); + ResolveConstStrings(dex_cache, *dex_file, it.GetMethodCodeItem()); it.Next(); } DCHECK(!it.HasNext()); -- cgit v1.2.3-59-g8ed1b