ARM: Fix breaking changes from recent VIXL update.

Test: test-art-target, test-art-host

Change-Id: I31de1e2075226542b9919f6ca054fd5bf237e690
diff --git a/compiler/utils/arm/assembler_arm_vixl.cc b/compiler/utils/arm/assembler_arm_vixl.cc
index 34849cd..d6b24da 100644
--- a/compiler/utils/arm/assembler_arm_vixl.cc
+++ b/compiler/utils/arm/assembler_arm_vixl.cc
@@ -483,13 +483,9 @@
 
 void ArmVIXLMacroAssembler::B(vixl32::Label* label) {
   if (!label->IsBound()) {
-    // Try to use 16-bit T2 encoding of B instruction.
+    // Try to use a 16-bit encoding of the B instruction.
     DCHECK(OutsideITBlock());
-    ExactAssemblyScope guard(this,
-                             k16BitT32InstructionSizeInBytes,
-                             CodeBufferCheckScope::kMaximumSize);
-    b(al, Narrow, label);
-    AddBranchLabel(label);
+    BPreferNear(label);
     return;
   }
   MacroAssembler::B(label);
@@ -497,18 +493,11 @@
 
 void ArmVIXLMacroAssembler::B(vixl32::Condition cond, vixl32::Label* label, bool is_far_target) {
   if (!label->IsBound() && !is_far_target) {
-    // Try to use 16-bit T2 encoding of B instruction.
+    // Try to use a 16-bit encoding of the B instruction.
     DCHECK(OutsideITBlock());
-    ExactAssemblyScope guard(this,
-                             k16BitT32InstructionSizeInBytes,
-                             CodeBufferCheckScope::kMaximumSize);
-    b(cond, Narrow, label);
-    AddBranchLabel(label);
+    BPreferNear(cond, label);
     return;
   }
-  // To further reduce the Bcc encoding size and use 16-bit T1 encoding,
-  // we can provide a hint to this function: i.e. far_target=false.
-  // By default this function uses 'EncodingSizeType::Best' which generates 32-bit T3 encoding.
   MacroAssembler::B(cond, label);
 }
 
diff --git a/compiler/utils/arm/jni_macro_assembler_arm_vixl.cc b/compiler/utils/arm/jni_macro_assembler_arm_vixl.cc
index 0bae4d4..2b3e979 100644
--- a/compiler/utils/arm/jni_macro_assembler_arm_vixl.cc
+++ b/compiler/utils/arm/jni_macro_assembler_arm_vixl.cc
@@ -624,14 +624,8 @@
                       Thread::ExceptionOffset<kArmPointerSize>().Int32Value());
 
   ___ Cmp(scratch.AsVIXLRegister(), 0);
-  {
-    ExactAssemblyScope guard(asm_.GetVIXLAssembler(),
-                             vixl32::kMaxInstructionSizeInBytes,
-                             CodeBufferCheckScope::kMaximumSize);
-    vixl32::Label* label = exception_blocks_.back()->Entry();
-    ___ b(ne, Narrow, label);
-    ___ AddBranchLabel(label);
-  }
+  vixl32::Label* label = exception_blocks_.back()->Entry();
+  ___ BPreferNear(ne, label);
   // TODO: think about using CBNZ here.
 }