Chromium Code Reviews| Index: src/arm/code-stubs-arm.cc |
| diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
| index 4cc5ef3475ef892c9ddb05a38f996241c6e668f4..4b49cf37cba839c647e561ef46e989e75bb6dffe 100644 |
| --- a/src/arm/code-stubs-arm.cc |
| +++ b/src/arm/code-stubs-arm.cc |
| @@ -830,14 +830,26 @@ void FloatingPointHelper::CallCCodeForDoubleOperation( |
| // Push the current return address before the C call. Return will be |
| // through pop(pc) below. |
| __ push(lr); |
| - __ PrepareCallCFunction(4, scratch); // Two doubles are 4 arguments. |
| + __ PrepareCallCFunction(0, 2, scratch); |
| + if (FLAG_hardfloat) { |
| + ASSERT(CpuFeatures::IsSupported(VFP3)); |
| + CpuFeatures::Scope scope(VFP3); |
| + __ vmov(d0, r0, r1); |
| + __ vmov(d1, r2, r3); |
| + } |
| // Call C routine that may not cause GC or other trouble. |
| __ CallCFunction(ExternalReference::double_fp_operation(op, masm->isolate()), |
|
Søren Thygesen Gjesse
2011/04/27 13:26:03
The number 4 passed here should be two values as i
Karl Klose
2011/04/27 14:27:56
Done.
|
| 4); |
| // Store answer in the overwritable heap number. Double returned in |
| - // registers r0 and r1. |
| - __ Strd(r0, r1, FieldMemOperand(heap_number_result, |
| - HeapNumber::kValueOffset)); |
| + // registers r0 and r1 or in d0. |
| + if (FLAG_hardfloat) { |
| + CpuFeatures::Scope scope(VFP3); |
| + __ vstr(d0, |
| + FieldMemOperand(heap_number_result, HeapNumber::kValueOffset)); |
| + } else { |
| + __ Strd(r0, r1, FieldMemOperand(heap_number_result, |
| + HeapNumber::kValueOffset)); |
| + } |
| // Place heap_number_result in r0 and return to the pushed return address. |
| __ mov(r0, Operand(heap_number_result)); |
| __ pop(pc); |
| @@ -1179,7 +1191,13 @@ static void EmitTwoNonNanDoubleComparison(MacroAssembler* masm, |
| // Call a native function to do a comparison between two non-NaNs. |
| // Call C routine that may not cause GC or other trouble. |
| __ push(lr); |
| - __ PrepareCallCFunction(4, r5); // Two doubles count as 4 arguments. |
| + __ PrepareCallCFunction(0, 2, r5); |
| + if (FLAG_hardfloat) { |
| + ASSERT(CpuFeatures::IsSupported(VFP3)); |
| + CpuFeatures::Scope scope(VFP3); |
| + __ vmov(d0, r0, r1); |
| + __ vmov(d1, r2, r3); |
| + } |
| __ CallCFunction(ExternalReference::compare_doubles(masm->isolate()), 4); |
| __ pop(pc); // Return. |
| } |
| @@ -2834,8 +2852,12 @@ void TranscendentalCacheStub::GenerateCallCFunction(MacroAssembler* masm, |
| Isolate* isolate = masm->isolate(); |
| __ push(lr); |
| - __ PrepareCallCFunction(2, scratch); |
| - __ vmov(r0, r1, d2); |
| + __ PrepareCallCFunction(0, 1, scratch); |
| + if (FLAG_hardfloat) { |
| + __ vmov(d0, d2); |
| + } else { |
| + __ vmov(r0, r1, d2); |
| + } |
| switch (type_) { |
| case TranscendentalCache::SIN: |
| __ CallCFunction(ExternalReference::math_sin_double_function(isolate), 2); |
| @@ -3061,9 +3083,8 @@ void MathPowStub::Generate(MacroAssembler* masm) { |
| heapnumbermap, |
| &call_runtime); |
| __ push(lr); |
| - __ PrepareCallCFunction(3, scratch); |
| - __ mov(r2, exponent); |
| - __ vmov(r0, r1, double_base); |
| + __ PrepareCallCFunction(1, 1, scratch); |
| + __ SetCallCDoubleArguments(double_base, exponent); |
| __ CallCFunction( |
| ExternalReference::power_double_int_function(masm->isolate()), 3); |
| __ pop(lr); |
| @@ -3091,9 +3112,8 @@ void MathPowStub::Generate(MacroAssembler* masm) { |
| heapnumbermap, |
| &call_runtime); |
| __ push(lr); |
| - __ PrepareCallCFunction(4, scratch); |
| - __ vmov(r0, r1, double_base); |
| - __ vmov(r2, r3, double_exponent); |
| + __ PrepareCallCFunction(0, 2, scratch); |
| + __ SetCallCDoubleArguments(double_base, double_exponent); |
| __ CallCFunction( |
| ExternalReference::power_double_double_function(masm->isolate()), 4); |
| __ pop(lr); |
| @@ -3139,7 +3159,7 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, |
| if (do_gc) { |
| // Passing r0. |
| - __ PrepareCallCFunction(1, r1); |
| + __ PrepareCallCFunction(1, 0, r1); |
| __ CallCFunction(ExternalReference::perform_gc_function(isolate), 1); |
| } |