| 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 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3036 // Convert 32 random bits in r0 to 0.(32 random bits) in a double | 3036 // Convert 32 random bits in r0 to 0.(32 random bits) in a double |
| 3037 // by computing: | 3037 // by computing: |
| 3038 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 3038 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
| 3039 if (CpuFeatures::IsSupported(VFP2)) { | 3039 if (CpuFeatures::IsSupported(VFP2)) { |
| 3040 __ PrepareCallCFunction(1, r0); | 3040 __ PrepareCallCFunction(1, r0); |
| 3041 __ ldr(r0, | 3041 __ ldr(r0, |
| 3042 ContextOperand(context_register(), Context::GLOBAL_OBJECT_INDEX)); | 3042 ContextOperand(context_register(), Context::GLOBAL_OBJECT_INDEX)); |
| 3043 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); | 3043 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); |
| 3044 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); | 3044 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); |
| 3045 | 3045 |
| 3046 CpuFeatures::Scope scope(VFP2); | 3046 CpuFeatureScope scope(masm(), VFP2); |
| 3047 // 0x41300000 is the top half of 1.0 x 2^20 as a double. | 3047 // 0x41300000 is the top half of 1.0 x 2^20 as a double. |
| 3048 // Create this constant using mov/orr to avoid PC relative load. | 3048 // Create this constant using mov/orr to avoid PC relative load. |
| 3049 __ mov(r1, Operand(0x41000000)); | 3049 __ mov(r1, Operand(0x41000000)); |
| 3050 __ orr(r1, r1, Operand(0x300000)); | 3050 __ orr(r1, r1, Operand(0x300000)); |
| 3051 // Move 0x41300000xxxxxxxx (x = random bits) to VFP. | 3051 // Move 0x41300000xxxxxxxx (x = random bits) to VFP. |
| 3052 __ vmov(d7, r0, r1); | 3052 __ vmov(d7, r0, r1); |
| 3053 // Move 0x4130000000000000 to VFP. | 3053 // Move 0x4130000000000000 to VFP. |
| 3054 __ mov(r0, Operand::Zero()); | 3054 __ mov(r0, Operand::Zero()); |
| 3055 __ vmov(d8, r0, r1); | 3055 __ vmov(d8, r0, r1); |
| 3056 // Subtract and store the result in the heap number. | 3056 // Subtract and store the result in the heap number. |
| (...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4592 *context_length = 0; | 4592 *context_length = 0; |
| 4593 return previous_; | 4593 return previous_; |
| 4594 } | 4594 } |
| 4595 | 4595 |
| 4596 | 4596 |
| 4597 #undef __ | 4597 #undef __ |
| 4598 | 4598 |
| 4599 } } // namespace v8::internal | 4599 } } // namespace v8::internal |
| 4600 | 4600 |
| 4601 #endif // V8_TARGET_ARCH_ARM | 4601 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |