summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index e815474b6e..4bb7ffc792 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -3199,6 +3199,19 @@ std::ostream& operator<<(std::ostream& os, HInvokeStaticOrDirect::ClinitCheckReq
}
}
+bool HInvokeVirtual::CanDoImplicitNullCheckOn(HInstruction* obj) const {
+ if (obj != InputAt(0)) {
+ return false;
+ }
+ switch (GetIntrinsic()) {
+ case Intrinsics::kReferenceRefersTo:
+ return true;
+ default:
+ // TODO: Add implicit null checks in more intrinsics.
+ return false;
+ }
+}
+
bool HLoadClass::InstructionDataEquals(const HInstruction* other) const {
const HLoadClass* other_load_class = other->AsLoadClass();
// TODO: To allow GVN for HLoadClass from different dex files, we should compare the type