ASSERT(ToDoubleRegister(instr->left()).is(f2));
ASSERT(ToDoubleRegister(instr->result()).is(f0));
- if (exponent_type.IsTagged()) {
+ if (exponent_type.IsSmi()) {
+ MathPowStub stub(MathPowStub::TAGGED);
+ __ CallStub(&stub);
+ } else if (exponent_type.IsTagged()) {
Label no_deopt;
__ JumpIfSmi(a2, &no_deopt);
__ lw(t3, FieldMemOperand(a2, HeapObject::kMapOffset));
__ And(scratch, input, Operand(kHeapObjectTag));
__ SmiUntag(result, input);
DeoptimizeIf(ne, instr->environment(), scratch, Operand(zero_reg));
- } else if (instr->hydrogen()->value()->IsLoadKeyed()) {
- HLoadKeyed* load = HLoadKeyed::cast(instr->hydrogen()->value());
- if (load->UsesMustHandleHole()) {
- __ And(scratch, input, Operand(kHeapObjectTag));
- __ SmiUntag(result, input);
- if (load->hole_mode() == ALLOW_RETURN_HOLE) {
- Label done;
- __ Branch(&done, eq, scratch, Operand(zero_reg));
- __ li(result, Operand(Smi::FromInt(0)));
- __ bind(&done);
- } else {
- DeoptimizeIf(ne, instr->environment(), scratch, Operand(zero_reg));
- }
- } else {
- __ SmiUntag(result, input);
- }
} else {
__ SmiUntag(result, input);
}
LInstruction* LChunkBuilder::DoShift(Token::Value op,
HBitwiseBinaryOperation* instr) {
- if (instr->representation().IsTagged()) {
- ASSERT(instr->left()->representation().IsTagged());
- ASSERT(instr->right()->representation().IsTagged());
+ if (instr->representation().IsSmiOrTagged()) {
+ ASSERT(instr->left()->representation().IsSmiOrTagged());
+ ASSERT(instr->right()->representation().IsSmiOrTagged());
LOperand* left = UseFixed(instr->left(), a1);
LOperand* right = UseFixed(instr->right(), a0);
op == Token::SUB);
HValue* left = instr->left();
HValue* right = instr->right();
- ASSERT(left->representation().IsTagged());
- ASSERT(right->representation().IsTagged());
+ ASSERT(left->representation().IsSmiOrTagged());
+ ASSERT(right->representation().IsSmiOrTagged());
LOperand* left_operand = UseFixed(left, a1);
LOperand* right_operand = UseFixed(right, a0);
LArithmeticT* result =
LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand());
return DefineAsRegister(new(zone()) LBitI(left, right));
} else {
- ASSERT(instr->representation().IsTagged());
- ASSERT(instr->left()->representation().IsTagged());
- ASSERT(instr->right()->representation().IsTagged());
+ ASSERT(instr->representation().IsSmiOrTagged());
+ ASSERT(instr->left()->representation().IsSmiOrTagged());
+ ASSERT(instr->right()->representation().IsSmiOrTagged());
LOperand* left = UseFixed(instr->left(), a1);
LOperand* right = UseFixed(instr->right(), a0);
} else {
return DefineAsRegister(mod);
}
- } else if (instr->representation().IsTagged()) {
+ } else if (instr->representation().IsSmiOrTagged()) {
return DoArithmeticT(Token::MOD, instr);
} else {
ASSERT(instr->representation().IsDouble());
}
return DoArithmeticD(Token::ADD, instr);
} else {
- ASSERT(instr->representation().IsTagged());
+ ASSERT(instr->representation().IsSmiOrTagged());
return DoArithmeticT(Token::ADD, instr);
}
}
if (from.IsSmi()) {
if (to.IsTagged()) {
LOperand* value = UseRegister(instr->value());
- // For now, always deopt on hole.
- if (instr->value()->IsLoadKeyed() &&
- HLoadKeyed::cast(instr->value())->UsesMustHandleHole()) {
- return AssignEnvironment(
- DefineSameAsFirst(new(zone()) LCheckSmiAndReturn(value)));
- }
return DefineSameAsFirst(new(zone()) LDummyUse(value));
}
from = Representation::Tagged();
if (instr->value()->type().IsSmi()) {
value = UseRegisterAtStart(instr->value());
res = DefineAsRegister(new(zone()) LSmiUntag(value, false));
- if (instr->value()->IsLoadKeyed()) {
- HLoadKeyed* load_keyed = HLoadKeyed::cast(instr->value());
- if (load_keyed->UsesMustHandleHole() &&
- load_keyed->hole_mode() == NEVER_RETURN_HOLE) {
- res = AssignEnvironment(res);
- }
- }
} else {
value = UseRegister(instr->value());
LOperand* temp1 = TempRegister();