| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 // r3: Right value (sign, exponent, top of mantissa). | 824 // r3: Right value (sign, exponent, top of mantissa). |
| 825 | 825 |
| 826 // Assert that heap_number_result is callee-saved. | 826 // Assert that heap_number_result is callee-saved. |
| 827 // We currently always use r5 to pass it. | 827 // We currently always use r5 to pass it. |
| 828 ASSERT(heap_number_result.is(r5)); | 828 ASSERT(heap_number_result.is(r5)); |
| 829 | 829 |
| 830 // Push the current return address before the C call. Return will be | 830 // Push the current return address before the C call. Return will be |
| 831 // through pop(pc) below. | 831 // through pop(pc) below. |
| 832 __ push(lr); | 832 __ push(lr); |
| 833 __ PrepareCallCFunction(0, 2, scratch); | 833 __ PrepareCallCFunction(0, 2, scratch); |
| 834 if (FLAG_hardfloat) { | 834 if (masm->use_eabi_hardfloat()) { |
| 835 ASSERT(CpuFeatures::IsSupported(VFP3)); | |
| 836 CpuFeatures::Scope scope(VFP3); | 835 CpuFeatures::Scope scope(VFP3); |
| 837 __ vmov(d0, r0, r1); | 836 __ vmov(d0, r0, r1); |
| 838 __ vmov(d1, r2, r3); | 837 __ vmov(d1, r2, r3); |
| 839 } | 838 } |
| 840 // Call C routine that may not cause GC or other trouble. | 839 // Call C routine that may not cause GC or other trouble. |
| 841 __ CallCFunction(ExternalReference::double_fp_operation(op, masm->isolate()), | 840 __ CallCFunction(ExternalReference::double_fp_operation(op, masm->isolate()), |
| 842 0, 2); | 841 0, 2); |
| 843 // Store answer in the overwritable heap number. Double returned in | 842 // Store answer in the overwritable heap number. Double returned in |
| 844 // registers r0 and r1 or in d0. | 843 // registers r0 and r1 or in d0. |
| 845 if (FLAG_hardfloat) { | 844 if (masm->use_eabi_hardfloat()) { |
| 846 CpuFeatures::Scope scope(VFP3); | 845 CpuFeatures::Scope scope(VFP3); |
| 847 __ vstr(d0, | 846 __ vstr(d0, |
| 848 FieldMemOperand(heap_number_result, HeapNumber::kValueOffset)); | 847 FieldMemOperand(heap_number_result, HeapNumber::kValueOffset)); |
| 849 } else { | 848 } else { |
| 850 __ Strd(r0, r1, FieldMemOperand(heap_number_result, | 849 __ Strd(r0, r1, FieldMemOperand(heap_number_result, |
| 851 HeapNumber::kValueOffset)); | 850 HeapNumber::kValueOffset)); |
| 852 } | 851 } |
| 853 // Place heap_number_result in r0 and return to the pushed return address. | 852 // Place heap_number_result in r0 and return to the pushed return address. |
| 854 __ mov(r0, Operand(heap_number_result)); | 853 __ mov(r0, Operand(heap_number_result)); |
| 855 __ pop(pc); | 854 __ pop(pc); |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 __ Ret(ne); | 1184 __ Ret(ne); |
| 1186 // Now they are equal if and only if the lhs exponent is zero in its | 1185 // Now they are equal if and only if the lhs exponent is zero in its |
| 1187 // low 31 bits. | 1186 // low 31 bits. |
| 1188 __ mov(r0, Operand(rhs_exponent, LSL, kSmiTagSize)); | 1187 __ mov(r0, Operand(rhs_exponent, LSL, kSmiTagSize)); |
| 1189 __ Ret(); | 1188 __ Ret(); |
| 1190 } else { | 1189 } else { |
| 1191 // Call a native function to do a comparison between two non-NaNs. | 1190 // Call a native function to do a comparison between two non-NaNs. |
| 1192 // Call C routine that may not cause GC or other trouble. | 1191 // Call C routine that may not cause GC or other trouble. |
| 1193 __ push(lr); | 1192 __ push(lr); |
| 1194 __ PrepareCallCFunction(0, 2, r5); | 1193 __ PrepareCallCFunction(0, 2, r5); |
| 1195 if (FLAG_hardfloat) { | 1194 if (masm->use_eabi_hardfloat()) { |
| 1196 ASSERT(CpuFeatures::IsSupported(VFP3)); | |
| 1197 CpuFeatures::Scope scope(VFP3); | 1195 CpuFeatures::Scope scope(VFP3); |
| 1198 __ vmov(d0, r0, r1); | 1196 __ vmov(d0, r0, r1); |
| 1199 __ vmov(d1, r2, r3); | 1197 __ vmov(d1, r2, r3); |
| 1200 } | 1198 } |
| 1201 __ CallCFunction(ExternalReference::compare_doubles(masm->isolate()), | 1199 __ CallCFunction(ExternalReference::compare_doubles(masm->isolate()), |
| 1202 0, 2); | 1200 0, 2); |
| 1203 __ pop(pc); // Return. | 1201 __ pop(pc); // Return. |
| 1204 } | 1202 } |
| 1205 } | 1203 } |
| 1206 | 1204 |
| (...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2847 } | 2845 } |
| 2848 } | 2846 } |
| 2849 | 2847 |
| 2850 | 2848 |
| 2851 void TranscendentalCacheStub::GenerateCallCFunction(MacroAssembler* masm, | 2849 void TranscendentalCacheStub::GenerateCallCFunction(MacroAssembler* masm, |
| 2852 Register scratch) { | 2850 Register scratch) { |
| 2853 Isolate* isolate = masm->isolate(); | 2851 Isolate* isolate = masm->isolate(); |
| 2854 | 2852 |
| 2855 __ push(lr); | 2853 __ push(lr); |
| 2856 __ PrepareCallCFunction(0, 1, scratch); | 2854 __ PrepareCallCFunction(0, 1, scratch); |
| 2857 if (FLAG_hardfloat) { | 2855 if (masm->use_eabi_hardfloat()) { |
| 2858 __ vmov(d0, d2); | 2856 __ vmov(d0, d2); |
| 2859 } else { | 2857 } else { |
| 2860 __ vmov(r0, r1, d2); | 2858 __ vmov(r0, r1, d2); |
| 2861 } | 2859 } |
| 2862 switch (type_) { | 2860 switch (type_) { |
| 2863 case TranscendentalCache::SIN: | 2861 case TranscendentalCache::SIN: |
| 2864 __ CallCFunction(ExternalReference::math_sin_double_function(isolate), | 2862 __ CallCFunction(ExternalReference::math_sin_double_function(isolate), |
| 2865 0, 1); | 2863 0, 1); |
| 2866 break; | 2864 break; |
| 2867 case TranscendentalCache::COS: | 2865 case TranscendentalCache::COS: |
| (...skipping 2936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5804 __ str(pc, MemOperand(sp, 0)); | 5802 __ str(pc, MemOperand(sp, 0)); |
| 5805 __ Jump(target); // Call the C++ function. | 5803 __ Jump(target); // Call the C++ function. |
| 5806 } | 5804 } |
| 5807 | 5805 |
| 5808 | 5806 |
| 5809 #undef __ | 5807 #undef __ |
| 5810 | 5808 |
| 5811 } } // namespace v8::internal | 5809 } } // namespace v8::internal |
| 5812 | 5810 |
| 5813 #endif // V8_TARGET_ARCH_ARM | 5811 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |