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

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

Issue 989203002: [x86] Faster/shorter code for stack checks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « src/compiler/instruction-selector.h ('k') | src/compiler/raw-machine-assembler.h » ('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 1a29bb830e194c9d813b122eb2a0f12367a29f95..48ff3d732326406a04289afddd8a4ce004cf19fc 100644
--- a/src/compiler/node-matchers.h
+++ b/src/compiler/node-matchers.h
@@ -7,6 +7,8 @@
#include <cmath>
+// TODO(turbofan): Move ExternalReference out of assembler.h
+#include "src/assembler.h"
#include "src/compiler/node.h"
#include "src/compiler/operator.h"
#include "src/unique.h"
@@ -155,6 +157,32 @@ struct HeapObjectMatcher FINAL
};
+// A pattern matcher for external reference constants.
+struct ExternalReferenceMatcher FINAL
+ : public ValueMatcher<ExternalReference, IrOpcode::kExternalConstant> {
+ explicit ExternalReferenceMatcher(Node* node)
+ : ValueMatcher<ExternalReference, IrOpcode::kExternalConstant>(node) {}
+};
+
+
+// For shorter pattern matching code, this struct matches the inputs to
+// machine-level load operations.
+template <typename Object>
+struct LoadMatcher : public NodeMatcher {
+ explicit LoadMatcher(Node* node)
+ : NodeMatcher(node), object_(InputAt(0)), index_(InputAt(1)) {}
+
+ typedef Object ObjectMatcher;
+
+ Object const& object() const { return object_; }
+ IntPtrMatcher const& index() const { return index_; }
+
+ private:
+ Object const object_;
+ IntPtrMatcher const index_;
+};
+
+
// For shorter pattern matching code, this struct matches both the left and
// right hand sides of a binary operation and can put constants on the right
// if they appear on the left hand side of a commutative operation.
« no previous file with comments | « src/compiler/instruction-selector.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698