Changeset 102811 in webkit


Ignore:
Timestamp:
Dec 14, 2011 12:51:14 PM (12 years ago)
Author:
barraclough@apple.com
Message:

DFG relies on returning a struct in registers
https://bugs.webkit.org/show_bug.cgi?id=74527

Reviewed by Geoff Garen.

This will not work on all platforms. Returning a uint64_t will more reliably achieve
what we want, on 32-bit platforms (on 64-bit, stick with the struct return).

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:

(JSC::DFG::DFGHandler::dfgHandlerEncoded):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r102808 r102811  
     12011-12-14  Gavin Barraclough  <barraclough@apple.com>
     2
     3        DFG relies on returning a struct in registers
     4        https://bugs.webkit.org/show_bug.cgi?id=74527
     5
     6        Reviewed by Geoff Garen.
     7
     8        This will not work on all platforms. Returning a uint64_t will more reliably achieve
     9        what we want, on 32-bit platforms (on 64-bit, stick with the struct return).
     10
     11        * dfg/DFGOperations.cpp:
     12        * dfg/DFGOperations.h:
     13        (JSC::DFG::DFGHandler::dfgHandlerEncoded):
     14
    1152011-12-14  Anders Carlsson  <andersca@apple.com>
    216
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r102545 r102811  
    796796}
    797797
    798 DFGHandler DFG_OPERATION lookupExceptionHandler(ExecState* exec, ReturnAddressPtr faultLocation)
     798DFGHandlerEncoded DFG_OPERATION lookupExceptionHandler(ExecState* exec, ReturnAddressPtr faultLocation)
    799799{
    800800    JSValue exceptionValue = exec->exception();
     
    806806    void* catchRoutine = handler ? handler->nativeCode.executableAddress() : (void*)ctiOpThrowNotCaught;
    807807    ASSERT(catchRoutine);
    808     return DFGHandler(exec, catchRoutine);
     808    return dfgHandlerEncoded(exec, catchRoutine);
    809809}
    810810
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.h

    r101298 r102811  
    147147struct DFGHandler {
    148148    DFGHandler(ExecState* exec, void* handler)
    149         : exec(exec)
    150         , handler(handler)
    151149    {
     150        u.s.exec = exec;
     151        u.s.handler = handler;
    152152    }
    153153
    154     ExecState* exec;
    155     void* handler;
     154#if !CPU(X86_64)
     155    uint64_t encoded()
     156    {
     157        COMPILE_ASSERT(sizeof(Union) == sizeof(uint64_t), DFGHandler_Union_is_64bit);
     158        return u.encoded;
     159    }
     160#endif
     161
     162    union Union {
     163        struct Struct {
     164            ExecState* exec;
     165            void* handler;
     166        } s;
     167        uint64_t encoded;
     168    } u;
    156169};
    157 DFGHandler DFG_OPERATION lookupExceptionHandler(ExecState*, ReturnAddressPtr faultLocation);
     170#if CPU(X86_64)
     171typedef DFGHandler DFGHandlerEncoded;
     172inline DFGHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)
     173{
     174    return DFGHandler(exec, handler);
     175}
     176#else
     177typedef uint64_t DFGHandlerEncoded;
     178inline DFGHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)
     179{
     180    return DFGHandler(exec, handler).encoded();
     181}
     182#endif
     183DFGHandlerEncoded DFG_OPERATION lookupExceptionHandler(ExecState*, ReturnAddressPtr faultLocation);
    158184
    159185// These operations implement the implicitly called ToInt32, ToNumber, and ToBoolean conversions from ES5.
Note: See TracChangeset for help on using the changeset viewer.