| 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 6d165b359d3988f19b78d09d674a76028407f57a..0249e98a566106e3510ad14f1113b1d16e946273 100644
|
| --- a/test/unittests/compiler/node-test-utils.cc
|
| +++ b/test/unittests/compiler/node-test-utils.cc
|
| @@ -1352,6 +1352,32 @@ class IsStackSlotMatcher final : public NodeMatcher {
|
| const Matcher<MachineRepresentation> rep_matcher_;
|
| };
|
|
|
| +class IsGuardMatcher final : public NodeMatcher {
|
| + public:
|
| + IsGuardMatcher(const Matcher<Type*>& type_matcher,
|
| + const Matcher<Node*>& value_matcher,
|
| + const Matcher<Node*>& control_matcher)
|
| + : NodeMatcher(IrOpcode::kGuard),
|
| + type_matcher_(type_matcher),
|
| + value_matcher_(value_matcher),
|
| + control_matcher_(control_matcher) {}
|
| +
|
| + bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
|
| + return (NodeMatcher::MatchAndExplain(node, listener) &&
|
| + PrintMatchAndExplain(OpParameter<Type*>(node->op()), "type",
|
| + type_matcher_, listener) &&
|
| + PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
|
| + "value", value_matcher_, listener) &&
|
| + PrintMatchAndExplain(NodeProperties::GetControlInput(node, 0),
|
| + "control", control_matcher_, listener));
|
| + }
|
| +
|
| + private:
|
| + const Matcher<Type*> type_matcher_;
|
| + const Matcher<Node*> value_matcher_;
|
| + const Matcher<Node*> control_matcher_;
|
| +};
|
| +
|
| class IsToNumberMatcher final : public NodeMatcher {
|
| public:
|
| IsToNumberMatcher(const Matcher<Node*>& base_matcher,
|
| @@ -2038,6 +2064,12 @@ Matcher<Node*> IsTailCall(
|
| effect_matcher, control_matcher));
|
| }
|
|
|
| +Matcher<Node*> IsGuard(const Matcher<Type*>& type_matcher,
|
| + const Matcher<Node*>& value_matcher,
|
| + const Matcher<Node*>& control_matcher) {
|
| + return MakeMatcher(
|
| + new IsGuardMatcher(type_matcher, value_matcher, control_matcher));
|
| +}
|
|
|
| Matcher<Node*> IsReferenceEqual(const Matcher<Type*>& type_matcher,
|
| const Matcher<Node*>& lhs_matcher,
|
|
|