| Index: src/a64/lithium-a64.cc
|
| diff --git a/src/a64/lithium-a64.cc b/src/a64/lithium-a64.cc
|
| index 1b82b33962deec3a4b7dae5ed5ed6d43df1e1dbb..b1ff84d926e1453d1c8f39a2d9c75d94473ad1ca 100644
|
| --- a/src/a64/lithium-a64.cc
|
| +++ b/src/a64/lithium-a64.cc
|
| @@ -2010,18 +2010,22 @@ LInstruction* LChunkBuilder::DoSeqStringSetChar(HSeqStringSetChar* instr) {
|
|
|
| LInstruction* LChunkBuilder::DoShift(Token::Value op,
|
| HBitwiseBinaryOperation* instr) {
|
| - // TODO(jbramley): Support smis inline, like integers.
|
| - if (instr->representation().IsSmiOrTagged()) {
|
| + if (instr->representation().IsTagged()) {
|
| return DoArithmeticT(op, instr);
|
| }
|
|
|
| - ASSERT(instr->representation().IsInteger32());
|
| + ASSERT(instr->representation().IsInteger32() ||
|
| + instr->representation().IsSmi());
|
| ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| ASSERT(instr->right()->representation().Equals(instr->representation()));
|
| - LOperand* left = UseRegisterAtStart(instr->left());
|
| +
|
| + LOperand* left = instr->representation().IsSmi()
|
| + ? UseRegister(instr->left())
|
| + : UseRegisterAtStart(instr->left());
|
|
|
| HValue* right_value = instr->right();
|
| LOperand* right = NULL;
|
| + LOperand* temp = NULL;
|
| int constant_value = 0;
|
| if (right_value->IsConstant()) {
|
| right = UseConstant(right_value);
|
| @@ -2029,6 +2033,9 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
|
| constant_value = constant->Integer32Value() & 0x1f;
|
| } else {
|
| right = UseRegisterAtStart(right_value);
|
| + if (op == Token::ROR) {
|
| + temp = TempRegister();
|
| + }
|
| }
|
|
|
| // Shift operations can only deoptimize if we do a logical shift by 0 and the
|
| @@ -2042,8 +2049,15 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
|
| }
|
| }
|
|
|
| - LInstruction* result =
|
| - DefineAsRegister(new(zone()) LShiftI(op, left, right, does_deopt));
|
| + LInstruction* result;
|
| + if (instr->representation().IsInteger32()) {
|
| + result = DefineAsRegister(new(zone()) LShiftI(op, left, right, does_deopt));
|
| + } else {
|
| + ASSERT(instr->representation().IsSmi());
|
| + result = DefineAsRegister(
|
| + new(zone()) LShiftS(op, left, right, temp, does_deopt));
|
| + }
|
| +
|
| return does_deopt ? AssignEnvironment(result) : result;
|
| }
|
|
|
|
|