ARM: Try to emit branches early to save memory.

Try to emit unexpanded branches when binding a Label to
reduce the memory needed for Fixup dependencies. We use
a simple heuristic to limit the time we spend trying
but this heuristic is enough to resolve all branches in
the emitted String.equals() intrinsic.

Test: Run ART test suite on host and Nexus 6.
Test: Manually check memory usage for a certain apk.
Bug: 28603175
Change-Id: I362e07c2c1285ff609cf8df0a00b6b420729b9ce
diff --git a/compiler/utils/arm/assembler_thumb2.h b/compiler/utils/arm/assembler_thumb2.h
index 13f3bec..3a07a9c 100644
--- a/compiler/utils/arm/assembler_thumb2.h
+++ b/compiler/utils/arm/assembler_thumb2.h
@@ -573,6 +573,10 @@
       return location_;
     }
 
+    uint32_t GetTarget() const {
+      return target_;
+    }
+
     uint32_t GetAdjustment() const {
       return adjustment_;
     }
@@ -592,6 +596,11 @@
       target_ = target;
     }
 
+    // Branches with bound targets that are in range can be emitted early.
+    // However, the caller still needs to check if the branch doesn't go over
+    // another Fixup that's not ready to be emitted.
+    bool IsCandidateForEmitEarly() const;
+
     // Check if the current size is OK for current location_, target_ and adjustment_.
     // If not, increase the size. Return the size increase, 0 if unchanged.
     // If the target if after this Fixup, also add the difference to adjustment_,