From 2b2bef245d5b2c6faa2d6f36da14866b2d8f5e4f Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 26 Oct 2017 17:10:19 -0700 Subject: Refactor DexInstructionIterator Add a way to get the dex PC for the "for each" use case. Bug: 67104794 Test: test-art-host Change-Id: I144c459c9a2a03ec8d56842280338d1f7ce1caf0 --- compiler/dex/inline_method_analyser.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/dex/inline_method_analyser.cc') diff --git a/compiler/dex/inline_method_analyser.cc b/compiler/dex/inline_method_analyser.cc index 925863ef0e..518b0ece73 100644 --- a/compiler/dex/inline_method_analyser.cc +++ b/compiler/dex/inline_method_analyser.cc @@ -302,7 +302,8 @@ bool DoAnalyseConstructor(const DexFile::CodeItem* code_item, uint16_t this_vreg = code_item->registers_size_ - code_item->ins_size_; uint16_t zero_vreg_mask = 0u; - for (const Instruction& instruction : code_item->Instructions()) { + for (const DexInstructionPcPair& pair : code_item->Instructions()) { + const Instruction& instruction = pair.Inst(); if (instruction.Opcode() == Instruction::RETURN_VOID) { break; } else if (instruction.Opcode() == Instruction::INVOKE_DIRECT) { -- cgit v1.2.3-59-g8ed1b