| Index: src/arm/lithium-arm.cc
|
| diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
|
| index 309f96addb8cf528733535c1567062484dc9b8f4..5260c12411eafe852e581e6376d6a55c96a6640d 100644
|
| --- a/src/arm/lithium-arm.cc
|
| +++ b/src/arm/lithium-arm.cc
|
| @@ -653,6 +653,19 @@ LUnallocated* LChunkBuilder::TempRegister() {
|
| }
|
|
|
|
|
| +LUnallocated* LChunkBuilder::TempDoubleRegister() {
|
| + LUnallocated* operand =
|
| + new(zone()) LUnallocated(LUnallocated::TEMP_DOUBLE_REGISTER);
|
| + int vreg = allocator_->GetVirtualRegister();
|
| + if (!allocator_->AllocationOk()) {
|
| + Abort("Out of virtual registers while trying to allocate temp register.");
|
| + vreg = 0;
|
| + }
|
| + operand->set_virtual_register(vreg);
|
| + return operand;
|
| +}
|
| +
|
| +
|
| LOperand* LChunkBuilder::FixedTemp(Register reg) {
|
| LUnallocated* operand = ToUnallocated(reg);
|
| ASSERT(operand->HasFixedPolicy());
|
| @@ -1155,7 +1168,7 @@ LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) {
|
|
|
| LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) {
|
| LOperand* input = UseRegister(instr->value());
|
| - LOperand* temp = FixedTemp(d3);
|
| + LOperand* temp = TempDoubleRegister();
|
| LMathRound* result = new(zone()) LMathRound(input, temp);
|
| return AssignEnvironment(DefineAsRegister(result));
|
| }
|
| @@ -1202,7 +1215,7 @@ LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
|
| LOperand* input = UseTempRegister(instr->value());
|
| LOperand* temp1 = TempRegister();
|
| LOperand* temp2 = TempRegister();
|
| - LOperand* double_temp = FixedTemp(d3); // Chosen by fair dice roll.
|
| + LOperand* double_temp = TempDoubleRegister();
|
| LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2);
|
| return DefineAsRegister(result);
|
| }
|
| @@ -1217,7 +1230,7 @@ LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) {
|
|
|
| LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) {
|
| LOperand* input = UseFixedDouble(instr->value(), d2);
|
| - LOperand* temp = FixedTemp(d3);
|
| + LOperand* temp = TempDoubleRegister();
|
| LMathPowHalf* result = new(zone()) LMathPowHalf(input, temp);
|
| return DefineFixedDouble(result, d2);
|
| }
|
| @@ -1342,7 +1355,8 @@ LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
|
| }
|
| LOperand* dividend = UseRegister(instr->left());
|
| LOperand* divisor = UseRegister(instr->right());
|
| - LOperand* temp = CpuFeatures::IsSupported(SUDIV) ? NULL : FixedTemp(d4);
|
| + LOperand* temp =
|
| + CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister();
|
| LDivI* div = new(zone()) LDivI(dividend, divisor, temp);
|
| return AssignEnvironment(DefineAsRegister(div));
|
| } else {
|
| @@ -1455,8 +1469,8 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) {
|
| } else {
|
| LModI* mod = new(zone()) LModI(UseRegister(left),
|
| UseRegister(right),
|
| - FixedTemp(d10),
|
| - FixedTemp(d11));
|
| + TempDoubleRegister(),
|
| + TempDoubleRegister());
|
| LInstruction* result = DefineAsRegister(mod);
|
| return (right->CanBeZero() ||
|
| (left->CanBeNegative() &&
|
| @@ -1918,7 +1932,7 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
|
| LOperand* temp1 = TempRegister();
|
| LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister()
|
| : NULL;
|
| - LOperand* temp3 = FixedTemp(d11);
|
| + LOperand* temp3 = TempDoubleRegister();
|
| res = DefineSameAsFirst(new(zone()) LTaggedToI(value,
|
| temp1,
|
| temp2,
|
| @@ -2042,14 +2056,14 @@ LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) {
|
| Representation input_rep = value->representation();
|
| LOperand* reg = UseRegister(value);
|
| if (input_rep.IsDouble()) {
|
| - return DefineAsRegister(new(zone()) LClampDToUint8(reg, FixedTemp(d11)));
|
| + return DefineAsRegister(
|
| + new(zone()) LClampDToUint8(reg, TempDoubleRegister()));
|
| } else if (input_rep.IsInteger32()) {
|
| return DefineAsRegister(new(zone()) LClampIToUint8(reg));
|
| } else {
|
| ASSERT(input_rep.IsSmiOrTagged());
|
| - // Register allocator doesn't (yet) support allocation of double
|
| - // temps. Reserve d1 explicitly.
|
| - LClampTToUint8* result = new(zone()) LClampTToUint8(reg, FixedTemp(d11));
|
| + LClampTToUint8* result =
|
| + new(zone()) LClampTToUint8(reg, TempDoubleRegister());
|
| return AssignEnvironment(DefineAsRegister(result));
|
| }
|
| }
|
|
|