| Index: src/compiler/simplified-lowering.cc
|
| diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
|
| index c2c7457f3e5fd82438aedfd36fa62e516169dfdd..c75ea3d3069f0ed51317f2fa2bc0801ffef32a65 100644
|
| --- a/src/compiler/simplified-lowering.cc
|
| +++ b/src/compiler/simplified-lowering.cc
|
| @@ -1046,21 +1046,30 @@ class RepresentationSelector {
|
| break;
|
| }
|
| case IrOpcode::kNumberShiftLeft: {
|
| + Type* rhs_type = GetInfo(node->InputAt(1))->output_type();
|
| VisitBinop(node, UseInfo::TruncatingWord32(),
|
| UseInfo::TruncatingWord32(), NodeOutputInfo::Int32());
|
| - if (lower()) lowering->DoShift(node, lowering->machine()->Word32Shl());
|
| + if (lower()) {
|
| + lowering->DoShift(node, lowering->machine()->Word32Shl(), rhs_type);
|
| + }
|
| break;
|
| }
|
| case IrOpcode::kNumberShiftRight: {
|
| + Type* rhs_type = GetInfo(node->InputAt(1))->output_type();
|
| VisitBinop(node, UseInfo::TruncatingWord32(),
|
| UseInfo::TruncatingWord32(), NodeOutputInfo::Int32());
|
| - if (lower()) lowering->DoShift(node, lowering->machine()->Word32Sar());
|
| + if (lower()) {
|
| + lowering->DoShift(node, lowering->machine()->Word32Sar(), rhs_type);
|
| + }
|
| break;
|
| }
|
| case IrOpcode::kNumberShiftRightLogical: {
|
| + Type* rhs_type = GetInfo(node->InputAt(1))->output_type();
|
| VisitBinop(node, UseInfo::TruncatingWord32(),
|
| UseInfo::TruncatingWord32(), NodeOutputInfo::Uint32());
|
| - if (lower()) lowering->DoShift(node, lowering->machine()->Word32Shr());
|
| + if (lower()) {
|
| + lowering->DoShift(node, lowering->machine()->Word32Shr(), rhs_type);
|
| + }
|
| break;
|
| }
|
| case IrOpcode::kNumberToInt32: {
|
| @@ -1406,7 +1415,7 @@ class RepresentationSelector {
|
| replacement->op()->mnemonic());
|
|
|
| if (replacement->id() < count_ &&
|
| - GetInfo(replacement)->output_type() == GetInfo(node)->output_type()) {
|
| + GetInfo(node)->output_type()->Is(GetInfo(replacement)->output_type())) {
|
| // Replace with a previously existing node eagerly only if the type is the
|
| // same.
|
| node->ReplaceUses(replacement);
|
| @@ -1868,9 +1877,9 @@ Node* SimplifiedLowering::Uint32Mod(Node* const node) {
|
| }
|
|
|
|
|
| -void SimplifiedLowering::DoShift(Node* node, Operator const* op) {
|
| +void SimplifiedLowering::DoShift(Node* node, Operator const* op,
|
| + Type* rhs_type) {
|
| Node* const rhs = NodeProperties::GetValueInput(node, 1);
|
| - Type* const rhs_type = NodeProperties::GetType(rhs);
|
| if (!rhs_type->Is(type_cache_.kZeroToThirtyOne)) {
|
| node->ReplaceInput(1, graph()->NewNode(machine()->Word32And(), rhs,
|
| jsgraph()->Int32Constant(0x1f)));
|
|
|