summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2017-11-03 15:56:22 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-11-03 15:56:22 +0000
commit5f317039d87d74f25d3b0a442072557086742d17 (patch)
tree6beae56f543d234b49a2f973dcbeb5f6f0bd2b90 /compiler/optimizing/instruction_builder.cc
parent72627a5f675b1c664beb2ad33d60a1c8dca80826 (diff)
parent2b2bef245d5b2c6faa2d6f36da14866b2d8f5e4f (diff)
Merge "Refactor DexInstructionIterator"
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc14
1 files changed, 8 insertions, 6 deletions
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;
}