Various bugfixes

divide by zero check for longs, off-by-one error on fill-array-data,
register management hygene, mvn encoding, iget/iput <= 32bits are
done as 32-bit (code was using type size for ld/st).

Change-Id: Ia09323e7d92f4ad21890af4c10f2f8c8f05f3b0e
diff --git a/src/compiler/codegen/arm/ArchFactory.cc b/src/compiler/codegen/arm/ArchFactory.cc
index ec37876..a68727f 100644
--- a/src/compiler/codegen/arm/ArchFactory.cc
+++ b/src/compiler/codegen/arm/ArchFactory.cc
@@ -51,6 +51,19 @@
 #endif
 }
 
+STATIC ArmLIR* genCheck(CompilationUnit* cUnit, ArmConditionCode cCode,
+                        MIR* mir, ArmThrowKind kind)
+{
+    ArmLIR* tgt = (ArmLIR*)oatNew(sizeof(ArmLIR), true);
+    tgt->opcode = kArmPseudoThrowTarget;
+    tgt->operands[0] = kind;
+    tgt->operands[1] = mir ? mir->offset : 0;
+    ArmLIR* branch = genConditionalBranch(cUnit, cCode, tgt);
+    // Remember branch target - will process later
+    oatInsertGrowableList(&cUnit->throwLaunchpads, (intptr_t)tgt);
+    return branch;
+}
+
 STATIC ArmLIR* genImmedCheck(CompilationUnit* cUnit, ArmConditionCode cCode,
                              int reg, int immVal, MIR* mir, ArmThrowKind kind)
 {