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

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

Issue 2201073002: [turbofan] Adds speculative operator for bitwise and, or and xor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handles kSigned32 feedback. Created 4 years, 4 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/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 acec322d0e0f8392728e2064ba1ec8287d1c3630..b0ddbb7eb29432235bc4b3f42e3d2448616546f9 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -581,13 +581,26 @@ Reduction JSTypedLowering::ReduceJSModulus(Node* node) {
return NoChange();
}
-Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) {
+Reduction JSTypedLowering::ReduceInt32Binop(Node* node,
+ const Operator* int_op) {
if (flags() & kDisableIntegerBinaryOpReduction) return NoChange();
-
JSBinopReduction r(this, node);
+ BinaryOperationHints::Hint feedback = r.GetNumberBinaryOperationFeedback();
+ if (feedback != BinaryOperationHints::kAny) {
+ Operator const* speculative_op;
+ if (int_op->opcode() == IrOpcode::kNumberBitwiseAnd) {
+ speculative_op = simplified()->SpeculativeNumberBitwiseAnd(feedback);
+ } else if (int_op->opcode() == IrOpcode::kNumberBitwiseOr) {
+ speculative_op = simplified()->SpeculativeNumberBitwiseOr(feedback);
+ } else {
+ DCHECK_EQ(IrOpcode::kNumberBitwiseXor, int_op->opcode());
+ speculative_op = simplified()->SpeculativeNumberBitwiseXor(feedback);
+ }
+ return r.ChangeToSpeculativeOperator(speculative_op, Type::Signed32());
+ }
r.ConvertInputsToNumber();
r.ConvertInputsToUI32(kSigned, kSigned);
- return r.ChangeToPureOperator(intOp, Type::Integral32());
+ return r.ChangeToPureOperator(int_op, Type::Signed32());
}
Reduction JSTypedLowering::ReduceUI32Shift(Node* node,
@@ -603,7 +616,7 @@ Reduction JSTypedLowering::ReduceUI32Shift(Node* node,
speculative_op =
simplified()->SpeculativeNumberShiftRightLogical(feedback);
} else {
- DCHECK(shift_op->opcode() == IrOpcode::kNumberShiftRight);
+ DCHECK_EQ(IrOpcode::kNumberShiftRight, shift_op->opcode());
speculative_op = simplified()->SpeculativeNumberShiftRight(feedback);
}
return r.ChangeToSpeculativeOperator(
« no previous file with comments | « no previous file | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698