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

Unified Diff: src/compiler/machine-operator.h

Issue 2112733003: [turbofan] Allow OptionalOperator to return a placeholder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | src/compiler/machine-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-operator.h
diff --git a/src/compiler/machine-operator.h b/src/compiler/machine-operator.h
index 4763959ac37d887e84c0d2c985a446da5d8c527a..184f9e0f36754669d07e2fdb56fd4f46c08c5544 100644
--- a/src/compiler/machine-operator.h
+++ b/src/compiler/machine-operator.h
@@ -20,15 +20,21 @@ class Operator;
// For operators that are not supported on all platforms.
class OptionalOperator final {
public:
- explicit OptionalOperator(const Operator* op) : op_(op) {}
+ OptionalOperator(bool supported, const Operator* op)
+ : supported_(supported), op_(op) {}
- bool IsSupported() const { return op_ != nullptr; }
+ bool IsSupported() const { return supported_; }
+ // Gets the operator only if it is supported.
const Operator* op() const {
- DCHECK_NOT_NULL(op_);
+ DCHECK(supported_);
return op_;
}
+ // Always gets the operator, even for unsupported operators. This is useful to
+ // use the operator as a placeholder in a graph, for instance.
+ const Operator* placeholder() const { return op_; }
private:
+ bool supported_;
const Operator* const op_;
};
@@ -209,7 +215,6 @@ class MachineOperatorBuilder final : public ZoneObject {
const OptionalOperator Word32Ctz();
const OptionalOperator Word32Popcnt();
const OptionalOperator Word64Popcnt();
- const Operator* Word64PopcntPlaceholder();
const OptionalOperator Word32ReverseBits();
const OptionalOperator Word64ReverseBits();
bool Word32ShiftIsSafe() const { return flags_ & kWord32ShiftIsSafe; }
@@ -223,7 +228,6 @@ class MachineOperatorBuilder final : public ZoneObject {
const Operator* Word64Ror();
const Operator* Word64Clz();
const OptionalOperator Word64Ctz();
- const Operator* Word64CtzPlaceholder();
const Operator* Word64Equal();
const Operator* Int32PairAdd();
« no previous file with comments | « no previous file | src/compiler/machine-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698