Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 7d7b51d116aa834eea4c871ec465f57c1bcc0d34..d50b780d71e4c6b2f6d379a2346d4286bfddc6d8 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -3977,7 +3977,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) { |
__ bind(&negative_sign); |
// Truncate, then compare and compensate. |
__ cvttsd2si(output_reg, Operand(input_reg)); |
- __ Cvtsi2sd(xmm_scratch, output_reg); |
+ __ cvtsi2sd(xmm_scratch, output_reg); |
__ ucomisd(input_reg, xmm_scratch); |
__ j(equal, &done, Label::kNear); |
__ sub(output_reg, Immediate(1)); |
@@ -4027,7 +4027,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) { |
__ RecordComment("D2I conversion overflow"); |
DeoptimizeIf(equal, instr->environment()); |
- __ Cvtsi2sd(xmm_scratch, output_reg); |
+ __ cvtsi2sd(xmm_scratch, output_reg); |
__ ucomisd(xmm_scratch, input_temp); |
__ j(equal, &done); |
__ sub(output_reg, Immediate(1)); |
@@ -4978,7 +4978,7 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
ASSERT(output->IsDoubleRegister()); |
if (CpuFeatures::IsSupported(SSE2)) { |
CpuFeatureScope scope(masm(), SSE2); |
- __ Cvtsi2sd(ToDoubleRegister(output), ToOperand(input)); |
+ __ cvtsi2sd(ToDoubleRegister(output), ToOperand(input)); |
} else if (input->IsRegister()) { |
Register input_reg = ToRegister(input); |
__ push(input_reg); |
@@ -5087,7 +5087,7 @@ void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, |
__ xor_(reg, 0x80000000); |
if (CpuFeatures::IsSupported(SSE2)) { |
CpuFeatureScope feature_scope(masm(), SSE2); |
- __ Cvtsi2sd(xmm0, Operand(reg)); |
+ __ cvtsi2sd(xmm0, Operand(reg)); |
} else { |
__ push(reg); |
__ fild_s(Operand(esp, 0)); |
@@ -5308,7 +5308,7 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, |
bool deoptimize_on_minus_zero, |
LEnvironment* env, |
NumberUntagDMode mode) { |
- Label convert, load_smi, done; |
+ Label load_smi, done; |
if (mode == NUMBER_CANDIDATE_IS_ANY_TAGGED) { |
// Smi check. |
@@ -5317,15 +5317,26 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, |
// Heap number map check. |
__ cmp(FieldOperand(input_reg, HeapObject::kMapOffset), |
factory()->heap_number_map()); |
- if (can_convert_undefined_to_nan) { |
- __ j(not_equal, &convert, Label::kNear); |
+ if (!can_convert_undefined_to_nan) { |
+ DeoptimizeIf(not_equal, env); |
} else { |
+ Label heap_number, convert; |
+ __ j(equal, &heap_number, Label::kNear); |
+ |
+ // Convert undefined (and hole) to NaN. |
+ __ cmp(input_reg, factory()->undefined_value()); |
DeoptimizeIf(not_equal, env); |
- } |
+ __ bind(&convert); |
+ ExternalReference nan = |
+ ExternalReference::address_of_canonical_non_hole_nan(); |
+ __ movdbl(result_reg, Operand::StaticVariable(nan)); |
+ __ jmp(&done, Label::kNear); |
+ |
+ __ bind(&heap_number); |
+ } |
// Heap number to XMM conversion. |
__ movdbl(result_reg, FieldOperand(input_reg, HeapNumber::kValueOffset)); |
- |
if (deoptimize_on_minus_zero) { |
XMMRegister xmm_scratch = xmm0; |
__ xorps(xmm_scratch, xmm_scratch); |
@@ -5336,19 +5347,6 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, |
DeoptimizeIf(not_zero, env); |
} |
__ jmp(&done, Label::kNear); |
- |
- if (can_convert_undefined_to_nan) { |
- __ bind(&convert); |
- |
- // Convert undefined (and hole) to NaN. |
- __ cmp(input_reg, factory()->undefined_value()); |
- DeoptimizeIf(not_equal, env); |
- |
- ExternalReference nan = |
- ExternalReference::address_of_canonical_non_hole_nan(); |
- __ movdbl(result_reg, Operand::StaticVariable(nan)); |
- __ jmp(&done, Label::kNear); |
- } |
} else { |
ASSERT(mode == NUMBER_CANDIDATE_IS_SMI); |
} |
@@ -5358,7 +5356,7 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, |
// input register since we avoid dependencies. |
__ mov(temp_reg, input_reg); |
__ SmiUntag(temp_reg); // Untag smi before converting to float. |
- __ Cvtsi2sd(result_reg, Operand(temp_reg)); |
+ __ cvtsi2sd(result_reg, Operand(temp_reg)); |
__ bind(&done); |
} |