Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1382)

Unified Diff: test/unittests/compiler/node-test-utils.cc

Issue 1458603012: [Interpreter] Add CreateClosure to BytecodeGraphBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Take IV. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/handles.h ('K') | « test/unittests/compiler/node-test-utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 713a4bc440889231b58a93f42e8490898c1442b7..b2c6d527911452aca945f146942d161ddc2c7768 100644
--- a/test/unittests/compiler/node-test-utils.cc
+++ b/test/unittests/compiler/node-test-utils.cc
@@ -1858,6 +1858,46 @@ class IsJSCallMatcher final : public NodeMatcher {
const Matcher<Node*> control_matcher_;
};
+
+class IsCreateClosureMatcher final : public NodeMatcher {
+ public:
+ IsCreateClosureMatcher(const Matcher<CreateClosureParameters>& value_matcher,
+ const Matcher<Node*>& effect_matcher,
+ const Matcher<Node*>& control_matcher)
+ : NodeMatcher(IrOpcode::Value::kJSCreateClosure),
+ value_matcher_(value_matcher),
+ effect_matcher_(effect_matcher),
+ control_matcher_(control_matcher) {}
+
+ void DescribeTo(std::ostream* os) const final {
+ NodeMatcher::DescribeTo(os);
+ *os << " whose value (";
+ value_matcher_.DescribeTo(os);
+ *os << "), effect (";
+ effect_matcher_.DescribeTo(os);
+ *os << ") and control (";
+ control_matcher_.DescribeTo(os);
+ *os << ")";
+ }
+
+ bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
+ if (!NodeMatcher::MatchAndExplain(node, listener)) {
+ return false;
+ }
+ return (PrintMatchAndExplain(OpParameter<CreateClosureParameters>(node),
+ "value", value_matcher_, listener) &&
+ PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
+ effect_matcher_, listener) &&
+ PrintMatchAndExplain(NodeProperties::GetControlInput(node),
+ "control", control_matcher_, listener));
+ }
+
+ private:
+ const Matcher<CreateClosureParameters> value_matcher_;
+ const Matcher<Node*> effect_matcher_;
+ const Matcher<Node*> control_matcher_;
+};
+
} // namespace
@@ -2535,6 +2575,15 @@ Matcher<Node*> IsJSCallRuntime(std::vector<Matcher<Node*>> value_matchers,
}
+Matcher<Node*> IsCreateClosure(
+ const Matcher<CreateClosureParameters>& closure_parameter_matcher,
+ const Matcher<Node*>& effect_matcher,
+ const Matcher<Node*>& control_matcher) {
+ return MakeMatcher(new IsCreateClosureMatcher(
+ closure_parameter_matcher, effect_matcher, control_matcher));
+}
+
+
#define IS_BINOP_MATCHER(Name) \
Matcher<Node*> Is##Name(const Matcher<Node*>& lhs_matcher, \
const Matcher<Node*>& rhs_matcher) { \
« src/handles.h ('K') | « test/unittests/compiler/node-test-utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698