Commit dc505196 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Remove eager frame state from shift operations.

This removes the frame state input representing the before-state from
nodes having any shift operator. Any lowering that woult insert number
conversions of the inputs has already been disabled when deoptimization
is enabled, because the frame state layout is no longer known.

R=epertoso@chromium.org
BUG=v8:5021

Review-Url: https://codereview.chromium.org/2190743003
Cr-Commit-Position: refs/heads/master@{#38194}
parent f02018ce
......@@ -593,7 +593,6 @@ Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) {
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) {
......
......@@ -42,6 +42,11 @@ int OperatorProperties::GetFrameStateInputCount(const Operator* op) {
case IrOpcode::kJSDivide:
case IrOpcode::kJSModulus:
// Shift operations
case IrOpcode::kJSShiftLeft:
case IrOpcode::kJSShiftRight:
case IrOpcode::kJSShiftRightLogical:
// Compare operations
case IrOpcode::kJSEqual:
case IrOpcode::kJSNotEqual:
......@@ -97,9 +102,6 @@ int OperatorProperties::GetFrameStateInputCount(const Operator* op) {
case IrOpcode::kJSBitwiseAnd:
case IrOpcode::kJSBitwiseOr:
case IrOpcode::kJSBitwiseXor:
case IrOpcode::kJSShiftLeft:
case IrOpcode::kJSShiftRight:
case IrOpcode::kJSShiftRightLogical:
return 2;
default:
......
......@@ -424,9 +424,9 @@ TEST_F(JSTypedLoweringTest, JSShiftLeftWithSigned32AndConstant) {
Node* const effect = graph()->start();
Node* const control = graph()->start();
TRACED_FORRANGE(double, rhs, 0, 31) {
Reduction r = Reduce(graph()->NewNode(
javascript()->ShiftLeft(hints), lhs, NumberConstant(rhs), context,
EmptyFrameState(), EmptyFrameState(), effect, control));
Reduction r = Reduce(graph()->NewNode(javascript()->ShiftLeft(hints), lhs,
NumberConstant(rhs), context,
EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsNumberShiftLeft(lhs, IsNumberConstant(BitEq(rhs))));
......@@ -441,9 +441,9 @@ TEST_F(JSTypedLoweringTest, JSShiftLeftWithSigned32AndUnsigned32) {
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Node* const control = graph()->start();
Reduction r = Reduce(graph()->NewNode(javascript()->ShiftLeft(hints), lhs,
rhs, context, EmptyFrameState(),
EmptyFrameState(), effect, control));
Reduction r =
Reduce(graph()->NewNode(javascript()->ShiftLeft(hints), lhs, rhs, context,
EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsNumberShiftLeft(lhs, rhs));
}
......@@ -458,9 +458,9 @@ TEST_F(JSTypedLoweringTest, JSShiftLeftWithTypeFeedback) {
Node* rhs = Parameter(Type::Number(), 3);
Node* effect = graph()->start();
Node* control = graph()->start();
Reduction r = Reduce(graph()->NewNode(
javascript()->ShiftLeft(hints), lhs, rhs, UndefinedConstant(),
EmptyFrameState(), EmptyFrameState(), effect, control));
Reduction r = Reduce(graph()->NewNode(javascript()->ShiftLeft(hints), lhs,
rhs, UndefinedConstant(),
EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsSpeculativeNumberShiftLeft(
feedback, lhs, rhs, effect, control));
......@@ -478,9 +478,9 @@ TEST_F(JSTypedLoweringTest, JSShiftRightWithSigned32AndConstant) {
Node* const effect = graph()->start();
Node* const control = graph()->start();
TRACED_FORRANGE(double, rhs, 0, 31) {
Reduction r = Reduce(graph()->NewNode(
javascript()->ShiftRight(hints), lhs, NumberConstant(rhs), context,
EmptyFrameState(), EmptyFrameState(), effect, control));
Reduction r = Reduce(graph()->NewNode(javascript()->ShiftRight(hints), lhs,
NumberConstant(rhs), context,
EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsNumberShiftRight(lhs, IsNumberConstant(BitEq(rhs))));
......@@ -495,9 +495,9 @@ TEST_F(JSTypedLoweringTest, JSShiftRightWithSigned32AndUnsigned32) {
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Node* const control = graph()->start();
Reduction r = Reduce(graph()->NewNode(javascript()->ShiftRight(hints), lhs,
rhs, context, EmptyFrameState(),
EmptyFrameState(), effect, control));
Reduction r =
Reduce(graph()->NewNode(javascript()->ShiftRight(hints), lhs, rhs,
context, EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsNumberShiftRight(lhs, rhs));
}
......@@ -512,9 +512,9 @@ TEST_F(JSTypedLoweringTest, JSShiftRightWithTypeFeedback) {
Node* rhs = Parameter(Type::Number(), 3);
Node* effect = graph()->start();
Node* control = graph()->start();
Reduction r = Reduce(graph()->NewNode(
javascript()->ShiftRight(hints), lhs, rhs, UndefinedConstant(),
EmptyFrameState(), EmptyFrameState(), effect, control));
Reduction r = Reduce(graph()->NewNode(javascript()->ShiftRight(hints), lhs,
rhs, UndefinedConstant(),
EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsSpeculativeNumberShiftRight(
feedback, lhs, rhs, effect, control));
......@@ -535,7 +535,7 @@ TEST_F(JSTypedLoweringTest,
TRACED_FORRANGE(double, rhs, 0, 31) {
Reduction r = Reduce(graph()->NewNode(
javascript()->ShiftRightLogical(hints), lhs, NumberConstant(rhs),
context, EmptyFrameState(), EmptyFrameState(), effect, control));
context, EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsNumberShiftRightLogical(lhs, IsNumberConstant(BitEq(rhs))));
......@@ -550,9 +550,9 @@ TEST_F(JSTypedLoweringTest, JSShiftRightLogicalWithUnsigned32AndUnsigned32) {
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Node* const control = graph()->start();
Reduction r = Reduce(graph()->NewNode(javascript()->ShiftRightLogical(hints),
lhs, rhs, context, EmptyFrameState(),
EmptyFrameState(), effect, control));
Reduction r =
Reduce(graph()->NewNode(javascript()->ShiftRightLogical(hints), lhs, rhs,
context, EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsNumberShiftRightLogical(lhs, rhs));
}
......@@ -569,7 +569,7 @@ TEST_F(JSTypedLoweringTest, JSShiftRightLogicalWithTypeFeedback) {
Node* control = graph()->start();
Reduction r = Reduce(graph()->NewNode(
javascript()->ShiftRightLogical(hints), lhs, rhs, UndefinedConstant(),
EmptyFrameState(), EmptyFrameState(), effect, control));
EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsSpeculativeNumberShiftRightLogical(
feedback, lhs, rhs, effect, control));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment