| Index: src/arm/lithium-codegen-arm.cc
|
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
|
| index 9ec80f819a062dbf3078fc4a0487b765177a19cb..fae13db112b3d63081cc9e1817f75250676a47e8 100644
|
| --- a/src/arm/lithium-codegen-arm.cc
|
| +++ b/src/arm/lithium-codegen-arm.cc
|
| @@ -4901,7 +4901,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
| Register scratch1 = scratch0();
|
| Register scratch2 = ToRegister(instr->temp());
|
| LowDwVfpRegister double_scratch = double_scratch0();
|
| - DwVfpRegister double_scratch2 = ToDoubleRegister(instr->temp3());
|
| + DwVfpRegister double_scratch2 = ToDoubleRegister(instr->temp2());
|
|
|
| ASSERT(!scratch1.is(input_reg) && !scratch1.is(scratch2));
|
| ASSERT(!scratch2.is(input_reg) && !scratch2.is(scratch1));
|
| @@ -4912,18 +4912,14 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
| // The carry flag is set when we reach this deferred code as we just executed
|
| // SmiUntag(heap_object, SetCC)
|
| STATIC_ASSERT(kHeapObjectTag == 1);
|
| - __ adc(input_reg, input_reg, Operand(input_reg));
|
| + __ adc(scratch2, input_reg, Operand(input_reg));
|
|
|
| // Heap number map check.
|
| - __ ldr(scratch1, FieldMemOperand(input_reg, HeapObject::kMapOffset));
|
| + __ ldr(scratch1, FieldMemOperand(scratch2, HeapObject::kMapOffset));
|
| __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
|
| __ cmp(scratch1, Operand(ip));
|
|
|
| if (instr->truncating()) {
|
| - Register scratch3 = ToRegister(instr->temp2());
|
| - ASSERT(!scratch3.is(input_reg) &&
|
| - !scratch3.is(scratch1) &&
|
| - !scratch3.is(scratch2));
|
| // Performs a truncating conversion of a floating point number as used by
|
| // the JS bitwise operations.
|
| Label heap_number;
|
| @@ -4931,23 +4927,19 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
| // Check for undefined. Undefined is converted to zero for truncating
|
| // conversions.
|
| __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
|
| - __ cmp(input_reg, Operand(ip));
|
| + __ cmp(scratch2, Operand(ip));
|
| DeoptimizeIf(ne, instr->environment());
|
| __ mov(input_reg, Operand::Zero());
|
| __ b(&done);
|
|
|
| __ bind(&heap_number);
|
| - __ sub(scratch1, input_reg, Operand(kHeapObjectTag));
|
| - __ vldr(double_scratch2, scratch1, HeapNumber::kValueOffset);
|
| -
|
| - __ ECMAToInt32(input_reg, double_scratch2,
|
| - scratch1, scratch2, scratch3, double_scratch);
|
| -
|
| + __ TruncateDoubleToI(input_reg, scratch2,
|
| + HeapNumber::kValueOffset - kHeapObjectTag);
|
| } else {
|
| // Deoptimize if we don't have a heap number.
|
| DeoptimizeIf(ne, instr->environment());
|
|
|
| - __ sub(ip, input_reg, Operand(kHeapObjectTag));
|
| + __ sub(ip, scratch2, Operand(kHeapObjectTag));
|
| __ vldr(double_scratch2, ip, HeapNumber::kValueOffset);
|
| __ TryDoubleToInt32Exact(input_reg, double_scratch2, double_scratch);
|
| DeoptimizeIf(ne, instr->environment());
|
| @@ -5017,14 +5009,11 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
|
| void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
|
| Register result_reg = ToRegister(instr->result());
|
| Register scratch1 = scratch0();
|
| - Register scratch2 = ToRegister(instr->temp());
|
| DwVfpRegister double_input = ToDoubleRegister(instr->value());
|
| LowDwVfpRegister double_scratch = double_scratch0();
|
|
|
| if (instr->truncating()) {
|
| - Register scratch3 = ToRegister(instr->temp2());
|
| - __ ECMAToInt32(result_reg, double_input,
|
| - scratch1, scratch2, scratch3, double_scratch);
|
| + __ TruncateDoubleToI(result_reg, double_input);
|
| } else {
|
| __ TryDoubleToInt32Exact(result_reg, double_input, double_scratch);
|
| // Deoptimize if the input wasn't a int32 (inside a double).
|
| @@ -5045,14 +5034,11 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
|
| void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
|
| Register result_reg = ToRegister(instr->result());
|
| Register scratch1 = scratch0();
|
| - Register scratch2 = ToRegister(instr->temp());
|
| DwVfpRegister double_input = ToDoubleRegister(instr->value());
|
| LowDwVfpRegister double_scratch = double_scratch0();
|
|
|
| if (instr->truncating()) {
|
| - Register scratch3 = ToRegister(instr->temp2());
|
| - __ ECMAToInt32(result_reg, double_input,
|
| - scratch1, scratch2, scratch3, double_scratch);
|
| + __ TruncateDoubleToI(result_reg, double_input);
|
| } else {
|
| __ TryDoubleToInt32Exact(result_reg, double_input, double_scratch);
|
| // Deoptimize if the input wasn't a int32 (inside a double).
|
|
|