⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 157581 in webkit


Ignore:
Timestamp:
Oct 17, 2013, 11:12:28 AM (13 years ago)
Author:
msaboff@apple.com
Message:

Transition cti_op_throw and cti_vm_throw to a JIT operation
https://bugs.webkit.org/show_bug.cgi?id=122931

Reviewed by Filip Pizlo.

Moved cti_op_throw to operationThrow. Made the caller responsible for jumping to the
catch handler. Eliminated cti_op_throw_static_error, cti_vm_throw, ctiVMThrowTrampoline()
and their callers as it is now dead code. There is some work needed on the Microsoft X86
callOperation to handle the need to provide space for structure return value.

  • jit/JIT.h:
  • jit/JITInlines.h:

(JSC::JIT::callOperation):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_throw):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):

  • jit/JITOperations.cpp:
  • jit/JITOperations.h:
  • jit/JITStubs.cpp:
  • jit/JITStubs.h:
  • jit/JITStubsARM.h:
  • jit/JITStubsARM64.h:
  • jit/JITStubsARMv7.h:
  • jit/JITStubsMIPS.h:
  • jit/JITStubsMSVC64.asm:
  • jit/JITStubsSH4.h:
  • jit/JITStubsX86.h:
  • jit/JITStubsX86_64.h:
  • jit/JSInterfaceJIT.h:
Location:
trunk/Source/JavaScriptCore
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r157576 r157581  
     12013-10-17  Michael Saboff  <msaboff@apple.com>
     2
     3        Transition cti_op_throw and cti_vm_throw to a JIT operation
     4        https://bugs.webkit.org/show_bug.cgi?id=122931
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Moved cti_op_throw to operationThrow.  Made the caller responsible for jumping to the
     9        catch handler.  Eliminated cti_op_throw_static_error, cti_vm_throw, ctiVMThrowTrampoline()
     10        and their callers as it is now dead code.  There is some work needed on the Microsoft X86
     11        callOperation to handle the need to provide space for structure return value.
     12
     13        * jit/JIT.h:
     14        * jit/JITInlines.h:
     15        (JSC::JIT::callOperation):
     16        * jit/JITOpcodes.cpp:
     17        (JSC::JIT::emit_op_throw):
     18        * jit/JITOpcodes32_64.cpp:
     19        (JSC::JIT::emit_op_throw):
     20        (JSC::JIT::emit_op_catch):
     21        * jit/JITOperations.cpp:
     22        * jit/JITOperations.h:
     23        * jit/JITStubs.cpp:
     24        * jit/JITStubs.h:
     25        * jit/JITStubsARM.h:
     26        * jit/JITStubsARM64.h:
     27        * jit/JITStubsARMv7.h:
     28        * jit/JITStubsMIPS.h:
     29        * jit/JITStubsMSVC64.asm:
     30        * jit/JITStubsSH4.h:
     31        * jit/JITStubsX86.h:
     32        * jit/JITStubsX86_64.h:
     33        * jit/JSInterfaceJIT.h:
     34
    1352013-10-17  Mark Lam  <mark.lam@apple.com>
    236
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r157559 r157581  
    796796        MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_EPc, int, Instruction*);
    797797        MacroAssembler::Call callOperation(J_JITOperation_EZ, int, int32_t);
     798#if USE(JSVALUE64)
     799        MacroAssembler::Call callOperation(Jhe_JITOperation_EJ, RegisterID);
     800#else
     801        MacroAssembler::Call callOperation(Jhe_JITOperation_EJ, RegisterID, RegisterID);
     802#endif
    798803        MacroAssembler::Call callOperation(P_JITOperation_EJS, GPRReg, size_t);
    799804        MacroAssembler::Call callOperation(P_JITOperation_EZ, int32_t);
  • trunk/Source/JavaScriptCore/jit/JITInlines.h

    r157559 r157581  
    292292}
    293293
     294#if USE(JSVALUE64)
     295ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(Jhe_JITOperation_EJ operation, GPRReg arg1)
     296{
     297#if COMPILER(MSVC) && CPU(X86)
     298    // Need to make space on stack for return value, use that address as first arg (in register),
     299    // move callFrameRegister to second argument register and push the passed arg1.
     300    updateTopCallFrame();
     301    MacroAssembler::Call call = appendCall(operation);
     302    // These may not be pops:
     303    // pop(regT0); // Restore arg1 slot
     304    // pop(regT0); // Get handler's call frame
     305    // pop(regT1); // Get handler's address
     306    return call;
     307#else
     308    setupArgumentsWithExecState(arg1);
     309    updateTopCallFrame();
     310    return appendCall(operation);
     311#endif
     312}
     313#else
     314ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(Jhe_JITOperation_EJ operation, GPRReg arg1Tag, GPRReg arg1Payload)
     315{
     316    setupArgumentsWithExecState(arg1Payload, arg1Tag);
     317    updateTopCallFrame();
     318    return appendCall(operation);
     319}
     320#endif
     321
    294322ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(P_JITOperation_EZ operation, int32_t op)
    295323{
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r157559 r157581  
    484484void JIT::emit_op_throw(Instruction* currentInstruction)
    485485{
    486     JITStubCall stubCall(this, cti_op_throw);
    487     stubCall.addArgument(currentInstruction[1].u.operand, regT2);
    488     stubCall.call();
    489486    ASSERT(regT0 == returnValueRegister);
    490 #ifndef NDEBUG
    491     // cti_op_throw always changes it's return address,
    492     // this point in the code should never be reached.
    493     breakpoint();
    494 #endif
     487    emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
     488    callOperation(operationThrow, regT0);
     489    // After operationThrow returns, returnValueRegister (regT0) has the handler's callFrame and
     490    // returnValue2Register has the handler's entry address.
     491    jump(returnValue2Register);
    495492}
    496493
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r157559 r157581  
    813813void JIT::emit_op_throw(Instruction* currentInstruction)
    814814{
    815     unsigned exception = currentInstruction[1].u.operand;
    816     JITStubCall stubCall(this, cti_op_throw);
    817     stubCall.addArgument(exception);
    818     stubCall.call();
    819 
    820 #ifndef NDEBUG
    821     // cti_op_throw always changes it's return address,
    822     // this point in the code should never be reached.
    823     breakpoint();
    824 #endif
     815    ASSERT(regT0 == returnValueRegister);
     816    emitLoad(currentInstruction[1].u.operand, regT1, regT0);
     817    callOperation(operationThrow, regT1, regT0);
     818    // After operationThrow returns, returnValueRegister (regT0) has the handler's callFrame and
     819    // returnValue2Register has the handler's entry address.
     820    jump(returnValue2Register);
    825821}
    826822
     
    972968void JIT::emit_op_catch(Instruction* currentInstruction)
    973969{
    974     // cti_op_throw returns the callFrame for the handler.
     970    // operationThrow returns the callFrame for the handler.
    975971    move(regT0, callFrameRegister);
    976972
    977     // Now store the exception returned by cti_op_throw.
     973    // Now store the exception returned by operationThrow.
    978974    loadPtr(Address(stackPointerRegister, OBJECT_OFFSETOF(struct JITStackFrame, vm)), regT3);
    979975    load32(Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0);
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r157559 r157581  
    16161616}
    16171617
     1618JITHandlerEncoded JIT_OPERATION operationThrow(ExecState* exec, EncodedJSValue encodedExceptionValue)
     1619{
     1620    VM* vm = &exec->vm();
     1621    NativeCallFrameTracer tracer(vm, exec);
     1622
     1623    JSValue exceptionValue = JSValue::decode(encodedExceptionValue);
     1624    vm->throwException(exec, exceptionValue);
     1625    ExceptionHandler handler = genericUnwind(vm, exec, exceptionValue);
     1626    return dfgHandlerEncoded(handler.callFrame, handler.catchRoutine);
     1627}
     1628
    16181629JITHandlerEncoded JIT_OPERATION lookupExceptionHandler(ExecState* exec)
    16191630{
  • trunk/Source/JavaScriptCore/jit/JITOperations.h

    r157559 r157581  
    2828
    2929#include "CallFrame.h"
     30#include "JITExceptions.h"
    3031#include "JSArray.h"
    3132#include "JSCJSValue.h"
     
    4344#else
    4445#define JIT_OPERATION
     46#endif
     47
     48extern "C" {
     49
     50// This method is used to lookup an exception hander, keyed by faultLocation, which is
     51// the return location from one of the calls out to one of the helper operations above.
     52
     53// According to C++ rules, a type used for the return signature of function with C linkage (i.e.
     54// 'extern "C"') needs to be POD; hence putting any constructors into it could cause either compiler
     55// warnings, or worse, a change in the ABI used to return these types.
     56struct JITHandler {
     57    union Union {
     58        struct Struct {
     59            ExecState* exec;
     60            void* handler;
     61        } s;
     62        uint64_t encoded;
     63    } u;
     64};
     65
     66inline JITHandler createJITHandler(ExecState* exec, void* handler)
     67{
     68    JITHandler result;
     69    result.u.s.exec = exec;
     70    result.u.s.handler = handler;
     71    return result;
     72}
     73
     74#if CPU(X86_64)
     75typedef JITHandler JITHandlerEncoded;
     76inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)
     77{
     78    return createJITHandler(exec, handler);
     79}
     80#else
     81typedef uint64_t JITHandlerEncoded;
     82inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)
     83{
     84    COMPILE_ASSERT(sizeof(JITHandler::Union) == sizeof(uint64_t), JITHandler_Union_is_64bit);
     85    return createJITHandler(exec, handler).u.encoded;
     86}
    4587#endif
    4688
     
    61103    J: EncodedJSValue
    62104    Jcp: const JSValue*
     105    Jhe: JITHandlerEncoded
    63106    Jsa: JSActivation*
    64107    Jss: JSString*
     
    100143typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EZIcfZ)(ExecState*, int32_t, InlineCallFrame*, int32_t);
    101144typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EZZ)(ExecState*, int32_t, int32_t);
     145typedef JITHandlerEncoded JIT_OPERATION (*Jhe_JITOperation_EJ)(ExecState*, EncodedJSValue);
    102146typedef JSCell* JIT_OPERATION (*C_JITOperation_E)(ExecState*);
    103147typedef JSCell* JIT_OPERATION (*C_JITOperation_EZ)(ExecState*, int32_t);
     
    167211typedef JSString* JIT_OPERATION (*Jss_JITOperation_EZ)(ExecState*, int32_t);
    168212
    169 extern "C" {
    170 
    171 // This method is used to lookup an exception hander, keyed by faultLocation, which is
    172 // the return location from one of the calls out to one of the helper operations above.
    173 
    174 // According to C++ rules, a type used for the return signature of function with C linkage (i.e.
    175 // 'extern "C"') needs to be POD; hence putting any constructors into it could cause either compiler
    176 // warnings, or worse, a change in the ABI used to return these types.
    177 struct JITHandler {
    178     union Union {
    179         struct Struct {
    180             ExecState* exec;
    181             void* handler;
    182         } s;
    183         uint64_t encoded;
    184     } u;
    185 };
    186 
    187 inline JITHandler createJITHandler(ExecState* exec, void* handler)
    188 {
    189     JITHandler result;
    190     result.u.s.exec = exec;
    191     result.u.s.handler = handler;
    192     return result;
    193 }
    194 
    195 #if CPU(X86_64)
    196 typedef JITHandler JITHandlerEncoded;
    197 inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)
    198 {
    199     return createJITHandler(exec, handler);
    200 }
    201 #else
    202 typedef uint64_t JITHandlerEncoded;
    203 inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)
    204 {
    205     COMPILE_ASSERT(sizeof(JITHandler::Union) == sizeof(uint64_t), JITHandler_Union_is_64bit);
    206     return createJITHandler(exec, handler).u.encoded;
    207 }
    208 #endif
    209213JITHandlerEncoded JIT_OPERATION lookupExceptionHandler(ExecState*) WTF_INTERNAL;
    210214
     
    261265void JIT_OPERATION operationHandleWatchdogTimer(ExecState*) WTF_INTERNAL;
    262266void JIT_OPERATION operationThrowStaticError(ExecState*, EncodedJSValue, int32_t) WTF_INTERNAL;
     267JITHandlerEncoded JIT_OPERATION operationThrow(ExecState*, EncodedJSValue) WTF_INTERNAL;
    263268void JIT_OPERATION operationDebug(ExecState*, int32_t) WTF_INTERNAL;
    264269#if ENABLE(DFG_JIT)
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r157559 r157581  
    128128}
    129129
    130 #if !defined(NDEBUG)
    131 
    132 extern "C" {
    133 
    134 static void jscGeneratedNativeCode()
    135 {
    136     // When executing a JIT stub function (which might do an allocation), we hack the return address
    137     // to pretend to be executing this function, to keep stack logging tools from blowing out
    138     // memory.
    139 }
    140 
    141 }
    142 
    143 struct StackHack {
    144     ALWAYS_INLINE StackHack(JITStackFrame& stackFrame)
    145         : stackFrame(stackFrame)
    146         , savedReturnAddress(*stackFrame.returnAddressSlot())
    147     {
    148         if (!CodeProfiling::enabled())
    149             *stackFrame.returnAddressSlot() = ReturnAddressPtr(FunctionPtr(jscGeneratedNativeCode));
    150     }
    151 
    152     ALWAYS_INLINE ~StackHack()
    153     {
    154         *stackFrame.returnAddressSlot() = savedReturnAddress;
    155     }
    156 
    157     JITStackFrame& stackFrame;
    158     ReturnAddressPtr savedReturnAddress;
    159 };
    160 
    161 #define STUB_INIT_STACK_FRAME(stackFrame) JITStackFrame& stackFrame = *reinterpret_cast_ptr<JITStackFrame*>(STUB_ARGS); StackHack stackHack(stackFrame)
    162 #define STUB_SET_RETURN_ADDRESS(returnAddress) stackHack.savedReturnAddress = ReturnAddressPtr(returnAddress)
    163 #define STUB_RETURN_ADDRESS stackHack.savedReturnAddress
    164 
    165 #else
    166 
    167 #define STUB_INIT_STACK_FRAME(stackFrame) JITStackFrame& stackFrame = *reinterpret_cast_ptr<JITStackFrame*>(STUB_ARGS)
    168 #define STUB_SET_RETURN_ADDRESS(returnAddress) *stackFrame.returnAddressSlot() = ReturnAddressPtr(returnAddress)
    169 #define STUB_RETURN_ADDRESS *stackFrame.returnAddressSlot()
    170 
    171 #endif
    172 
    173 // The reason this is not inlined is to avoid having to do a PIC branch
    174 // to get the address of the ctiVMThrowTrampoline function. It's also
    175 // good to keep the code size down by leaving as much of the exception
    176 // handling code out of line as possible.
    177 static NEVER_INLINE void returnToThrowTrampoline(VM* vm, ReturnAddressPtr exceptionLocation, ReturnAddressPtr& returnAddressSlot)
    178 {
    179     RELEASE_ASSERT(vm->exception());
    180     vm->exceptionLocation = exceptionLocation;
    181     returnAddressSlot = ReturnAddressPtr(FunctionPtr(ctiVMThrowTrampoline));
    182 }
    183 
    184 #define VM_THROW_EXCEPTION() \
    185     do { \
    186         VM_THROW_EXCEPTION_AT_END(); \
    187         return 0; \
    188     } while (0)
    189 #define VM_THROW_EXCEPTION_AT_END() \
    190     do {\
    191         returnToThrowTrampoline(stackFrame.vm, STUB_RETURN_ADDRESS, STUB_RETURN_ADDRESS);\
    192     } while (0)
    193 
    194 #define CHECK_FOR_EXCEPTION() \
    195     do { \
    196         if (UNLIKELY(stackFrame.vm->exception())) \
    197             VM_THROW_EXCEPTION(); \
    198     } while (0)
    199 #define CHECK_FOR_EXCEPTION_AT_END() \
    200     do { \
    201         if (UNLIKELY(stackFrame.vm->exception())) \
    202             VM_THROW_EXCEPTION_AT_END(); \
    203     } while (0)
    204 #define CHECK_FOR_EXCEPTION_VOID() \
    205     do { \
    206         if (UNLIKELY(stackFrame.vm->exception())) { \
    207             VM_THROW_EXCEPTION_AT_END(); \
    208             return; \
    209         } \
    210     } while (0)
    211 
    212 class ErrorFunctor {
    213 public:
    214     virtual ~ErrorFunctor() { }
    215     virtual JSValue operator()(ExecState*) = 0;
    216 };
    217 
    218 class ErrorWithExecFunctor : public ErrorFunctor {
    219 public:
    220     typedef JSObject* (*Factory)(ExecState* exec);
    221    
    222     ErrorWithExecFunctor(Factory factory)
    223         : m_factory(factory)
    224     {
    225     }
    226 
    227     virtual JSValue operator()(ExecState* exec) OVERRIDE
    228     {
    229         return m_factory(exec);
    230     }
    231 
    232 private:
    233     Factory m_factory;
    234 };
    235 
    236 class ErrorWithExecAndCalleeFunctor : public ErrorFunctor {
    237 public:
    238     typedef JSObject* (*Factory)(ExecState* exec, JSValue callee);
    239 
    240     ErrorWithExecAndCalleeFunctor(Factory factory, JSValue callee)
    241         : m_factory(factory), m_callee(callee)
    242     {
    243     }
    244 
    245     virtual JSValue operator()(ExecState* exec) OVERRIDE
    246     {
    247         return m_factory(exec, m_callee);
    248     }
    249 private:
    250     Factory m_factory;
    251     JSValue m_callee;
    252 };
    253 
    254 // Helper function for JIT stubs that may throw an exception in the middle of
    255 // processing a function call. This function rolls back the stack to
    256 // our caller, so exception processing can proceed from a valid state.
    257 template<typename T> static T throwExceptionFromOpCall(JITStackFrame& jitStackFrame, CallFrame* newCallFrame, ReturnAddressPtr& returnAddressSlot, ErrorFunctor* createError = 0)
    258 {
    259     CallFrame* callFrame = newCallFrame->callerFrame()->removeHostCallFrameFlag();
    260     jitStackFrame.callFrame = callFrame;
    261     ASSERT(callFrame);
    262     callFrame->vm().topCallFrame = callFrame;
    263     if (createError)
    264         callFrame->vm().throwException(callFrame, (*createError)(callFrame));
    265     ASSERT(callFrame->vm().exception());
    266     returnToThrowTrampoline(&callFrame->vm(), ReturnAddressPtr(newCallFrame->returnPC()), returnAddressSlot);
    267     return T();
    268 }
    269 
    270 // If the CPU specific header does not provide an implementation, use the default one here.
    271 #ifndef DEFINE_STUB_FUNCTION
    272 #define DEFINE_STUB_FUNCTION(rtype, op) rtype JIT_STUB cti_##op(STUB_ARGS_DECLARATION)
    273 #endif
    274 
    275 DEFINE_STUB_FUNCTION(void*, op_throw)
    276 {
    277     STUB_INIT_STACK_FRAME(stackFrame);
    278     stackFrame.vm->throwException(stackFrame.callFrame, stackFrame.args[0].jsValue());
    279     ExceptionHandler handler = genericUnwind(stackFrame.vm, stackFrame.callFrame, stackFrame.args[0].jsValue());
    280     STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
    281     return handler.callFrame;
    282 }
    283 
    284 DEFINE_STUB_FUNCTION(void, op_throw_static_error)
    285 {
    286     STUB_INIT_STACK_FRAME(stackFrame);
    287 
    288     CallFrame* callFrame = stackFrame.callFrame;
    289     String message = errorDescriptionForValue(callFrame, stackFrame.args[0].jsValue())->value(callFrame);
    290     if (stackFrame.args[1].asInt32)
    291         stackFrame.vm->throwException(callFrame, createReferenceError(callFrame, message));
    292     else
    293         stackFrame.vm->throwException(callFrame, createTypeError(callFrame, message));
    294     VM_THROW_EXCEPTION_AT_END();
    295 }
    296 
    297 DEFINE_STUB_FUNCTION(void*, vm_throw)
    298 {
    299     STUB_INIT_STACK_FRAME(stackFrame);
    300     VM* vm = stackFrame.vm;
    301     ExceptionHandler handler = genericUnwind(vm, stackFrame.callFrame, vm->exception());
    302     STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
    303     return handler.callFrame;
    304 }
    305 
    306130#if USE(JSVALUE32_64)
    307131EncodedExceptionHandler JIT_STUB cti_vm_handle_exception(CallFrame* callFrame)
  • trunk/Source/JavaScriptCore/jit/JITStubs.h

    r157572 r157581  
    335335#endif
    336336
    337 extern "C" void ctiVMThrowTrampoline();
    338337extern "C" void ctiVMHandleException();
    339338extern "C" void ctiOpThrowNotCaught();
     
    356355
    357356extern "C" {
    358 void JIT_STUB cti_op_throw_static_error(STUB_ARGS_DECLARATION) WTF_INTERNAL;
    359 void* JIT_STUB cti_op_throw(STUB_ARGS_DECLARATION) WTF_INTERNAL;
    360 void* JIT_STUB cti_vm_throw(STUB_ARGS_DECLARATION) REFERENCED_FROM_ASM WTF_INTERNAL;
    361357
    362358#if USE(JSVALUE32_64)
  • trunk/Source/JavaScriptCore/jit/JITStubsARM.h

    r157571 r157581  
    175175
    176176asm (
    177 ".text" "\n"
    178 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
    179 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
    180 INLINE_ARM_FUNCTION(ctiVMThrowTrampoline)
    181 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
    182     "mov r0, sp" "\n"
    183     "bl " SYMBOL_STRING(cti_vm_throw) "\n"
    184 
    185177// Both has the same return sequence
    186178".text" "\n"
     
    394386}
    395387
    396 __asm void ctiVMThrowTrampoline()
    397 {
    398     ARM
    399     PRESERVE8
    400     mov r0, sp
    401     bl cti_vm_throw
    402     add sp, sp, # PRESERVEDR4_OFFSET
    403     ldmia sp!, {r4-r6, r8-r11, lr}
    404     add sp, sp, #12
    405     bx lr
    406 }
    407 
    408388__asm void ctiOpThrowNotCaught()
    409389{
     
    455435MSVC_BEGIN(    EXPORT ctiTrampoline)
    456436MSVC_BEGIN(    EXPORT ctiTrampolineEnd)
    457 MSVC_BEGIN(    EXPORT ctiVMThrowTrampoline)
    458437MSVC_BEGIN(    EXPORT ctiOpThrowNotCaught)
    459438MSVC_BEGIN(    EXPORT ctiVMHandleException)
     
    476455MSVC_BEGIN(ctiTrampoline ENDP)
    477456MSVC_BEGIN()
    478 MSVC_BEGIN(ctiVMThrowTrampoline PROC)
    479 MSVC_BEGIN(    mov r0, sp)
    480 MSVC_BEGIN(    bl cti_vm_throw)
    481 MSVC_BEGIN(ctiOpThrowNotCaught)
    482 MSVC_BEGIN(    add sp, sp, #68 ; sync with PRESERVEDR4_OFFSET)
    483 MSVC_BEGIN(    ldmia sp!, {r4-r6, r8-r11, lr})
    484 MSVC_BEGIN(    add sp, sp, #12)
    485 MSVC_BEGIN(    bx lr)
    486 MSVC_BEGIN(ctiVMThrowTrampoline ENDP)
    487 MSVC_BEGIN()
    488457MSVC_BEGIN(ctiVMHandleException PROC)
    489458MSVC_BEGIN(    mov r0, r5)
  • trunk/Source/JavaScriptCore/jit/JITStubsARM64.h

    r157474 r157581  
    105105    "mov x0, x25" "\n"
    106106    "bl " LOCAL_REFERENCE(cti_vm_handle_exception) "\n"
    107     // When cti_vm_throw_slowpath returns, x0 has callFrame and x1 has handler address
     107    // When cti_vm_handle_exception returns, x0 has callFrame and x1 has handler address
    108108    "mov x25, x0" "\n"
    109109    "br x1" "\n"
     
    128128HIDE_SYMBOL(ctiTrampolineEnd) "\n"
    129129SYMBOL_STRING(ctiTrampolineEnd) ":" "\n"
    130 );
    131 
    132 asm (
    133 ".section __TEXT,__text,regular,pure_instructions" "\n"
    134 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
    135 ".align 2" "\n"
    136 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
    137 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
    138     "mov x0, sp" "\n"
    139     "bl " LOCAL_REFERENCE(cti_vm_throw) "\n"
    140     "hlt 0xdead" "\n" // Should not be reached!
    141130);
    142131
  • trunk/Source/JavaScriptCore/jit/JITStubsARMv7.h

    r157571 r157581  
    246246".text" "\n"
    247247".align 2" "\n"
    248 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
    249 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
    250 ".thumb" "\n"
    251 ".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n"
    252 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
    253     "mov r0, sp" "\n"
    254     "bl " LOCAL_REFERENCE(cti_vm_throw) "\n"
    255     "ldr r11, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R11_OFFSET) "]" "\n"
    256     "ldr r10, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R10_OFFSET) "]" "\n"
    257     "ldr r9, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R9_OFFSET) "]" "\n"
    258     "ldr r8, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R8_OFFSET) "]" "\n"
    259     "ldr r7, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R7_OFFSET) "]" "\n"
    260     "ldr r6, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R6_OFFSET) "]" "\n"
    261     "ldr r5, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R5_OFFSET) "]" "\n"
    262     "ldr r4, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R4_OFFSET) "]" "\n"
    263     "ldr lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n"
    264     "add sp, sp, #" STRINGIZE_VALUE_OF(FIRST_STACK_ARGUMENT) "\n"
    265     "bx lr" "\n"
    266 );
    267 
    268 asm (
    269 ".text" "\n"
    270 ".align 2" "\n"
    271248".globl " SYMBOL_STRING(ctiVMHandleException) "\n"
    272249HIDE_SYMBOL(ctiVMHandleException) "\n"
     
    516493}
    517494
    518 __asm void ctiVMThrowTrampoline()
    519 {
    520     PRESERVE8
    521     mov r0, sp
    522     bl cti_vm_throw
    523     ldr r11, [sp, # PRESERVED_R11_OFFSET ]
    524     ldr r10, [sp, # PRESERVED_R10_OFFSET ]
    525     ldr r9, [sp, # PRESERVED_R9_OFFSET ]
    526     ldr r8, [sp, # PRESERVED_R8_OFFSET ]
    527     ldr r7, [sp, # PRESERVED_R7_OFFSET ]
    528     ldr r6, [sp, # PRESERVED_R6_OFFSET ]
    529     ldr r5, [sp, # PRESERVED_R5_OFFSET ]
    530     ldr r4, [sp, # PRESERVED_R4_OFFSET ]
    531     ldr lr, [sp, # PRESERVED_RETURN_ADDRESS_OFFSET ]
    532     add sp, sp, # FIRST_STACK_ARGUMENT
    533     bx lr
    534 }
    535 
    536495__asm void ctiOpThrowNotCaught()
    537496{
  • trunk/Source/JavaScriptCore/jit/JITStubsMIPS.h

    r154173 r157581  
    102102".set nomacro" "\n"
    103103".set nomips16" "\n"
    104 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
    105 ".ent " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
    106 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
    107 #if WTF_MIPS_PIC
    108 ".set macro" "\n"
    109 ".cpload $31" "\n"
    110     "la    $25," SYMBOL_STRING(cti_vm_throw) "\n"
    111 ".set nomacro" "\n"
    112     "bal " SYMBOL_STRING(cti_vm_throw) "\n"
    113     "move  $4,$29" "\n"
    114 #else
    115     "jal " SYMBOL_STRING(cti_vm_throw) "\n"
    116     "move  $4,$29" "\n"
    117 #endif
    118     "lw    $16," STRINGIZE_VALUE_OF(PRESERVED_S0_OFFSET) "($29)" "\n"
    119     "lw    $17," STRINGIZE_VALUE_OF(PRESERVED_S1_OFFSET) "($29)" "\n"
    120     "lw    $18," STRINGIZE_VALUE_OF(PRESERVED_S2_OFFSET) "($29)" "\n"
    121     "lw    $19," STRINGIZE_VALUE_OF(PRESERVED_S3_OFFSET) "($29)" "\n"
    122     "lw    $20," STRINGIZE_VALUE_OF(PRESERVED_S4_OFFSET) "($29)" "\n"
    123     "lw    $31," STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "($29)" "\n"
    124     "jr    $31" "\n"
    125     "addiu $29,$29," STRINGIZE_VALUE_OF(STACK_LENGTH) "\n"
    126 ".set reorder" "\n"
    127 ".set macro" "\n"
    128 ".end " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
    129 );
    130 
    131 asm (
    132 ".text" "\n"
    133 ".align 2" "\n"
    134 ".set noreorder" "\n"
    135 ".set nomacro" "\n"
    136 ".set nomips16" "\n"
    137104".globl " SYMBOL_STRING(ctiVMHandleException) "\n"
    138105".ent " SYMBOL_STRING(ctiVMHandleException) "\n"
  • trunk/Source/JavaScriptCore/jit/JITStubsMSVC64.asm

    r156671 r157581  
    2929
    3030PUBLIC ctiTrampoline
    31 PUBLIC ctiVMThrowTrampoline
    3231PUBLIC ctiOpThrowNotCaught
    3332PUBLIC getHostCallReturnValue
     
    6766ctiTrampoline ENDP
    6867
    69 ctiVMThrowTrampoline PROC
    70     mov rcx, rsp
    71     call cti_vm_throw
    72     int 3
    73 ctiVMThrowTrampoline ENDP
    74 
    7568ctiVMHandleException PROC
    7669        sub rsp, 16
  • trunk/Source/JavaScriptCore/jit/JITStubsSH4.h

    r157335 r157581  
    8484
    8585asm volatile (
    86 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
    87 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
    88 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
    89     "mov.l .L2" SYMBOL_STRING(cti_vm_throw) ",r0" "\n"
    90     "mov r15, r4" "\n"
    91     "mov.l @(r0,r12),r11" "\n"
    92     "jsr @r11" "\n"
    93     "nop" "\n"
    94     "add #" STRINGIZE_VALUE_OF(SAVED_R8_OFFSET) ", r15" "\n"
    95     "mov.l @r15+,r8" "\n"
    96     "mov.l @r15+,r9" "\n"
    97     "mov.l @r15+,r10" "\n"
    98     "mov.l @r15+,r11" "\n"
    99     "mov.l @r15+,r13" "\n"
    100     "lds.l @r15+,pr" "\n"
    101     "mov.l @r15+,r14" "\n"
    102     "add #12, r15" "\n"
    103     "rts" "\n"
    104     "nop" "\n"
    105     ".align 2" "\n"
    106     ".L2" SYMBOL_STRING(cti_vm_throw) ":.long " SYMBOL_STRING(cti_vm_throw) "@GOT \n"
    107 );
    108 
    109 asm volatile (
    11086".globl " SYMBOL_STRING(ctiVMHandleException) "\n"
    11187HIDE_SYMBOL(ctiVMHandleException) "\n"
  • trunk/Source/JavaScriptCore/jit/JITStubsX86.h

    r157571 r157581  
    7878
    7979asm (
    80 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
    81 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
    82 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
    83     "movl %esp, %ecx" "\n"
    84     "call " LOCAL_REFERENCE(cti_vm_throw) "\n"
    85     "int3" "\n"
    86 );
    87 
    88 asm (
    8980".globl " SYMBOL_STRING(ctiVMHandleException) "\n"
    9081HIDE_SYMBOL(ctiVMHandleException) "\n"
     
    295286    }
    296287
    297     __declspec(naked) void ctiVMThrowTrampoline()
    298     {
    299         __asm {
    300             mov ecx, esp;
    301             call cti_vm_throw;
    302             int 3;
    303         }
    304     }
    305 
    306288    __declspec(naked) void ctiVMHandleException()
    307289    {
  • trunk/Source/JavaScriptCore/jit/JITStubsX86_64.h

    r157571 r157581  
    9191
    9292asm (
    93 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
    94 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
    95 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
    96     "movq %rsp, %rdi" "\n"
    97     "call " LOCAL_REFERENCE(cti_vm_throw) "\n"
    98     "int3" "\n"
    99 );
    100 
    101 asm (
    10293".globl " SYMBOL_STRING(ctiVMHandleException) "\n"
    10394HIDE_SYMBOL(ctiVMHandleException) "\n"
  • trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h

    r157546 r157581  
    6363#if CPU(X86_64)
    6464        static const RegisterID returnValueRegister = X86Registers::eax;
     65        static const RegisterID returnValue2Register = X86Registers::edx;
    6566        static const RegisterID cachedResultRegister = X86Registers::eax;
    6667#if !OS(WINDOWS)
Note: See TracChangeset for help on using the changeset viewer.