ART: Implement kMirOpNullCheck

The semantics of kMirOpNullCheck is to check object for null and
throw exception in that case. However, the implementation for it
is empty. This has been changed and appropriate dataflow have been
added to correctly reflect behavior.

In order to allow testing of implementation, the SpecialMethodInliner
has been updated to get rid of invoke and use this instead. This helps
all optimizations which do not check the MIR_INLINED flag because
when invoke is left in, they believe that invoke will still be done.

Change-Id: I62e425e42bdbc6357246fb949db5f79de73cf358
Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
diff --git a/compiler/dex/quick/mir_to_lir.cc b/compiler/dex/quick/mir_to_lir.cc
index e519011..c4dfcb9 100644
--- a/compiler/dex/quick/mir_to_lir.cc
+++ b/compiler/dex/quick/mir_to_lir.cc
@@ -1077,9 +1077,17 @@
     case kMirOpSelect:
       GenSelect(bb, mir);
       break;
+    case kMirOpNullCheck: {
+      RegLocation rl_obj = mir_graph_->GetSrc(mir, 0);
+      rl_obj = LoadValue(rl_obj, kRefReg);
+      // An explicit check is done because it is not expected that when this is used,
+      // that it will actually trip up the implicit checks (since an invalid access
+      // is needed on the null object).
+      GenExplicitNullCheck(rl_obj.reg, mir->optimization_flags);
+      break;
+    }
     case kMirOpPhi:
     case kMirOpNop:
-    case kMirOpNullCheck:
     case kMirOpRangeCheck:
     case kMirOpDivZeroCheck:
     case kMirOpCheck: