summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/code_generator.cc7
-rw-r--r--compiler/optimizing/instruction_builder.cc14
2 files changed, 11 insertions, 10 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index b8d1f52995..23142514f7 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -919,10 +919,9 @@ static void CheckLoopEntriesCanBeUsedForOsr(const HGraph& graph,
}
ArenaVector<size_t> covered(
loop_headers.size(), 0, graph.GetAllocator()->Adapter(kArenaAllocMisc));
- IterationRange<DexInstructionIterator> instructions = code_item.Instructions();
- for (auto it = instructions.begin(); it != instructions.end(); ++it) {
- const uint32_t dex_pc = it.GetDexPC(instructions.begin());
- const Instruction& instruction = *it;
+ for (const DexInstructionPcPair& pair : code_item.Instructions()) {
+ const uint32_t dex_pc = pair.DexPc();
+ const Instruction& instruction = pair.Inst();
if (instruction.IsBranch()) {
uint32_t target = dex_pc + instruction.GetTargetOffset();
CheckCovers(target, graph, code_info, loop_headers, &covered);
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index 902985e4ee..0f0be20961 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -382,16 +382,18 @@ ArenaBitVector* HInstructionBuilder::FindNativeDebugInfoLocations() {
dex_file_->DecodeDebugPositionInfo(&code_item_, Callback::Position, locations);
// Instruction-specific tweaks.
IterationRange<DexInstructionIterator> instructions = code_item_.Instructions();
- for (const Instruction& inst : instructions) {
- switch (inst.Opcode()) {
+ for (DexInstructionIterator it = instructions.begin(); it != instructions.end(); ++it) {
+ switch (it->Opcode()) {
case Instruction::MOVE_EXCEPTION: {
// Stop in native debugger after the exception has been moved.
// The compiler also expects the move at the start of basic block so
// we do not want to interfere by inserting native-debug-info before it.
- locations->ClearBit(inst.GetDexPc(code_item_.insns_));
- const Instruction* next = inst.Next();
- if (DexInstructionIterator(next) != instructions.end()) {
- locations->SetBit(next->GetDexPc(code_item_.insns_));
+ locations->ClearBit(it.DexPc());
+ DexInstructionIterator next = it;
+ ++next;
+ DCHECK(next != it);
+ if (next != instructions.end()) {
+ locations->SetBit(next.DexPc());
}
break;
}