OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 // it to a HeapNumber. | 1420 // it to a HeapNumber. |
1421 Label box_int; | 1421 Label box_int; |
1422 __ cmp(value, Operand(0xC0000000)); | 1422 __ cmp(value, Operand(0xC0000000)); |
1423 __ b(mi, &box_int); | 1423 __ b(mi, &box_int); |
1424 // Tag integer as smi and return it. | 1424 // Tag integer as smi and return it. |
1425 __ mov(r0, Operand(value, LSL, kSmiTagSize)); | 1425 __ mov(r0, Operand(value, LSL, kSmiTagSize)); |
1426 __ Ret(); | 1426 __ Ret(); |
1427 | 1427 |
1428 __ bind(&box_int); | 1428 __ bind(&box_int); |
1429 // Allocate a HeapNumber for the result and perform int-to-double | 1429 // Allocate a HeapNumber for the result and perform int-to-double |
1430 // conversion. Use r0 for result as key is not needed any more. | 1430 // conversion. Don't touch r0 or r1 as they are needed if allocation |
| 1431 // fails. |
1431 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); | 1432 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); |
1432 __ AllocateHeapNumber(r0, r3, r4, r6, &slow); | 1433 __ AllocateHeapNumber(r5, r3, r4, r6, &slow); |
| 1434 // Now we can use r0 for the result as key is not needed any more. |
| 1435 __ mov(r0, r5); |
1433 | 1436 |
1434 if (CpuFeatures::IsSupported(VFP3)) { | 1437 if (CpuFeatures::IsSupported(VFP3)) { |
1435 CpuFeatures::Scope scope(VFP3); | 1438 CpuFeatures::Scope scope(VFP3); |
1436 __ vmov(s0, value); | 1439 __ vmov(s0, value); |
1437 __ vcvt_f64_s32(d0, s0); | 1440 __ vcvt_f64_s32(d0, s0); |
1438 __ sub(r3, r0, Operand(kHeapObjectTag)); | 1441 __ sub(r3, r0, Operand(kHeapObjectTag)); |
1439 __ vstr(d0, r3, HeapNumber::kValueOffset); | 1442 __ vstr(d0, r3, HeapNumber::kValueOffset); |
1440 __ Ret(); | 1443 __ Ret(); |
1441 } else { | 1444 } else { |
1442 WriteInt32ToHeapNumberStub stub(value, r0, r3); | 1445 WriteInt32ToHeapNumberStub stub(value, r0, r3); |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2269 GenerateMiss(masm); | 2272 GenerateMiss(masm); |
2270 } | 2273 } |
2271 | 2274 |
2272 | 2275 |
2273 #undef __ | 2276 #undef __ |
2274 | 2277 |
2275 | 2278 |
2276 } } // namespace v8::internal | 2279 } } // namespace v8::internal |
2277 | 2280 |
2278 #endif // V8_TARGET_ARCH_ARM | 2281 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |