Index: src/compiler/common-operator.cc |
diff --git a/src/compiler/common-operator.cc b/src/compiler/common-operator.cc |
index c9dea87acca2a6a0706a5904801606f6de49afe9..f1ac90aa5fab7e25cd3d84b0d696523e4df2d733 100644 |
--- a/src/compiler/common-operator.cc |
+++ b/src/compiler/common-operator.cc |
@@ -50,6 +50,32 @@ BranchHint BranchHintOf(const Operator* const op) { |
} |
+bool operator==(SelectParameters const& lhs, SelectParameters const& rhs) { |
+ return lhs.type() == rhs.type() && lhs.hint() == rhs.hint(); |
+} |
+ |
+ |
+bool operator!=(SelectParameters const& lhs, SelectParameters const& rhs) { |
+ return !(lhs == rhs); |
+} |
+ |
+ |
+size_t hash_value(SelectParameters const& p) { |
+ return base::hash_combine(p.type(), p.hint()); |
+} |
+ |
+ |
+std::ostream& operator<<(std::ostream& os, SelectParameters const& p) { |
+ return os << p.type() << "|" << p.hint(); |
+} |
+ |
+ |
+SelectParameters const& SelectParametersOf(const Operator* const op) { |
+ DCHECK_EQ(IrOpcode::kSelect, op->opcode()); |
+ return OpParameter<SelectParameters>(op); |
+} |
+ |
+ |
size_t hash_value(OutputFrameStateCombine const& sc) { |
return base::hash_combine(sc.kind_, sc.parameter_); |
} |
@@ -219,6 +245,14 @@ const Operator* CommonOperatorBuilder::HeapConstant( |
} |
+const Operator* CommonOperatorBuilder::Select(MachineType type, |
+ BranchHint hint) { |
+ return new (zone()) |
+ Operator1<SelectParameters>(IrOpcode::kSelect, Operator::kPure, 3, 1, |
+ "Select", SelectParameters(type, hint)); |
+} |
+ |
+ |
const Operator* CommonOperatorBuilder::Phi(MachineType type, int arguments) { |
DCHECK(arguments > 0); // Disallow empty phis. |
return new (zone()) Operator1<MachineType>(IrOpcode::kPhi, Operator::kPure, |