Fix for implicit null test for oat.

This change also cleans up the notion of the callee save method with a
"IsPhony" call. Stack visitors check whether the frame they are on has a
legitimate method with "HasMethod".

Change-Id: I8ac0fdd595c1e764fdc22cfa9c6a394595f7e141
diff --git a/src/object.h b/src/object.h
index efdb424..2a4078d 100644
--- a/src/object.h
+++ b/src/object.h
@@ -902,7 +902,7 @@
 
   void SetInvokeStub(const ByteArray* invoke_stub_array);
 
-  uint32_t GetCoreSpillMask() {
+  uint32_t GetCoreSpillMask() const {
     return GetField32(OFFSET_OF_OBJECT_MEMBER(Method, core_spill_mask_), false);
   }
 
@@ -912,7 +912,7 @@
                core_spill_mask, false);
   }
 
-  uint32_t GetFpSpillMask() {
+  uint32_t GetFpSpillMask() const {
     return GetField32(OFFSET_OF_OBJECT_MEMBER(Method, fp_spill_mask_), false);
   }
 
@@ -922,6 +922,15 @@
                fp_spill_mask, false);
   }
 
+  // Is this a hand crafted method used for something like describing callee saves?
+  bool IsPhony() const {
+    bool result =
+        NULL == GetFieldObject<Class*>(OFFSET_OF_OBJECT_MEMBER(Method, declaring_class_), false);
+    // Check that if we do think it is phony it looks like the callee save method
+    DCHECK(!result || GetCoreSpillMask() != 0);
+    return result;
+  }
+
   // Converts a native PC to a dex PC.  TODO: this is a no-op
   // until we associate a PC mapping table with each method.
   uint32_t ToDexPC(const uintptr_t pc) const;