| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 | 1051 |
| 1052 // Assert that heap_number_result is callee-saved. | 1052 // Assert that heap_number_result is callee-saved. |
| 1053 // We currently always use r5 to pass it. | 1053 // We currently always use r5 to pass it. |
| 1054 ASSERT(heap_number_result.is(r5)); | 1054 ASSERT(heap_number_result.is(r5)); |
| 1055 | 1055 |
| 1056 // Push the current return address before the C call. Return will be | 1056 // Push the current return address before the C call. Return will be |
| 1057 // through pop(pc) below. | 1057 // through pop(pc) below. |
| 1058 __ push(lr); | 1058 __ push(lr); |
| 1059 __ PrepareCallCFunction(0, 2, scratch); | 1059 __ PrepareCallCFunction(0, 2, scratch); |
| 1060 if (masm->use_eabi_hardfloat()) { | 1060 if (masm->use_eabi_hardfloat()) { |
| 1061 CpuFeatures::Scope scope(VFP3); | 1061 CpuFeatures::Scope scope(VFP2); |
| 1062 __ vmov(d0, r0, r1); | 1062 __ vmov(d0, r0, r1); |
| 1063 __ vmov(d1, r2, r3); | 1063 __ vmov(d1, r2, r3); |
| 1064 } | 1064 } |
| 1065 { | 1065 { |
| 1066 AllowExternalCallThatCantCauseGC scope(masm); | 1066 AllowExternalCallThatCantCauseGC scope(masm); |
| 1067 __ CallCFunction( | 1067 __ CallCFunction( |
| 1068 ExternalReference::double_fp_operation(op, masm->isolate()), 0, 2); | 1068 ExternalReference::double_fp_operation(op, masm->isolate()), 0, 2); |
| 1069 } | 1069 } |
| 1070 // Store answer in the overwritable heap number. Double returned in | 1070 // Store answer in the overwritable heap number. Double returned in |
| 1071 // registers r0 and r1 or in d0. | 1071 // registers r0 and r1 or in d0. |
| 1072 if (masm->use_eabi_hardfloat()) { | 1072 if (masm->use_eabi_hardfloat()) { |
| 1073 CpuFeatures::Scope scope(VFP3); | 1073 CpuFeatures::Scope scope(VFP2); |
| 1074 __ vstr(d0, | 1074 __ vstr(d0, |
| 1075 FieldMemOperand(heap_number_result, HeapNumber::kValueOffset)); | 1075 FieldMemOperand(heap_number_result, HeapNumber::kValueOffset)); |
| 1076 } else { | 1076 } else { |
| 1077 __ Strd(r0, r1, FieldMemOperand(heap_number_result, | 1077 __ Strd(r0, r1, FieldMemOperand(heap_number_result, |
| 1078 HeapNumber::kValueOffset)); | 1078 HeapNumber::kValueOffset)); |
| 1079 } | 1079 } |
| 1080 // Place heap_number_result in r0 and return to the pushed return address. | 1080 // Place heap_number_result in r0 and return to the pushed return address. |
| 1081 __ mov(r0, Operand(heap_number_result)); | 1081 __ mov(r0, Operand(heap_number_result)); |
| 1082 __ pop(pc); | 1082 __ pop(pc); |
| 1083 } | 1083 } |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 // Now they are equal if and only if the lhs exponent is zero in its | 1435 // Now they are equal if and only if the lhs exponent is zero in its |
| 1436 // low 31 bits. | 1436 // low 31 bits. |
| 1437 __ mov(r0, Operand(rhs_exponent, LSL, kSmiTagSize)); | 1437 __ mov(r0, Operand(rhs_exponent, LSL, kSmiTagSize)); |
| 1438 __ Ret(); | 1438 __ Ret(); |
| 1439 } else { | 1439 } else { |
| 1440 // Call a native function to do a comparison between two non-NaNs. | 1440 // Call a native function to do a comparison between two non-NaNs. |
| 1441 // Call C routine that may not cause GC or other trouble. | 1441 // Call C routine that may not cause GC or other trouble. |
| 1442 __ push(lr); | 1442 __ push(lr); |
| 1443 __ PrepareCallCFunction(0, 2, r5); | 1443 __ PrepareCallCFunction(0, 2, r5); |
| 1444 if (masm->use_eabi_hardfloat()) { | 1444 if (masm->use_eabi_hardfloat()) { |
| 1445 CpuFeatures::Scope scope(VFP3); | 1445 CpuFeatures::Scope scope(VFP2); |
| 1446 __ vmov(d0, r0, r1); | 1446 __ vmov(d0, r0, r1); |
| 1447 __ vmov(d1, r2, r3); | 1447 __ vmov(d1, r2, r3); |
| 1448 } | 1448 } |
| 1449 | 1449 |
| 1450 AllowExternalCallThatCantCauseGC scope(masm); | 1450 AllowExternalCallThatCantCauseGC scope(masm); |
| 1451 __ CallCFunction(ExternalReference::compare_doubles(masm->isolate()), | 1451 __ CallCFunction(ExternalReference::compare_doubles(masm->isolate()), |
| 1452 0, 2); | 1452 0, 2); |
| 1453 __ pop(pc); // Return. | 1453 __ pop(pc); // Return. |
| 1454 } | 1454 } |
| 1455 } | 1455 } |
| (...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3462 } | 3462 } |
| 3463 } | 3463 } |
| 3464 | 3464 |
| 3465 | 3465 |
| 3466 void TranscendentalCacheStub::GenerateCallCFunction(MacroAssembler* masm, | 3466 void TranscendentalCacheStub::GenerateCallCFunction(MacroAssembler* masm, |
| 3467 Register scratch) { | 3467 Register scratch) { |
| 3468 Isolate* isolate = masm->isolate(); | 3468 Isolate* isolate = masm->isolate(); |
| 3469 | 3469 |
| 3470 __ push(lr); | 3470 __ push(lr); |
| 3471 __ PrepareCallCFunction(0, 1, scratch); | 3471 __ PrepareCallCFunction(0, 1, scratch); |
| 3472 if (masm->use_eabi_hardfloat()) { | 3472 if (masm->use_eabi_hardfloat() && CpuFeatures::IsSupported(VFP3)) { |
| 3473 __ vmov(d0, d2); | 3473 __ vmov(d0, d2); |
| 3474 } else { | 3474 } else { |
| 3475 __ vmov(r0, r1, d2); | 3475 __ vmov(r0, r1, d2); |
| 3476 } | 3476 } |
| 3477 AllowExternalCallThatCantCauseGC scope(masm); | 3477 AllowExternalCallThatCantCauseGC scope(masm); |
| 3478 switch (type_) { | 3478 switch (type_) { |
| 3479 case TranscendentalCache::SIN: | 3479 case TranscendentalCache::SIN: |
| 3480 __ CallCFunction(ExternalReference::math_sin_double_function(isolate), | 3480 __ CallCFunction(ExternalReference::math_sin_double_function(isolate), |
| 3481 0, 1); | 3481 0, 1); |
| 3482 break; | 3482 break; |
| (...skipping 4087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7570 | 7570 |
| 7571 __ Pop(lr, r5, r1); | 7571 __ Pop(lr, r5, r1); |
| 7572 __ Ret(); | 7572 __ Ret(); |
| 7573 } | 7573 } |
| 7574 | 7574 |
| 7575 #undef __ | 7575 #undef __ |
| 7576 | 7576 |
| 7577 } } // namespace v8::internal | 7577 } } // namespace v8::internal |
| 7578 | 7578 |
| 7579 #endif // V8_TARGET_ARCH_ARM | 7579 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |