Fixes for "null instanceof" and class initialization

First issue was that the codegen seemed to expect r0 to contain 0 for
a false result in the null object case. This is a quick fix to make
that true. Given that the code is doing the work of a null check and
pulling out the object's class, the code should probably just pass the
class to the helper function, making this a case of IsAssignableFrom,
not instanceof.

Second issues were related to missing EnsureInitialized calls in two
different code paths, one coming from reflection, one coming from
managed code. New Class::AllocObject assert should help keep us out of
trouble in the future in this area, although perhaps Heap::AllocObject
should have a check as well.

Change-Id: Ib7975b6457481c1ac85135d38f42c6061e6443a0
diff --git a/test/IntMath/IntMath.java b/test/IntMath/IntMath.java
index 7b0d5f8..21f84bb 100644
--- a/test/IntMath/IntMath.java
+++ b/test/IntMath/IntMath.java
@@ -54,6 +54,10 @@
         IntMathBase a = new IntMathBase();
         IntMath b = new IntMath();
 
+        if (!(null instanceof IntMathBase)) {
+            x = x + 42;
+        }
+
         if (a instanceof IntMathBase) {
             x = x * 2;
         }
@@ -1116,7 +1120,7 @@
         }
 
         res = instanceTest(10);
-        if (res == 1352) {
+        if (res == 1436) {
             System.out.println("instanceTest PASSED");
         } else {
             System.out.println("instanceTest FAILED: " + res);