Index: runtime/vm/intermediate_language.cc |
=================================================================== |
--- runtime/vm/intermediate_language.cc (revision 44874) |
+++ runtime/vm/intermediate_language.cc (working copy) |
@@ -191,7 +191,7 @@ |
} |
-bool CheckClassInstr::IsNullCheck() const { |
+bool CheckClassInstr::DeoptIfNull() const { |
if (unary_checks().NumberOfChecks() != 1) { |
return false; |
} |
@@ -203,6 +203,19 @@ |
} |
+// Null object is a singleton of null-class (except for some sentinel, |
+// transitional temporaries). Instead of checking against the null class only |
+// we can check against null instance instead. |
+bool CheckClassInstr::DeoptIfNotNull() const { |
+ if (unary_checks().NumberOfChecks() != 1) { |
+ return false; |
+ } |
+ const intptr_t cid = unary_checks().GetCidAt(0); |
+ return cid == kNullCid; |
+} |
+ |
+ |
+ |
bool CheckClassInstr::IsDenseSwitch() const { |
if (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) return false; |
if (cids_.length() > 2 && |