| 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 3ce9c729e8c693171ff367f35ea113976225a695..6f0e0ecb3736d1e9e4d36b3dbd9f9e4457527319 100644
|
| --- a/test/unittests/compiler/node-test-utils.cc
|
| +++ b/test/unittests/compiler/node-test-utils.cc
|
| @@ -1406,6 +1406,50 @@ class IsLoadContextMatcher final : public NodeMatcher {
|
| const Matcher<Node*> context_matcher_;
|
| };
|
|
|
| +class IsQuadopMatcher final : public NodeMatcher {
|
| + public:
|
| + IsQuadopMatcher(IrOpcode::Value opcode, const Matcher<Node*>& a_matcher,
|
| + const Matcher<Node*>& b_matcher,
|
| + const Matcher<Node*>& c_matcher,
|
| + const Matcher<Node*>& d_matcher)
|
| + : NodeMatcher(opcode),
|
| + a_matcher_(a_matcher),
|
| + b_matcher_(b_matcher),
|
| + c_matcher_(c_matcher),
|
| + d_matcher_(d_matcher) {}
|
| +
|
| + void DescribeTo(std::ostream* os) const final {
|
| + NodeMatcher::DescribeTo(os);
|
| + *os << " whose a (";
|
| + a_matcher_.DescribeTo(os);
|
| + *os << ") and b (";
|
| + b_matcher_.DescribeTo(os);
|
| + *os << ") and c (";
|
| + c_matcher_.DescribeTo(os);
|
| + *os << ") and d (";
|
| + d_matcher_.DescribeTo(os);
|
| + *os << ")";
|
| + }
|
| +
|
| + bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
|
| + return (NodeMatcher::MatchAndExplain(node, listener) &&
|
| + PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "a",
|
| + a_matcher_, listener) &&
|
| + PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1), "b",
|
| + b_matcher_, listener) &&
|
| + PrintMatchAndExplain(NodeProperties::GetValueInput(node, 2), "c",
|
| + c_matcher_, listener) &&
|
| + PrintMatchAndExplain(NodeProperties::GetValueInput(node, 3), "d",
|
| + d_matcher_, listener));
|
| + }
|
| +
|
| + private:
|
| + const Matcher<Node*> a_matcher_;
|
| + const Matcher<Node*> b_matcher_;
|
| + const Matcher<Node*> c_matcher_;
|
| + const Matcher<Node*> d_matcher_;
|
| +};
|
| +
|
| class IsTernopMatcher final : public NodeMatcher {
|
| public:
|
| IsTernopMatcher(IrOpcode::Value opcode, const Matcher<Node*>& lhs_matcher,
|
| @@ -2104,6 +2148,16 @@ Matcher<Node*> IsLoadFramePointer() {
|
| return MakeMatcher(new NodeMatcher(IrOpcode::kLoadFramePointer));
|
| }
|
|
|
| +#define IS_QUADOP_MATCHER(Name) \
|
| + Matcher<Node*> Is##Name( \
|
| + const Matcher<Node*>& a_matcher, const Matcher<Node*>& b_matcher, \
|
| + const Matcher<Node*>& c_matcher, const Matcher<Node*>& d_matcher) { \
|
| + return MakeMatcher(new IsQuadopMatcher(IrOpcode::k##Name, a_matcher, \
|
| + b_matcher, c_matcher, d_matcher)); \
|
| + }
|
| +
|
| +IS_QUADOP_MATCHER(Int32AddPair)
|
| +
|
| #define IS_TERNOP_MATCHER(Name) \
|
| Matcher<Node*> Is##Name(const Matcher<Node*>& lhs_matcher, \
|
| const Matcher<Node*>& mid_matcher, \
|
|
|