OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 4852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4863 ASSERT(args->length() == 0); | 4863 ASSERT(args->length() == 0); |
4864 | 4864 |
4865 Label slow_allocate_heapnumber; | 4865 Label slow_allocate_heapnumber; |
4866 Label heapnumber_allocated; | 4866 Label heapnumber_allocated; |
4867 | 4867 |
4868 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); | 4868 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); |
4869 __ AllocateHeapNumber(r4, r1, r2, r6, &slow_allocate_heapnumber); | 4869 __ AllocateHeapNumber(r4, r1, r2, r6, &slow_allocate_heapnumber); |
4870 __ jmp(&heapnumber_allocated); | 4870 __ jmp(&heapnumber_allocated); |
4871 | 4871 |
4872 __ bind(&slow_allocate_heapnumber); | 4872 __ bind(&slow_allocate_heapnumber); |
4873 // To allocate a heap number, and ensure that it is not a smi, we | 4873 // Allocate a heap number. |
4874 // call the runtime function FUnaryMinus on 0, returning the double | 4874 __ CallRuntime(Runtime::kNumberAlloc, 0); |
4875 // -0.0. A new, distinct heap number is returned each time. | |
4876 __ mov(r0, Operand(Smi::FromInt(0))); | |
4877 __ push(r0); | |
4878 __ CallRuntime(Runtime::kNumberUnaryMinus, 1); | |
4879 __ mov(r4, Operand(r0)); | 4875 __ mov(r4, Operand(r0)); |
4880 | 4876 |
4881 __ bind(&heapnumber_allocated); | 4877 __ bind(&heapnumber_allocated); |
4882 | 4878 |
4883 // Convert 32 random bits in r0 to 0.(32 random bits) in a double | 4879 // Convert 32 random bits in r0 to 0.(32 random bits) in a double |
4884 // by computing: | 4880 // by computing: |
4885 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 4881 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
4886 if (CpuFeatures::IsSupported(VFP3)) { | 4882 if (CpuFeatures::IsSupported(VFP3)) { |
4887 __ PrepareCallCFunction(0, r1); | 4883 __ PrepareCallCFunction(0, r1); |
4888 __ CallCFunction(ExternalReference::random_uint32_function(), 0); | 4884 __ CallCFunction(ExternalReference::random_uint32_function(), 0); |
(...skipping 6314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11203 __ bind(&string_add_runtime); | 11199 __ bind(&string_add_runtime); |
11204 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | 11200 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
11205 } | 11201 } |
11206 | 11202 |
11207 | 11203 |
11208 #undef __ | 11204 #undef __ |
11209 | 11205 |
11210 } } // namespace v8::internal | 11206 } } // namespace v8::internal |
11211 | 11207 |
11212 #endif // V8_TARGET_ARCH_ARM | 11208 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |