summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2017-10-26 17:10:19 -0700
committerMathieu Chartier <mathieuc@google.com>2017-11-01 15:36:21 -0700
commit2b2bef245d5b2c6faa2d6f36da14866b2d8f5e4f (patch)
tree7948ee1d32e211198a595bb7ed35558d22838da8 /compiler/optimizing/code_generator.cc
parentf199f1d3a9816edf9282766a8874d894d7bf87c3 (diff)
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
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r--compiler/optimizing/code_generator.cc7
1 files changed, 3 insertions, 4 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);