Art compiler: minor instruction assembler fix

During the assembly phase, we iteratively walk through the LIR
encoding instructions until we can complete a full pass without
without having to change the sequence because of displacement
overflow.

In the (fairly common) situation in which a 16-bit cbnz/cbz
can't reach the target, we expand it to a compare and branch sequence
Initially, we use a 16-bit Thumb1 unconditional branch, which itself
may be expanded in a future pass to a 32-bit branch.

The original cbnz/cbz LIR is converted into a cmp, and a new branch
instruction is inserted following.  The problem here is that by doing
a following insertion, that new instruction will be the next one
considered to determine if it can reach it's target.  Because it
is new, though, it's starting offset will show as zero - making it
much more likely that it will be treated as a displacement overflow
and be converted to a 32-bit branch.

This is not a correctness issue - the bad offset will be corrected
on the next pass, but it does result in unnecessary uses of 32-bit
branches where 16-bit ones would work.

Change-Id: Ie68a93fd319f0f7c603e1d870588047ad6a0779f
diff --git a/compiler/dex/quick/arm/assemble_arm.cc b/compiler/dex/quick/arm/assemble_arm.cc
index 8ba56df..2d69d93 100644
--- a/compiler/dex/quick/arm/assemble_arm.cc
+++ b/compiler/dex/quick/arm/assemble_arm.cc
@@ -1122,6 +1122,12 @@
           lir->operands[1] = 0;
           lir->target = 0;
           SetupResourceMasks(lir);
+          /*
+           * Because we just added this new instruction after the current one,
+           * advance lir so that this new instruction won't be checked for displacement
+           * overflow until the next pass (when its base offset will be properly established).
+           */
+          lir = new_inst;
           res = kRetryAll;
         } else {
           lir->operands[1] = delta >> 1;