OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2751 #endif | 2751 #endif |
2752 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); | 2752 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); |
2753 | 2753 |
2754 // Convert 32 random bits in rax to 0.(32 random bits) in a double | 2754 // Convert 32 random bits in rax to 0.(32 random bits) in a double |
2755 // by computing: | 2755 // by computing: |
2756 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 2756 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
2757 __ movl(rcx, Immediate(0x49800000)); // 1.0 x 2^20 as single. | 2757 __ movl(rcx, Immediate(0x49800000)); // 1.0 x 2^20 as single. |
2758 __ movd(xmm1, rcx); | 2758 __ movd(xmm1, rcx); |
2759 __ movd(xmm0, rax); | 2759 __ movd(xmm0, rax); |
2760 __ cvtss2sd(xmm1, xmm1); | 2760 __ cvtss2sd(xmm1, xmm1); |
2761 __ xorpd(xmm0, xmm1); | 2761 __ xorps(xmm0, xmm1); |
2762 __ subsd(xmm0, xmm1); | 2762 __ subsd(xmm0, xmm1); |
2763 __ movsd(FieldOperand(rbx, HeapNumber::kValueOffset), xmm0); | 2763 __ movsd(FieldOperand(rbx, HeapNumber::kValueOffset), xmm0); |
2764 | 2764 |
2765 __ movq(rax, rbx); | 2765 __ movq(rax, rbx); |
2766 context()->Plug(rax); | 2766 context()->Plug(rax); |
2767 } | 2767 } |
2768 | 2768 |
2769 | 2769 |
2770 void FullCodeGenerator::EmitSubString(ZoneList<Expression*>* args) { | 2770 void FullCodeGenerator::EmitSubString(ZoneList<Expression*>* args) { |
2771 // Load the arguments on the stack and call the stub. | 2771 // Load the arguments on the stack and call the stub. |
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4305 __ ret(0); | 4305 __ ret(0); |
4306 } | 4306 } |
4307 | 4307 |
4308 | 4308 |
4309 #undef __ | 4309 #undef __ |
4310 | 4310 |
4311 | 4311 |
4312 } } // namespace v8::internal | 4312 } } // namespace v8::internal |
4313 | 4313 |
4314 #endif // V8_TARGET_ARCH_X64 | 4314 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |