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

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

Issue 931623002: [turbofan] Optimize certain chains of Branch into a Switch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addrssed comments. Created 5 years, 10 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-flow-optimizer.h » ('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 eda99d4fee0d2a94adc4bbc47514705ef99d64f3..8aea3df5adc85867877924a94d78aeae6928c174 100644
--- a/src/compiler/common-operator.cc
+++ b/src/compiler/common-operator.cc
@@ -36,12 +36,6 @@ BranchHint BranchHintOf(const Operator* const op) {
}
-size_t CaseIndexOf(const Operator* const op) {
- DCHECK_EQ(IrOpcode::kCase, op->opcode());
- return OpParameter<size_t>(op);
-}
-
-
bool operator==(SelectParameters const& lhs, SelectParameters const& rhs) {
return lhs.type() == rhs.type() && lhs.hint() == rhs.hint();
}
@@ -121,6 +115,7 @@ size_t ProjectionIndexOf(const Operator* const op) {
V(End, Operator::kKontrol, 0, 0, 1, 0, 0, 0) \
V(IfTrue, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
V(IfFalse, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
+ V(IfDefault, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
V(Throw, Operator::kFoldable, 1, 1, 1, 0, 0, 1) \
V(Return, Operator::kNoThrow, 1, 1, 1, 0, 0, 1) \
V(OsrNormalEntry, Operator::kFoldable, 0, 1, 1, 0, 1, 1) \
@@ -256,7 +251,7 @@ const Operator* CommonOperatorBuilder::Branch(BranchHint hint) {
const Operator* CommonOperatorBuilder::Switch(size_t control_output_count) {
- DCHECK_GE(control_output_count, 2u); // Disallow trivial switches.
+ DCHECK_GE(control_output_count, 3u); // Disallow trivial switches.
return new (zone()) Operator( // --
IrOpcode::kSwitch, Operator::kKontrol, // opcode
"Switch", // name
@@ -264,12 +259,12 @@ const Operator* CommonOperatorBuilder::Switch(size_t control_output_count) {
}
-const Operator* CommonOperatorBuilder::Case(size_t index) {
- return new (zone()) Operator1<size_t>( // --
- IrOpcode::kCase, Operator::kKontrol, // opcode
- "Case", // name
- 0, 0, 1, 0, 0, 1, // counts
- index); // parameter
+const Operator* CommonOperatorBuilder::IfValue(int32_t index) {
+ return new (zone()) Operator1<int32_t>( // --
+ IrOpcode::kIfValue, Operator::kKontrol, // opcode
+ "IfValue", // name
+ 0, 0, 1, 0, 0, 1, // counts
+ index); // parameter
}
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/control-flow-optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698