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 18d3d4b78d0193de021186b25c4f5cf9ae0f4a91..44ec06a3db4097851e19545144f96dd6f15b4bcb 100644 |
--- a/test/unittests/compiler/node-test-utils.cc |
+++ b/test/unittests/compiler/node-test-utils.cc |
@@ -659,6 +659,33 @@ class IsCallMatcher final : public NodeMatcher { |
}; |
+class IsAllocateMatcher final : public NodeMatcher { |
+ public: |
+ IsAllocateMatcher(const Matcher<Node*>& size_matcher, |
+ const Matcher<Node*>& effect_matcher, |
+ const Matcher<Node*>& control_matcher) |
+ : NodeMatcher(IrOpcode::kAllocate), |
+ size_matcher_(size_matcher), |
+ effect_matcher_(effect_matcher), |
+ control_matcher_(control_matcher) {} |
+ |
+ bool MatchAndExplain(Node* node, MatchResultListener* listener) const final { |
+ return (NodeMatcher::MatchAndExplain(node, listener) && |
+ PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "size", |
+ size_matcher_, listener) && |
+ PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect", |
+ effect_matcher_, listener) && |
+ PrintMatchAndExplain(NodeProperties::GetControlInput(node), |
+ "control", control_matcher_, listener)); |
+ } |
+ |
+ private: |
+ const Matcher<Node*> size_matcher_; |
+ const Matcher<Node*> effect_matcher_; |
+ const Matcher<Node*> control_matcher_; |
+}; |
+ |
+ |
class IsLoadFieldMatcher final : public NodeMatcher { |
public: |
IsLoadFieldMatcher(const Matcher<FieldAccess>& access_matcher, |
@@ -1470,6 +1497,14 @@ Matcher<Node*> IsCall( |
} |
+Matcher<Node*> IsAllocate(const Matcher<Node*>& size_matcher, |
+ const Matcher<Node*>& effect_matcher, |
+ const Matcher<Node*>& control_matcher) { |
+ return MakeMatcher( |
+ new IsAllocateMatcher(size_matcher, effect_matcher, control_matcher)); |
+} |
+ |
+ |
Matcher<Node*> IsLoadField(const Matcher<FieldAccess>& access_matcher, |
const Matcher<Node*>& base_matcher, |
const Matcher<Node*>& effect_matcher, |