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

Unified Diff: src/compiler/common-operator.cc

Issue 691513002: [turbofan] Introduce new Select operator to improve bounds checking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/common-operator.h ('k') | src/compiler/control-reducer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/control-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698