summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2017-09-27 22:53:17 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-09-27 22:53:17 +0000
commit2a7b84ba85caa95f6bdb9ad5be3f93b2c742d366 (patch)
tree7d84d17a49e121ea8b3a90127d1d5e1322942914 /compiler/optimizing/instruction_builder.cc
parent350546494d6964daee2b9236820b7f85b88dfd59 (diff)
parent1d2d4ff8570bb88d9d2d4633706fd7f6fb18d75e (diff)
Merge "Add DexInstructionIterator and use it a few places"
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index e832b10b79..6ad8036870 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -368,17 +368,16 @@ void HInstructionBuilder::FindNativeDebugInfoLocations(ArenaBitVector* locations
};
dex_file_->DecodeDebugPositionInfo(&code_item_, Callback::Position, locations);
// Instruction-specific tweaks.
- const Instruction* const begin = Instruction::At(code_item_.insns_);
- const Instruction* const end = begin->RelativeAt(code_item_.insns_size_in_code_units_);
- for (const Instruction* inst = begin; inst < end; inst = inst->Next()) {
- switch (inst->Opcode()) {
+ IterationRange<DexInstructionIterator> instructions = code_item_.Instructions();
+ for (const Instruction& inst : instructions) {
+ switch (inst.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 (next < end) {
+ locations->ClearBit(inst.GetDexPc(code_item_.insns_));
+ const Instruction* next = inst.Next();
+ if (DexInstructionIterator(next) != instructions.end()) {
locations->SetBit(next->GetDexPc(code_item_.insns_));
}
break;