Index: test/unittests/compiler/node-test-utils.cc |
diff --git a/test/unittests/compiler/node-test-utils.cc b/test/unittests/compiler/node-test-utils.cc |
index 5fe40360c889d518b0f65c41628616e62a4c01fc..522eecf8f96ac9031984c5d0add95af1c826ed6a 100644 |
--- a/test/unittests/compiler/node-test-utils.cc |
+++ b/test/unittests/compiler/node-test-utils.cc |
@@ -748,6 +748,32 @@ class IsTailCallMatcher final : public NodeMatcher { |
}; |
+class IsReferenceEqualMatcher final : public NodeMatcher { |
+ public: |
+ IsReferenceEqualMatcher(const Matcher<Type*>& type_matcher, |
+ const Matcher<Node*>& lhs_matcher, |
+ const Matcher<Node*>& rhs_matcher) |
+ : NodeMatcher(IrOpcode::kReferenceEqual), |
+ type_matcher_(type_matcher), |
+ lhs_matcher_(lhs_matcher), |
+ rhs_matcher_(rhs_matcher) {} |
+ |
+ bool MatchAndExplain(Node* node, MatchResultListener* listener) const final { |
+ return (NodeMatcher::MatchAndExplain(node, listener) && |
+ // TODO(bmeurer): The type parameter is currently ignored. |
+ PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "lhs", |
+ lhs_matcher_, listener) && |
+ PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1), "rhs", |
+ rhs_matcher_, listener)); |
+ } |
+ |
+ private: |
+ const Matcher<Type*> type_matcher_; |
+ const Matcher<Node*> lhs_matcher_; |
+ const Matcher<Node*> rhs_matcher_; |
+}; |
+ |
+ |
class IsAllocateMatcher final : public NodeMatcher { |
public: |
IsAllocateMatcher(const Matcher<Node*>& size_matcher, |
@@ -1607,6 +1633,14 @@ Matcher<Node*> IsTailCall( |
} |
+Matcher<Node*> IsReferenceEqual(const Matcher<Type*>& type_matcher, |
+ const Matcher<Node*>& lhs_matcher, |
+ const Matcher<Node*>& rhs_matcher) { |
+ return MakeMatcher( |
+ new IsReferenceEqualMatcher(type_matcher, lhs_matcher, rhs_matcher)); |
+} |
+ |
+ |
Matcher<Node*> IsAllocate(const Matcher<Node*>& size_matcher, |
const Matcher<Node*>& effect_matcher, |
const Matcher<Node*>& control_matcher) { |