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
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 5d4ed46..43e0db5 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -702,7 +702,7 @@
// stable order.
static void ResolveConstStrings(Handle<mirror::DexCache> 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 @@
}
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 @@
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());