Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index 12cc499a7777797695004ae49938228325fecdd5..e93a1e1097e9e522a09e9c4071dff134f05b54ec 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -779,18 +779,6 @@ void DoubleToIStub::Generate(MacroAssembler* masm) { |
} |
-// Uses SSE2 to convert the heap number in |source| to an integer. Jumps to |
-// |conversion_failure| if the heap number did not contain an int32 value. |
-// Result is in ecx. Trashes ebx, xmm0, and xmm1. |
-static void ConvertHeapNumberToInt32(MacroAssembler* masm, |
- Register source, |
- Label* conversion_failure) { |
- __ movdbl(xmm0, FieldOperand(source, HeapNumber::kValueOffset)); |
- FloatingPointHelper::CheckSSE2OperandIsInt32( |
- masm, conversion_failure, xmm0, ecx, ebx, xmm1); |
-} |
- |
- |
void BinaryOpStub::Initialize() { |
platform_specific_bit_ = CpuFeatures::IsSupported(SSE3); |
} |
@@ -2391,15 +2379,7 @@ void FloatingPointHelper::LoadUnknownsAsIntegers( |
__ cmp(ebx, factory->heap_number_map()); |
__ j(not_equal, &check_undefined_arg1); |
- // Get the untagged integer version of the edx heap number in ecx. |
- if (left_type == BinaryOpIC::INT32 && CpuFeatures::IsSupported(SSE2)) { |
- CpuFeatureScope use_sse2(masm, SSE2); |
- ConvertHeapNumberToInt32(masm, edx, conversion_failure); |
- } else { |
- DoubleToIStub stub(edx, ecx, HeapNumber::kValueOffset - kHeapObjectTag, |
- true); |
- __ call(stub.GetCode(masm->isolate()), RelocInfo::CODE_TARGET); |
- } |
+ __ TruncateHeapNumberToI(edx, ecx); |
__ mov(edx, ecx); |
// Here edx has the untagged integer, eax has a Smi or a heap number. |
@@ -2429,14 +2409,7 @@ void FloatingPointHelper::LoadUnknownsAsIntegers( |
__ j(not_equal, &check_undefined_arg2); |
// Get the untagged integer version of the eax heap number in ecx. |
- if (right_type == BinaryOpIC::INT32 && CpuFeatures::IsSupported(SSE2)) { |
- CpuFeatureScope use_sse2(masm, SSE2); |
- ConvertHeapNumberToInt32(masm, eax, conversion_failure); |
- } else { |
- DoubleToIStub stub(eax, ecx, HeapNumber::kValueOffset - kHeapObjectTag, |
- true); |
- __ call(stub.GetCode(masm->isolate()), RelocInfo::CODE_TARGET); |
- } |
+ __ TruncateHeapNumberToI(eax, ecx); |
__ bind(&done); |
__ mov(eax, edx); |
@@ -2691,15 +2664,9 @@ void MathPowStub::Generate(MacroAssembler* masm) { |
if (exponent_type_ != INTEGER) { |
Label fast_power; |
- // Detect integer exponents stored as double. |
- __ cvttsd2si(exponent, Operand(double_exponent)); |
- // Skip to runtime if possibly NaN (indicated by the indefinite integer). |
- __ cmp(exponent, Immediate(0x80000000u)); |
- __ j(equal, &call_runtime); |
- __ cvtsi2sd(double_scratch, exponent); |
- // Already ruled out NaNs for exponent. |
- __ ucomisd(double_exponent, double_scratch); |
- __ j(equal, &int_exponent); |
+ __ DoubleToI(double_exponent, exponent, double_scratch, |
+ true, &call_runtime); |
danno
2013/08/20 16:14:28
nit: odd indentation
oliv
2013/08/20 16:56:23
Done.
|
+ __ jmp(&int_exponent); |
if (exponent_type_ == ON_STACK) { |
// Detect square root case. Crankshaft detects constant +/-0.5 at |