Changeset 174682 in webkit for trunk/Source/JavaScriptCore/jit


Ignore:
Timestamp:
Oct 14, 2014, 9:25:25 AM (11 years ago)
Author:
[email protected]
Message:

[Win32] Thunk is not implemented.
https://bugs.webkit.org/show_bug.cgi?id=137691

Patch by [email protected] <[email protected]> on 2014-10-14
Reviewed by Mark Lam.

Thunks for functions with double operands (floor, etc.) are not implemented on Win32.

  • jit/ThunkGenerators.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r174503 r174682  
    806806    extern "C" { \
    807807        MathThunkCallingConvention function##Thunk(MathThunkCallingConvention); \
     808    } \
     809    static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
     810
     811#elif CPU(X86) && COMPILER(MSVC) && OS(WINDOWS)
     812
     813// MSVC does not accept floor, etc, to be called directly from inline assembly, so we need to wrap these functions.
     814static double (_cdecl *floorFunction)(double) = floor;
     815static double (_cdecl *ceilFunction)(double) = ceil;
     816static double (_cdecl *expFunction)(double) = exp;
     817static double (_cdecl *logFunction)(double) = log;
     818static double (_cdecl *jsRoundFunction)(double) = jsRound;
     819
     820#define defineUnaryDoubleOpWrapper(function) \
     821    extern "C" __declspec(naked) MathThunkCallingConvention function##Thunk(MathThunkCallingConvention) \
     822    { \
     823        __asm \
     824        { \
     825        __asm sub esp, 20 \
     826        __asm movsd mmword ptr [esp], xmm0  \
     827        __asm call function##Function \
     828        __asm fstp qword ptr [esp] \
     829        __asm movsd xmm0, mmword ptr [esp] \
     830        __asm add esp, 20 \
     831        __asm ret \
     832        } \
    808833    } \
    809834    static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
Note: See TracChangeset for help on using the changeset viewer.