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

Unified Diff: src/compiler/js-typed-lowering.cc

Issue 2121153003: [turbofan] Remove eager frame state from divisions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/operator-properties.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index e3b614c1b5b3cec2a30126ab34b24857fc97034d..94c209d3a48986f3cd628ce6a6d3cee8cbfc27a4 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -486,22 +486,6 @@ Reduction JSTypedLowering::ReduceJSAdd(Node* node) {
}
-Reduction JSTypedLowering::ReduceJSModulus(Node* node) {
- if (flags() & kDisableBinaryOpReduction) return NoChange();
- JSBinopReduction r(this, node);
- if (r.BothInputsAre(Type::Number())) {
- // JSModulus(x:number, x:number) => NumberModulus(x, y)
- return r.ChangeToPureOperator(simplified()->NumberModulus(),
- Type::Number());
- }
- BinaryOperationHints::Hint feedback = r.GetNumberBinaryOperationFeedback();
- if (feedback != BinaryOperationHints::kAny) {
- return r.ChangeToSpeculativeOperator(
- simplified()->SpeculativeNumberModulus(feedback), Type::Number());
- }
- return NoChange();
-}
-
Reduction JSTypedLowering::ReduceJSSubtract(Node* node) {
if (flags() & kDisableBinaryOpReduction) return NoChange();
JSBinopReduction r(this, node);
@@ -534,7 +518,6 @@ Reduction JSTypedLowering::ReduceJSSubtract(Node* node) {
Reduction JSTypedLowering::ReduceJSMultiply(Node* node) {
if (flags() & kDisableBinaryOpReduction) return NoChange();
JSBinopReduction r(this, node);
-
BinaryOperationHints::Hint feedback = r.GetNumberBinaryOperationFeedback();
if (feedback != BinaryOperationHints::kAny) {
return r.ChangeToSpeculativeOperator(
@@ -560,10 +543,32 @@ Reduction JSTypedLowering::ReduceJSDivide(Node* node) {
return r.ChangeToSpeculativeOperator(
simplified()->SpeculativeNumberDivide(feedback), Type::Number());
}
- r.ConvertInputsToNumber();
- return r.ChangeToPureOperator(simplified()->NumberDivide(), Type::Number());
+
+ // If deoptimization is enabled we rely on type feedback.
+ if (r.BothInputsAre(Type::PlainPrimitive()) ||
+ !(flags() & kDeoptimizationEnabled)) {
+ r.ConvertInputsToNumber();
+ return r.ChangeToPureOperator(simplified()->NumberDivide(), Type::Number());
+ }
+
+ return NoChange();
}
+Reduction JSTypedLowering::ReduceJSModulus(Node* node) {
+ if (flags() & kDisableBinaryOpReduction) return NoChange();
+ JSBinopReduction r(this, node);
+ if (r.BothInputsAre(Type::Number())) {
+ // JSModulus(x:number, x:number) => NumberModulus(x, y)
+ return r.ChangeToPureOperator(simplified()->NumberModulus(),
+ Type::Number());
+ }
+ BinaryOperationHints::Hint feedback = r.GetNumberBinaryOperationFeedback();
+ if (feedback != BinaryOperationHints::kAny) {
+ return r.ChangeToSpeculativeOperator(
+ simplified()->SpeculativeNumberModulus(feedback), Type::Number());
+ }
+ return NoChange();
+}
Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) {
if (flags() & kDisableBinaryOpReduction) return NoChange();
« no previous file with comments | « no previous file | src/compiler/operator-properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698