| 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 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 // it to a HeapNumber. | 1384 // it to a HeapNumber. |
| 1385 Label box_int; | 1385 Label box_int; |
| 1386 __ cmp(value, Operand(0xC0000000)); | 1386 __ cmp(value, Operand(0xC0000000)); |
| 1387 __ b(mi, &box_int); | 1387 __ b(mi, &box_int); |
| 1388 // Tag integer as smi and return it. | 1388 // Tag integer as smi and return it. |
| 1389 __ mov(r0, Operand(value, LSL, kSmiTagSize)); | 1389 __ mov(r0, Operand(value, LSL, kSmiTagSize)); |
| 1390 __ Ret(); | 1390 __ Ret(); |
| 1391 | 1391 |
| 1392 __ bind(&box_int); | 1392 __ bind(&box_int); |
| 1393 // Allocate a HeapNumber for the result and perform int-to-double | 1393 // Allocate a HeapNumber for the result and perform int-to-double |
| 1394 // conversion. Use r0 for result as key is not needed any more. | 1394 // conversion. Don't touch r0 or r1 as they are needed if allocation |
| 1395 // fails. |
| 1395 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); | 1396 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); |
| 1396 __ AllocateHeapNumber(r0, r3, r4, r6, &slow); | 1397 __ AllocateHeapNumber(r5, r3, r4, r6, &slow); |
| 1398 // Now we can use r0 for the result as key is not needed any more. |
| 1399 __ mov(r0, r5); |
| 1397 | 1400 |
| 1398 if (CpuFeatures::IsSupported(VFP3)) { | 1401 if (CpuFeatures::IsSupported(VFP3)) { |
| 1399 CpuFeatures::Scope scope(VFP3); | 1402 CpuFeatures::Scope scope(VFP3); |
| 1400 __ vmov(s0, value); | 1403 __ vmov(s0, value); |
| 1401 __ vcvt_f64_s32(d0, s0); | 1404 __ vcvt_f64_s32(d0, s0); |
| 1402 __ sub(r3, r0, Operand(kHeapObjectTag)); | 1405 __ sub(r3, r0, Operand(kHeapObjectTag)); |
| 1403 __ vstr(d0, r3, HeapNumber::kValueOffset); | 1406 __ vstr(d0, r3, HeapNumber::kValueOffset); |
| 1404 __ Ret(); | 1407 __ Ret(); |
| 1405 } else { | 1408 } else { |
| 1406 WriteInt32ToHeapNumberStub stub(value, r0, r3); | 1409 WriteInt32ToHeapNumberStub stub(value, r0, r3); |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2234 GenerateMiss(masm); | 2237 GenerateMiss(masm); |
| 2235 } | 2238 } |
| 2236 | 2239 |
| 2237 | 2240 |
| 2238 #undef __ | 2241 #undef __ |
| 2239 | 2242 |
| 2240 | 2243 |
| 2241 } } // namespace v8::internal | 2244 } } // namespace v8::internal |
| 2242 | 2245 |
| 2243 #endif // V8_TARGET_ARCH_ARM | 2246 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |