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

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

Issue 1921563002: [turbofan] Initial version of number type feedback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 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') | 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 9b8d19eea276ac58bbefe04819de987b789db518..06b4ebecb30f2db1fb5eddb39afd5db98524183f 100644
--- a/test/unittests/compiler/node-test-utils.cc
+++ b/test/unittests/compiler/node-test-utils.cc
@@ -800,6 +800,46 @@ class IsReferenceEqualMatcher final : public NodeMatcher {
const Matcher<Node*> rhs_matcher_;
};
+class IsSpeculativeBinopMatcher final : public NodeMatcher {
+ public:
+ IsSpeculativeBinopMatcher(
+ IrOpcode::Value opcode,
+ const Matcher<BinaryOperationHints::Hint>& hint_matcher,
+ const Matcher<Node*>& lhs_matcher, const Matcher<Node*>& rhs_matcher,
+ const Matcher<Node*>& frame_state_matcher,
+ const Matcher<Node*>& effect_matcher,
+ const Matcher<Node*>& control_matcher)
+ : NodeMatcher(opcode),
+ lhs_matcher_(lhs_matcher),
+ rhs_matcher_(rhs_matcher),
+ frame_state_matcher_(frame_state_matcher),
+ effect_matcher_(effect_matcher),
+ control_matcher_(control_matcher) {}
+
+ bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
+ return (NodeMatcher::MatchAndExplain(node, listener) &&
+ // TODO(bmeurer): The type parameter is currently ignored.
+ PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "lhs",
+ lhs_matcher_, listener) &&
+ PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1), "rhs",
+ rhs_matcher_, listener) &&
+ PrintMatchAndExplain(NodeProperties::GetFrameStateInput(node, 0),
+ "frame state", frame_state_matcher_,
+ listener) &&
+ PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
+ effect_matcher_, listener) &&
+ PrintMatchAndExplain(NodeProperties::GetControlInput(node),
+ "control", control_matcher_, listener));
+ }
+
+ private:
+ const Matcher<Type*> type_matcher_;
+ const Matcher<Node*> lhs_matcher_;
+ const Matcher<Node*> rhs_matcher_;
+ const Matcher<Node*> frame_state_matcher_;
+ const Matcher<Node*> effect_matcher_;
+ const Matcher<Node*> control_matcher_;
+};
class IsAllocateMatcher final : public NodeMatcher {
public:
@@ -2029,6 +2069,27 @@ Matcher<Node*> IsReferenceEqual(const Matcher<Type*>& type_matcher,
new IsReferenceEqualMatcher(type_matcher, lhs_matcher, rhs_matcher));
}
+Matcher<Node*> IsSpeculativeNumberAdd(
+ const Matcher<BinaryOperationHints::Hint>& hint_matcher,
+ const Matcher<Node*>& lhs_matcher, const Matcher<Node*>& rhs_matcher,
+ const Matcher<Node*>& frame_state_matcher,
+ const Matcher<Node*>& effect_matcher,
+ const Matcher<Node*>& control_matcher) {
+ return MakeMatcher(new IsSpeculativeBinopMatcher(
+ IrOpcode::kSpeculativeNumberAdd, hint_matcher, lhs_matcher, rhs_matcher,
+ frame_state_matcher, effect_matcher, control_matcher));
+}
+
+Matcher<Node*> IsSpeculativeNumberSubtract(
+ const Matcher<BinaryOperationHints::Hint>& hint_matcher,
+ const Matcher<Node*>& lhs_matcher, const Matcher<Node*>& rhs_matcher,
+ const Matcher<Node*>& frame_state_matcher,
+ const Matcher<Node*>& effect_matcher,
+ const Matcher<Node*>& control_matcher) {
+ return MakeMatcher(new IsSpeculativeBinopMatcher(
+ IrOpcode::kSpeculativeNumberSubtract, hint_matcher, lhs_matcher,
+ rhs_matcher, frame_state_matcher, effect_matcher, control_matcher));
+}
Matcher<Node*> IsAllocate(const Matcher<Node*>& size_matcher,
const Matcher<Node*>& effect_matcher,
« no previous file with comments | « 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