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 4c1e10b9eed3dc55cbb05ce09ff12ccc3ea34f13..7f840c6bf027f7e238f7c96f1430eb1067d34741 100644 |
--- a/test/unittests/compiler/node-test-utils.cc |
+++ b/test/unittests/compiler/node-test-utils.cc |
@@ -332,15 +332,66 @@ class IsProjectionMatcher FINAL : public NodeMatcher { |
}; |
-class IsCallMatcher FINAL : public NodeMatcher { |
+class IsCall2Matcher FINAL : public NodeMatcher { |
public: |
- IsCallMatcher(const Matcher<CallDescriptor*>& descriptor_matcher, |
- const Matcher<Node*>& value0_matcher, |
- const Matcher<Node*>& value1_matcher, |
- const Matcher<Node*>& value2_matcher, |
- const Matcher<Node*>& value3_matcher, |
- const Matcher<Node*>& effect_matcher, |
- const Matcher<Node*>& control_matcher) |
+ IsCall2Matcher(const Matcher<CallDescriptor*>& descriptor_matcher, |
+ const Matcher<Node*>& value0_matcher, |
+ const Matcher<Node*>& value1_matcher, |
+ const Matcher<Node*>& effect_matcher, |
+ const Matcher<Node*>& control_matcher) |
+ : NodeMatcher(IrOpcode::kCall), |
+ descriptor_matcher_(descriptor_matcher), |
+ value0_matcher_(value0_matcher), |
+ value1_matcher_(value1_matcher), |
+ effect_matcher_(effect_matcher), |
+ control_matcher_(control_matcher) {} |
+ |
+ virtual void DescribeTo(std::ostream* os) const OVERRIDE { |
+ NodeMatcher::DescribeTo(os); |
+ *os << " whose value0 ("; |
+ value0_matcher_.DescribeTo(os); |
+ *os << ") and value1 ("; |
+ value1_matcher_.DescribeTo(os); |
+ *os << ") and effect ("; |
+ effect_matcher_.DescribeTo(os); |
+ *os << ") and control ("; |
+ control_matcher_.DescribeTo(os); |
+ *os << ")"; |
+ } |
+ |
+ virtual bool MatchAndExplain(Node* node, |
+ MatchResultListener* listener) const OVERRIDE { |
+ return (NodeMatcher::MatchAndExplain(node, listener) && |
+ PrintMatchAndExplain(OpParameter<CallDescriptor*>(node), |
+ "descriptor", descriptor_matcher_, listener) && |
+ PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), |
+ "value0", value0_matcher_, listener) && |
+ PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1), |
+ "value1", value1_matcher_, listener) && |
+ PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect", |
+ effect_matcher_, listener) && |
+ PrintMatchAndExplain(NodeProperties::GetControlInput(node), |
+ "control", control_matcher_, listener)); |
+ } |
+ |
+ private: |
+ const Matcher<CallDescriptor*> descriptor_matcher_; |
+ const Matcher<Node*> value0_matcher_; |
+ const Matcher<Node*> value1_matcher_; |
+ const Matcher<Node*> effect_matcher_; |
+ const Matcher<Node*> control_matcher_; |
+}; |
+ |
+ |
+class IsCall4Matcher FINAL : public NodeMatcher { |
+ public: |
+ IsCall4Matcher(const Matcher<CallDescriptor*>& descriptor_matcher, |
+ const Matcher<Node*>& value0_matcher, |
+ const Matcher<Node*>& value1_matcher, |
+ const Matcher<Node*>& value2_matcher, |
+ const Matcher<Node*>& value3_matcher, |
+ const Matcher<Node*>& effect_matcher, |
+ const Matcher<Node*>& control_matcher) |
: NodeMatcher(IrOpcode::kCall), |
descriptor_matcher_(descriptor_matcher), |
value0_matcher_(value0_matcher), |
@@ -838,11 +889,22 @@ Matcher<Node*> IsProjection(const Matcher<size_t>& index_matcher, |
Matcher<Node*> IsCall(const Matcher<CallDescriptor*>& descriptor_matcher, |
const Matcher<Node*>& value0_matcher, |
const Matcher<Node*>& value1_matcher, |
+ const Matcher<Node*>& effect_matcher, |
+ const Matcher<Node*>& control_matcher) { |
+ return MakeMatcher(new IsCall2Matcher(descriptor_matcher, value0_matcher, |
+ value1_matcher, effect_matcher, |
+ control_matcher)); |
+} |
+ |
+ |
+Matcher<Node*> IsCall(const Matcher<CallDescriptor*>& descriptor_matcher, |
+ const Matcher<Node*>& value0_matcher, |
+ const Matcher<Node*>& value1_matcher, |
const Matcher<Node*>& value2_matcher, |
const Matcher<Node*>& value3_matcher, |
const Matcher<Node*>& effect_matcher, |
const Matcher<Node*>& control_matcher) { |
- return MakeMatcher(new IsCallMatcher( |
+ return MakeMatcher(new IsCall4Matcher( |
descriptor_matcher, value0_matcher, value1_matcher, value2_matcher, |
value3_matcher, effect_matcher, control_matcher)); |
} |