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

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

Issue 2074903002: [turbofan] Numeric type feedback for mul, div and mod. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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 | « src/compiler/simplified-operator.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator.cc
diff --git a/src/compiler/simplified-operator.cc b/src/compiler/simplified-operator.cc
index a5f07bfa4f8fda86c1d5fc849f58c960e9168dee..756428ca39cd6c1709f744dfff2ce6c26934fb8d 100644
--- a/src/compiler/simplified-operator.cc
+++ b/src/compiler/simplified-operator.cc
@@ -219,7 +219,10 @@ Type* TypeOf(const Operator* op) {
BinaryOperationHints::Hint BinaryOperationHintOf(const Operator* op) {
DCHECK(op->opcode() == IrOpcode::kSpeculativeNumberAdd ||
- op->opcode() == IrOpcode::kSpeculativeNumberSubtract);
+ op->opcode() == IrOpcode::kSpeculativeNumberSubtract ||
+ op->opcode() == IrOpcode::kSpeculativeNumberMultiply ||
+ op->opcode() == IrOpcode::kSpeculativeNumberDivide ||
+ op->opcode() == IrOpcode::kSpeculativeNumberModulus);
return OpParameter<BinaryOperationHints::Hint>(op);
}
@@ -295,6 +298,13 @@ CompareOperationHints::Hint CompareOperationHintOf(const Operator* op) {
V(StringLessThan, Operator::kNoProperties, 2) \
V(StringLessThanOrEqual, Operator::kNoProperties, 2)
+#define SPECULATIVE_BINOP_LIST(V) \
+ V(SpeculativeNumberAdd) \
+ V(SpeculativeNumberSubtract) \
+ V(SpeculativeNumberDivide) \
+ V(SpeculativeNumberMultiply) \
+ V(SpeculativeNumberModulus)
+
#define CHECKED_OP_LIST(V) \
V(CheckedUint32ToInt32) \
V(CheckedFloat64ToInt32) \
@@ -496,19 +506,14 @@ const Operator* SimplifiedOperatorBuilder::StoreBuffer(BufferAccess access) {
return nullptr;
}
-const Operator* SimplifiedOperatorBuilder::SpeculativeNumberAdd(
- BinaryOperationHints::Hint hint) {
- return new (zone()) Operator1<BinaryOperationHints::Hint>(
- IrOpcode::kSpeculativeNumberAdd, Operator::kPure, "SpeculativeNumberAdd",
- 2, 1, 1, 1, 1, 1, hint);
-}
-
-const Operator* SimplifiedOperatorBuilder::SpeculativeNumberSubtract(
- BinaryOperationHints::Hint hint) {
- return new (zone()) Operator1<BinaryOperationHints::Hint>(
- IrOpcode::kSpeculativeNumberSubtract, Operator::kPure,
- "SpeculativeNumberSubtract", 2, 1, 1, 1, 1, 1, hint);
-}
+#define SPECULATIVE_BINOP_DEF(Name) \
+ const Operator* SimplifiedOperatorBuilder::Name( \
+ BinaryOperationHints::Hint hint) { \
+ return new (zone()) Operator1<BinaryOperationHints::Hint>( \
+ IrOpcode::k##Name, Operator::kPure, #Name, 2, 1, 1, 1, 1, 1, hint); \
+ }
+SPECULATIVE_BINOP_LIST(SPECULATIVE_BINOP_DEF)
+#undef SPECULATIVE_BINOP_DEF
const Operator* SimplifiedOperatorBuilder::SpeculativeNumberEqual(
CompareOperationHints::Hint hint) {
« no previous file with comments | « src/compiler/simplified-operator.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698