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

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

Issue 2191883002: [turbofan] Adds speculative opcodes for shift right. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Really fix the merge conflicts. 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 | « src/compiler/js-typed-lowering.h ('k') | src/compiler/opcodes.h » ('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 e7e43d080f2781753fe79adf77a99664aef2af00..0964e461231797a8b8b42342d362b7724ef19a70 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -590,39 +590,39 @@ Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) {
return r.ChangeToPureOperator(intOp, Type::Integral32());
}
-Reduction JSTypedLowering::ReduceShiftLeft(Node* node) {
+Reduction JSTypedLowering::ReduceUI32Shift(Node* node,
+ Signedness left_signedness,
+ const Operator* shift_op) {
if (flags() & kDisableIntegerBinaryOpReduction) return NoChange();
-
JSBinopReduction r(this, node);
BinaryOperationHints::Hint feedback = r.GetNumberBinaryOperationFeedback();
if (feedback != BinaryOperationHints::kAny) {
+ Operator const* speculative_op;
+ if (shift_op->opcode() == IrOpcode::kNumberShiftLeft) {
+ speculative_op = simplified()->SpeculativeNumberShiftLeft(feedback);
+ } else if (shift_op->opcode() == IrOpcode::kNumberShiftRightLogical) {
+ speculative_op =
+ simplified()->SpeculativeNumberShiftRightLogical(feedback);
+ } else {
+ DCHECK(shift_op->opcode() == IrOpcode::kNumberShiftRight);
+ speculative_op = simplified()->SpeculativeNumberShiftRight(feedback);
+ }
return r.ChangeToSpeculativeOperator(
- simplified()->SpeculativeNumberShiftLeft(feedback), Type::Signed32());
+ speculative_op, shift_op->opcode() == IrOpcode::kNumberShiftRightLogical
+ ? Type::Unsigned32()
+ : Type::Signed32());
}
// If deoptimization is enabled we rely on type feedback.
if (r.BothInputsAre(Type::PlainPrimitive()) ||
!(flags() & kDeoptimizationEnabled)) {
r.ConvertInputsToNumber();
- r.ConvertInputsToUI32(kSigned, kUnsigned);
- return r.ChangeToPureOperator(simplified()->NumberShiftLeft(),
- Type::Number());
+ r.ConvertInputsToUI32(left_signedness, kUnsigned);
+ return r.ChangeToPureOperator(shift_op);
}
return NoChange();
}
-Reduction JSTypedLowering::ReduceUI32Shift(Node* node,
- Signedness left_signedness,
- const Operator* shift_op) {
- if (flags() & kDisableIntegerBinaryOpReduction) return NoChange();
-
- JSBinopReduction r(this, node);
- r.ConvertInputsToNumber();
- r.ConvertInputsToUI32(left_signedness, kUnsigned);
- return r.ChangeToPureOperator(shift_op);
-}
-
-
Reduction JSTypedLowering::ReduceJSComparison(Node* node) {
JSBinopReduction r(this, node);
if (r.BothInputsAre(Type::String())) {
@@ -2049,7 +2049,7 @@ Reduction JSTypedLowering::Reduce(Node* node) {
case IrOpcode::kJSBitwiseAnd:
return ReduceInt32Binop(node, simplified()->NumberBitwiseAnd());
case IrOpcode::kJSShiftLeft:
- return ReduceShiftLeft(node);
+ return ReduceUI32Shift(node, kSigned, simplified()->NumberShiftLeft());
case IrOpcode::kJSShiftRight:
return ReduceUI32Shift(node, kSigned, simplified()->NumberShiftRight());
case IrOpcode::kJSShiftRightLogical:
« no previous file with comments | « src/compiler/js-typed-lowering.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698