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

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

Issue 1314473007: [turbofan] Remove usage of Unique<T> from graph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased and fixed. Created 5 years, 4 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/js-typed-lowering.cc ('k') | src/compiler/operator.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 d543425fca48606a0947291dc13bda6ecaa1c9cd..054aee9c1a4fbb29959494ef3498b58b80dc7a78 100644
--- a/src/compiler/node-matchers.h
+++ b/src/compiler/node-matchers.h
@@ -62,14 +62,6 @@ struct ValueMatcher : public NodeMatcher {
return value_;
}
- bool Is(const T& value) const {
- return this->HasValue() && this->Value() == value;
- }
-
- bool IsInRange(const T& low, const T& high) const {
- return this->HasValue() && low <= this->Value() && this->Value() <= high;
- }
-
private:
T value_;
bool has_value_;
@@ -108,6 +100,12 @@ template <typename T, IrOpcode::Value kOpcode>
struct IntMatcher final : public ValueMatcher<T, kOpcode> {
explicit IntMatcher(Node* node) : ValueMatcher<T, kOpcode>(node) {}
+ bool Is(const T& value) const {
+ return this->HasValue() && this->Value() == value;
+ }
+ bool IsInRange(const T& low, const T& high) const {
+ return this->HasValue() && low <= this->Value() && this->Value() <= high;
+ }
bool IsMultipleOf(T n) const {
return this->HasValue() && (this->Value() % n) == 0;
}
@@ -139,6 +137,12 @@ template <typename T, IrOpcode::Value kOpcode>
struct FloatMatcher final : public ValueMatcher<T, kOpcode> {
explicit FloatMatcher(Node* node) : ValueMatcher<T, kOpcode>(node) {}
+ bool Is(const T& value) const {
+ return this->HasValue() && this->Value() == value;
+ }
+ bool IsInRange(const T& low, const T& high) const {
+ return this->HasValue() && low <= this->Value() && this->Value() <= high;
+ }
bool IsMinusZero() const {
return this->Is(0.0) && std::signbit(this->Value());
}
@@ -153,9 +157,9 @@ typedef FloatMatcher<double, IrOpcode::kNumberConstant> NumberMatcher;
// A pattern matcher for heap object constants.
struct HeapObjectMatcher final
- : public ValueMatcher<Unique<HeapObject>, IrOpcode::kHeapConstant> {
+ : public ValueMatcher<Handle<HeapObject>, IrOpcode::kHeapConstant> {
explicit HeapObjectMatcher(Node* node)
- : ValueMatcher<Unique<HeapObject>, IrOpcode::kHeapConstant>(node) {}
+ : ValueMatcher<Handle<HeapObject>, IrOpcode::kHeapConstant>(node) {}
};
@@ -164,6 +168,9 @@ struct ExternalReferenceMatcher final
: public ValueMatcher<ExternalReference, IrOpcode::kExternalConstant> {
explicit ExternalReferenceMatcher(Node* node)
: ValueMatcher<ExternalReference, IrOpcode::kExternalConstant>(node) {}
+ bool Is(const ExternalReference& value) const {
+ return this->HasValue() && this->Value() == value;
+ }
};
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/compiler/operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698