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

Unified Diff: src/compiler/node-matchers.h

Issue 807693003: [turbofan] Unify custom node matchers. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Win64 Created 6 years 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 | « src/compiler/node.h ('k') | src/compiler/node-matchers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-matchers.h
diff --git a/src/compiler/node-matchers.h b/src/compiler/node-matchers.h
index fc11a0a8cf03f17e80b7a6d45196badf4e9adc7c..12e31a2adc00fac7b76254dd103947cb6a0bf94e 100644
--- a/src/compiler/node-matchers.h
+++ b/src/compiler/node-matchers.h
@@ -204,6 +204,39 @@ typedef BinopMatcher<Float64Matcher, Float64Matcher> Float64BinopMatcher;
typedef BinopMatcher<NumberMatcher, NumberMatcher> NumberBinopMatcher;
+// A pattern matcher for JSCallFunction operations.
+struct JSCallFunctionMatcher FINAL : public NodeMatcher {
+ explicit JSCallFunctionMatcher(Node* const node)
+ : NodeMatcher(node), function_(node->InputAt(0)) {
+ DCHECK_EQ(IrOpcode::kJSCallFunction, opcode());
+ }
+
+ typedef HeapObjectMatcher<JSFunction> Function;
+
+ const Function& function() const { return function_; }
+ Node* frame_state() const;
+
+ // Formal parameters, including the receiver.
+ typedef Node::Inputs::iterator const_iterator;
+ const_iterator begin() const;
+ const_iterator end() const;
+ size_t size() const;
+
+ private:
+ Function const function_;
+};
+
+
+// A pattern matcher for JSCallRuntime operations.
+struct JSCallRuntimeMatcher FINAL : public NodeMatcher {
+ explicit JSCallRuntimeMatcher(Node* const node) : NodeMatcher(node) {
+ DCHECK_EQ(IrOpcode::kJSCallRuntime, opcode());
+ }
+
+ const Runtime::Function* function() const;
+};
+
+
template <class BinopMatcher, IrOpcode::Value kMulOpcode,
IrOpcode::Value kShiftOpcode>
struct ScaleMatcher {
« no previous file with comments | « src/compiler/node.h ('k') | src/compiler/node-matchers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698