diff options
author | 2021-02-01 09:31:02 +0000 | |
---|---|---|
committer | 2021-02-05 10:48:17 +0000 | |
commit | ac27ac01490f53f9e2413dc9b66fbb2880904c96 (patch) | |
tree | 271018e1ef33667bee8d57c40ffa3f4d9f8cf930 /compiler/optimizing/nodes.cc | |
parent | 26bf47a60064fcc42e1b5e7b4b41deb8312d7330 (diff) |
Implement Reference.refersTo() intrinsic.
Test: Added tests to 122-npe and 160-read-barrier-stress
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Bug: 172573708
Change-Id: I8342510565289058df218d3249ffac1eb993ca4f
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r-- | compiler/optimizing/nodes.cc | 13 |
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 |