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

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

Issue 1456453002: [Interpreter] Add support for Call bytecode to bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Compilation fix (signed/unsigned). 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
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 22d27d4bb7fe223b74455ca0c9e94bc9f2d3da2a..897065824b50b22232866bbf49d49915a9dfb3d1 100644
--- a/test/unittests/compiler/node-test-utils.cc
+++ b/test/unittests/compiler/node-test-utils.cc
@@ -1480,6 +1480,59 @@ class IsJSLoadNamedMatcher final : public NodeMatcher {
const Matcher<Node*> control_matcher_;
};
+
+class IsJSCallFunctionMatcher final : public NodeMatcher {
+ public:
+ IsJSCallFunctionMatcher(const std::vector<Matcher<Node*>>& value_matchers,
+ const Matcher<Node*>& effect_matcher,
+ const Matcher<Node*>& control_matcher)
+ : NodeMatcher(IrOpcode::kJSCallFunction),
+ value_matchers_(value_matchers),
+ effect_matcher_(effect_matcher),
+ control_matcher_(control_matcher) {}
+
+ void DescribeTo(std::ostream* os) const final {
+ NodeMatcher::DescribeTo(os);
+ for (size_t i = 0; i < value_matchers_.size(); ++i) {
+ if (i == 0) {
+ *os << " whose value0 (";
+ } else {
+ *os << "), value" << i << " (";
+ }
+ value_matchers_[i].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;
+ }
+ for (size_t i = 0; i < value_matchers_.size(); ++i) {
+ std::ostringstream ost;
+ ost << "value" << i;
+ if (!PrintMatchAndExplain(
+ NodeProperties::GetValueInput(node, static_cast<int>(i)),
+ ost.str(), value_matchers_[i], listener)) {
+ return false;
+ }
+ }
+ return (PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
+ effect_matcher_, listener) &&
+ PrintMatchAndExplain(NodeProperties::GetControlInput(node),
+ "control", control_matcher_, listener));
+ }
+
+ private:
+ const std::vector<Matcher<Node*>> value_matchers_;
+ const Matcher<Node*> effect_matcher_;
+ const Matcher<Node*> control_matcher_;
+};
+
} // namespace
@@ -2064,6 +2117,14 @@ Matcher<Node*> IsJSLoadNamed(const Handle<Name> name,
}
+Matcher<Node*> IsJSCallFunction(std::vector<Matcher<Node*>> value_matchers,
+ const Matcher<Node*>& effect_matcher,
+ const Matcher<Node*>& control_matcher) {
+ return MakeMatcher(new IsJSCallFunctionMatcher(value_matchers, effect_matcher,
+ control_matcher));
+}
+
+
#define IS_BINOP_MATCHER(Name) \
Matcher<Node*> Is##Name(const Matcher<Node*>& lhs_matcher, \
const Matcher<Node*>& rhs_matcher) { \
« no previous file with comments | « test/unittests/compiler/node-test-utils.h ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698