| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 7741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7752 | 7752 |
| 7753 #ifdef _WIN64 | 7753 #ifdef _WIN64 |
| 7754 typedef double (*ModuloFunction)(double, double); | 7754 typedef double (*ModuloFunction)(double, double); |
| 7755 // Define custom fmod implementation. | 7755 // Define custom fmod implementation. |
| 7756 ModuloFunction CreateModuloFunction() { | 7756 ModuloFunction CreateModuloFunction() { |
| 7757 size_t actual_size; | 7757 size_t actual_size; |
| 7758 byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize, | 7758 byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize, |
| 7759 &actual_size, | 7759 &actual_size, |
| 7760 true)); | 7760 true)); |
| 7761 CHECK(buffer); | 7761 CHECK(buffer); |
| 7762 Assembler masm(buffer, actual_size); | 7762 Assembler masm(buffer, static_cast<int>(actual_size)); |
| 7763 // Generated code is put into a fixed, unmovable, buffer, and not into | 7763 // Generated code is put into a fixed, unmovable, buffer, and not into |
| 7764 // the V8 heap. We can't, and don't, refer to any relocatable addresses | 7764 // the V8 heap. We can't, and don't, refer to any relocatable addresses |
| 7765 // (e.g. the JavaScript nan-object). | 7765 // (e.g. the JavaScript nan-object). |
| 7766 | 7766 |
| 7767 // Windows 64 ABI passes double arguments in xmm0, xmm1 and | 7767 // Windows 64 ABI passes double arguments in xmm0, xmm1 and |
| 7768 // returns result in xmm0. | 7768 // returns result in xmm0. |
| 7769 // Argument backing space is allocated on the stack above | 7769 // Argument backing space is allocated on the stack above |
| 7770 // the return address. | 7770 // the return address. |
| 7771 | 7771 |
| 7772 // Compute x mod y. | 7772 // Compute x mod y. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7835 masm.GetCode(&desc); | 7835 masm.GetCode(&desc); |
| 7836 // Call the function from C++. | 7836 // Call the function from C++. |
| 7837 return FUNCTION_CAST<ModuloFunction>(buffer); | 7837 return FUNCTION_CAST<ModuloFunction>(buffer); |
| 7838 } | 7838 } |
| 7839 | 7839 |
| 7840 #endif | 7840 #endif |
| 7841 | 7841 |
| 7842 #undef __ | 7842 #undef __ |
| 7843 | 7843 |
| 7844 } } // namespace v8::internal | 7844 } } // namespace v8::internal |
| OLD | NEW |