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

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

Issue 1123213002: [turbofan] Connect non-terminating loops via Terminate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months 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
« no previous file with comments | « test/unittests/compiler/node-test-utils.h ('k') | test/unittests/compiler/scheduler-unittest.cc » ('j') | 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 fd0a06ba68ceba34a19c04bfc6bee67dbe64c172..e6201ec67f8e6f627827b98b56e125200b67cfee 100644
--- a/test/unittests/compiler/node-test-utils.cc
+++ b/test/unittests/compiler/node-test-utils.cc
@@ -323,6 +323,37 @@ class IsReturnMatcher final : public NodeMatcher {
};
+class IsTerminateMatcher final : public NodeMatcher {
+ public:
+ IsTerminateMatcher(const Matcher<Node*>& effect_matcher,
+ const Matcher<Node*>& control_matcher)
+ : NodeMatcher(IrOpcode::kTerminate),
+ effect_matcher_(effect_matcher),
+ control_matcher_(control_matcher) {}
+
+ void DescribeTo(std::ostream* os) const final {
+ NodeMatcher::DescribeTo(os);
+ *os << " whose effect (";
+ effect_matcher_.DescribeTo(os);
+ *os << ") and control (";
+ control_matcher_.DescribeTo(os);
+ *os << ")";
+ }
+
+ bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
+ return (NodeMatcher::MatchAndExplain(node, listener) &&
+ PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
+ effect_matcher_, listener) &&
+ PrintMatchAndExplain(NodeProperties::GetControlInput(node),
+ "control", control_matcher_, listener));
+ }
+
+ private:
+ const Matcher<Node*> effect_matcher_;
+ const Matcher<Node*> control_matcher_;
+};
+
+
template <typename T>
class IsConstantMatcher final : public NodeMatcher {
public:
@@ -1289,11 +1320,6 @@ class IsUnopMatcher final : public NodeMatcher {
} // namespace
-Matcher<Node*> IsAlways() {
- return MakeMatcher(new NodeMatcher(IrOpcode::kAlways));
-}
-
-
Matcher<Node*> IsEnd(const Matcher<Node*>& control_matcher) {
return MakeMatcher(new IsControl1Matcher(IrOpcode::kEnd, control_matcher));
}
@@ -1389,6 +1415,12 @@ Matcher<Node*> IsReturn(const Matcher<Node*>& value_matcher,
}
+Matcher<Node*> IsTerminate(const Matcher<Node*>& effect_matcher,
+ const Matcher<Node*>& control_matcher) {
+ return MakeMatcher(new IsTerminateMatcher(effect_matcher, control_matcher));
+}
+
+
Matcher<Node*> IsExternalConstant(
const Matcher<ExternalReference>& value_matcher) {
return MakeMatcher(new IsConstantMatcher<ExternalReference>(
« no previous file with comments | « test/unittests/compiler/node-test-utils.h ('k') | test/unittests/compiler/scheduler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698