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
diff --git a/compiler/dex/dex_to_dex_compiler.cc b/compiler/dex/dex_to_dex_compiler.cc
index ead909a..7e41c53 100644
--- a/compiler/dex/dex_to_dex_compiler.cc
+++ b/compiler/dex/dex_to_dex_compiler.cc
@@ -114,7 +114,8 @@
void DexCompiler::Compile() {
DCHECK_EQ(dex_to_dex_compilation_level_, DexToDexCompilationLevel::kOptimize);
- IterationRange<DexInstructionIterator> instructions = unit_.GetCodeItem()->Instructions();
+ IterationRange<DexInstructionIterator> instructions(unit_.GetCodeItemAccessor().begin(),
+ unit_.GetCodeItemAccessor().end());
for (DexInstructionIterator it = instructions.begin(); it != instructions.end(); ++it) {
const uint32_t dex_pc = it.DexPc();
Instruction* inst = const_cast<Instruction*>(&it.Inst());
@@ -364,7 +365,7 @@
if (kIsDebugBuild) {
// Double check that the counts line up with the size of the quicken info.
size_t quicken_count = 0;
- for (const DexInstructionPcPair& pair : code_item->Instructions()) {
+ for (const DexInstructionPcPair& pair : unit.GetCodeItemAccessor()) {
if (QuickenInfoTable::NeedsIndexForInstruction(&pair.Inst())) {
++quicken_count;
}
@@ -376,7 +377,7 @@
// Dex pc is not serialized, only used for checking the instructions. Since we access the
// array based on the index of the quickened instruction, the indexes must line up perfectly.
// The reader side uses the NeedsIndexForInstruction function too.
- const Instruction& inst = code_item->InstructionAt(info.dex_pc);
+ const Instruction& inst = unit.GetCodeItemAccessor().InstructionAt(info.dex_pc);
CHECK(QuickenInfoTable::NeedsIndexForInstruction(&inst)) << inst.Opcode();
// Add the index.
quicken_data.push_back(static_cast<uint8_t>(info.dex_member_index >> 0));