Changeset 43362 in webkit for trunk/JavaScriptCore/jit


Ignore:
Timestamp:
May 7, 2009, 1:22:55 PM (16 years ago)
Author:
[email protected]
Message:

2009-05-07 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.


Added the return address of a stub function to the JITStackFrame abstraction.

  • jit/JIT.cpp:
  • jit/JIT.h:
  • jit/JITStubs.cpp: (JSC::): (JSC::StackHack::StackHack): (JSC::StackHack::~StackHack): (JSC::returnToThrowTrampoline): (JSC::JITStubs::cti_op_convert_this): (JSC::JITStubs::cti_op_end): (JSC::JITStubs::cti_op_add): (JSC::JITStubs::cti_op_pre_inc): (JSC::JITStubs::cti_timeout_check): (JSC::JITStubs::cti_register_file_check): (JSC::JITStubs::cti_op_loop_if_less): (JSC::JITStubs::cti_op_loop_if_lesseq): (JSC::JITStubs::cti_op_new_object): (JSC::JITStubs::cti_op_put_by_id_generic): (JSC::JITStubs::cti_op_get_by_id_generic): (JSC::JITStubs::cti_op_put_by_id): (JSC::JITStubs::cti_op_put_by_id_second): (JSC::JITStubs::cti_op_put_by_id_fail): (JSC::JITStubs::cti_op_get_by_id): (JSC::JITStubs::cti_op_get_by_id_second): (JSC::JITStubs::cti_op_get_by_id_self_fail): (JSC::JITStubs::cti_op_get_by_id_proto_list): (JSC::JITStubs::cti_op_get_by_id_proto_list_full): (JSC::JITStubs::cti_op_get_by_id_proto_fail): (JSC::JITStubs::cti_op_get_by_id_array_fail): (JSC::JITStubs::cti_op_get_by_id_string_fail): (JSC::JITStubs::cti_op_instanceof): (JSC::JITStubs::cti_op_del_by_id): (JSC::JITStubs::cti_op_mul): (JSC::JITStubs::cti_op_new_func): (JSC::JITStubs::cti_op_call_JSFunction): (JSC::JITStubs::cti_op_call_arityCheck): (JSC::JITStubs::cti_vm_dontLazyLinkCall): (JSC::JITStubs::cti_vm_lazyLinkCall): (JSC::JITStubs::cti_op_push_activation): (JSC::JITStubs::cti_op_call_NotJSFunction): (JSC::JITStubs::cti_op_create_arguments): (JSC::JITStubs::cti_op_create_arguments_no_params): (JSC::JITStubs::cti_op_tear_off_activation): (JSC::JITStubs::cti_op_tear_off_arguments): (JSC::JITStubs::cti_op_profile_will_call): (JSC::JITStubs::cti_op_profile_did_call): (JSC::JITStubs::cti_op_ret_scopeChain): (JSC::JITStubs::cti_op_new_array): (JSC::JITStubs::cti_op_resolve): (JSC::JITStubs::cti_op_construct_JSConstruct): (JSC::JITStubs::cti_op_construct_NotJSConstruct): (JSC::JITStubs::cti_op_get_by_val): (JSC::JITStubs::cti_op_get_by_val_string): (JSC::JITStubs::cti_op_get_by_val_byte_array): (JSC::JITStubs::cti_op_resolve_func): (JSC::JITStubs::cti_op_sub): (JSC::JITStubs::cti_op_put_by_val): (JSC::JITStubs::cti_op_put_by_val_array): (JSC::JITStubs::cti_op_put_by_val_byte_array): (JSC::JITStubs::cti_op_lesseq): (JSC::JITStubs::cti_op_loop_if_true): (JSC::JITStubs::cti_op_load_varargs): (JSC::JITStubs::cti_op_negate): (JSC::JITStubs::cti_op_resolve_base): (JSC::JITStubs::cti_op_resolve_skip): (JSC::JITStubs::cti_op_resolve_global): (JSC::JITStubs::cti_op_div): (JSC::JITStubs::cti_op_pre_dec): (JSC::JITStubs::cti_op_jless): (JSC::JITStubs::cti_op_not): (JSC::JITStubs::cti_op_jtrue): (JSC::JITStubs::cti_op_post_inc): (JSC::JITStubs::cti_op_eq): (JSC::JITStubs::cti_op_lshift): (JSC::JITStubs::cti_op_bitand): (JSC::JITStubs::cti_op_rshift): (JSC::JITStubs::cti_op_bitnot): (JSC::JITStubs::cti_op_resolve_with_base): (JSC::JITStubs::cti_op_new_func_exp): (JSC::JITStubs::cti_op_mod): (JSC::JITStubs::cti_op_less): (JSC::JITStubs::cti_op_neq): (JSC::JITStubs::cti_op_post_dec): (JSC::JITStubs::cti_op_urshift): (JSC::JITStubs::cti_op_bitxor): (JSC::JITStubs::cti_op_new_regexp): (JSC::JITStubs::cti_op_bitor): (JSC::JITStubs::cti_op_call_eval): (JSC::JITStubs::cti_op_throw): (JSC::JITStubs::cti_op_get_pnames): (JSC::JITStubs::cti_op_next_pname): (JSC::JITStubs::cti_op_push_scope): (JSC::JITStubs::cti_op_pop_scope): (JSC::JITStubs::cti_op_typeof): (JSC::JITStubs::cti_op_is_undefined): (JSC::JITStubs::cti_op_is_boolean): (JSC::JITStubs::cti_op_is_number): (JSC::JITStubs::cti_op_is_string): (JSC::JITStubs::cti_op_is_object): (JSC::JITStubs::cti_op_is_function): (JSC::JITStubs::cti_op_stricteq): (JSC::JITStubs::cti_op_to_primitive): (JSC::JITStubs::cti_op_strcat): (JSC::JITStubs::cti_op_nstricteq): (JSC::JITStubs::cti_op_to_jsnumber): (JSC::JITStubs::cti_op_in): (JSC::JITStubs::cti_op_push_new_scope): (JSC::JITStubs::cti_op_jmp_scopes): (JSC::JITStubs::cti_op_put_by_index): (JSC::JITStubs::cti_op_switch_imm): (JSC::JITStubs::cti_op_switch_char): (JSC::JITStubs::cti_op_switch_string): (JSC::JITStubs::cti_op_del_by_val): (JSC::JITStubs::cti_op_put_getter): (JSC::JITStubs::cti_op_put_setter): (JSC::JITStubs::cti_op_new_error): (JSC::JITStubs::cti_op_debug): (JSC::JITStubs::cti_vm_throw):
  • jit/JITStubs.h: (JSC::JITStackFrame::returnAddressSlot):
Location:
trunk/JavaScriptCore/jit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JIT.cpp

    r43352 r43362  
    4545namespace JSC {
    4646
    47 void ctiSetReturnAddress(void** addressOfReturnAddress, void* newDestinationToReturnTo)
    48 {
    49     *addressOfReturnAddress = newDestinationToReturnTo;
    50 }
    51 
    5247void ctiPatchCallByReturnAddress(MacroAssembler::ProcessorReturnAddress returnAddress, void* newCalleeFunction)
    5348{
  • trunk/JavaScriptCore/jit/JIT.h

    r43334 r43362  
    156156    };
    157157
    158     void ctiSetReturnAddress(void** addressOfReturnAddress, void* newDestinationToReturnTo);
    159158    void ctiPatchCallByReturnAddress(MacroAssembler::ProcessorReturnAddress returnAddress, void* newCalleeFunction);
    160159    void ctiPatchNearCallByReturnAddress(MacroAssembler::ProcessorReturnAddress returnAddress, void* newCalleeFunction);
  • trunk/JavaScriptCore/jit/JITStubs.cpp

    r43334 r43362  
    390390static void jscGeneratedNativeCode()
    391391{
    392     // When executing a CTI function (which might do an allocation), we hack the return address
     392    // When executing a JIT stub function (which might do an allocation), we hack the return address
    393393    // to pretend to be executing this function, to keep stack logging tools from blowing out
    394394    // memory.
     
    398398
    399399struct StackHack {
    400     ALWAYS_INLINE StackHack(void** location)
    401     {
    402         returnAddressLocation = location;
    403         savedReturnAddress = *returnAddressLocation;
    404         ctiSetReturnAddress(returnAddressLocation, reinterpret_cast<void*>(jscGeneratedNativeCode));
    405     }
     400    ALWAYS_INLINE StackHack(JITStackFrame& stackFrame)
     401        : stackFrame(stackFrame)
     402    {
     403        savedReturnAddress = *stackFrame.returnAddressSlot();
     404        *stackFrame.returnAddressSlot() = reinterpret_cast<void*>(jscGeneratedNativeCode);
     405    }
     406
    406407    ALWAYS_INLINE ~StackHack()
    407408    {
    408         ctiSetReturnAddress(returnAddressLocation, savedReturnAddress);
    409     }
    410 
    411     void** returnAddressLocation;
     409        *stackFrame.returnAddressSlot() = savedReturnAddress;
     410    }
     411
     412    JITStackFrame& stackFrame;
    412413    void* savedReturnAddress;
    413414};
    414415
    415 #define BEGIN_STUB_FUNCTION() SETUP_VA_LISTL_ARGS; StackHack stackHack(&STUB_RETURN_ADDRESS_SLOT)
    416 #define STUB_SET_RETURN_ADDRESS(address) stackHack.savedReturnAddress = address
     416#define STUB_INIT_STACK_FRAME(stackFrame) SETUP_VA_LISTL_ARGS; JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS); StackHack stackHack(stackFrame);
     417#define STUB_SET_RETURN_ADDRESS(returnAddress) stackHack.savedReturnAddress = returnAddress
    417418#define STUB_RETURN_ADDRESS stackHack.savedReturnAddress
    418419
    419420#else
    420421
    421 #define BEGIN_STUB_FUNCTION() SETUP_VA_LISTL_ARGS
    422 #define STUB_SET_RETURN_ADDRESS(address) ctiSetReturnAddress(&STUB_RETURN_ADDRESS_SLOT, address);
    423 #define STUB_RETURN_ADDRESS STUB_RETURN_ADDRESS_SLOT
     422#define STUB_INIT_STACK_FRAME(stackFrame) SETUP_VA_LISTL_ARGS; JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     423#define STUB_SET_RETURN_ADDRESS(returnAddress) *stackFrame.returnAddressSlot() = returnAddress;
     424#define STUB_RETURN_ADDRESS *stackFrame.returnAddressSlot()
    424425
    425426#endif
     
    433434    ASSERT(globalData->exception);
    434435    globalData->exceptionLocation = exceptionLocation;
    435     ctiSetReturnAddress(&returnAddressSlot, reinterpret_cast<void*>(ctiVMThrowTrampoline));
     436    returnAddressSlot = reinterpret_cast<void*>(ctiVMThrowTrampoline);
    436437}
    437438
     
    473474    } while (0)
    474475
     476
    475477JSObject* JITStubs::cti_op_convert_this(STUB_ARGS_DECLARATION)
    476478{
    477     BEGIN_STUB_FUNCTION();
    478     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     479    STUB_INIT_STACK_FRAME(stackFrame);
    479480
    480481    JSValue v1 = stackFrame.args[0].jsValue();
     
    488489void JITStubs::cti_op_end(STUB_ARGS_DECLARATION)
    489490{
    490     BEGIN_STUB_FUNCTION();
    491     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     491    STUB_INIT_STACK_FRAME(stackFrame);
    492492
    493493    ScopeChainNode* scopeChain = stackFrame.callFrame->scopeChain();
     
    498498EncodedJSValue JITStubs::cti_op_add(STUB_ARGS_DECLARATION)
    499499{
    500     BEGIN_STUB_FUNCTION();
    501     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     500    STUB_INIT_STACK_FRAME(stackFrame);
    502501
    503502    JSValue v1 = stackFrame.args[0].jsValue();
     
    544543EncodedJSValue JITStubs::cti_op_pre_inc(STUB_ARGS_DECLARATION)
    545544{
    546     BEGIN_STUB_FUNCTION();
    547     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     545    STUB_INIT_STACK_FRAME(stackFrame);
    548546
    549547    JSValue v = stackFrame.args[0].jsValue();
     
    557555int JITStubs::cti_timeout_check(STUB_ARGS_DECLARATION)
    558556{
    559     BEGIN_STUB_FUNCTION();
    560     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     557    STUB_INIT_STACK_FRAME(stackFrame);
    561558   
    562559    JSGlobalData* globalData = stackFrame.globalData;
     
    573570void JITStubs::cti_register_file_check(STUB_ARGS_DECLARATION)
    574571{
    575     BEGIN_STUB_FUNCTION();
    576     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     572    STUB_INIT_STACK_FRAME(stackFrame);
    577573
    578574    if (LIKELY(stackFrame.registerFile->grow(stackFrame.callFrame + stackFrame.callFrame->codeBlock()->m_numCalleeRegisters)))
     
    588584int JITStubs::cti_op_loop_if_less(STUB_ARGS_DECLARATION)
    589585{
    590     BEGIN_STUB_FUNCTION();
    591     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     586    STUB_INIT_STACK_FRAME(stackFrame);
    592587
    593588    JSValue src1 = stackFrame.args[0].jsValue();
     
    602597int JITStubs::cti_op_loop_if_lesseq(STUB_ARGS_DECLARATION)
    603598{
    604     BEGIN_STUB_FUNCTION();
    605     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     599    STUB_INIT_STACK_FRAME(stackFrame);
    606600
    607601    JSValue src1 = stackFrame.args[0].jsValue();
     
    616610JSObject* JITStubs::cti_op_new_object(STUB_ARGS_DECLARATION)
    617611{
    618     BEGIN_STUB_FUNCTION();
    619     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     612    STUB_INIT_STACK_FRAME(stackFrame);
    620613
    621614    return constructEmptyObject(stackFrame.callFrame);
     
    624617void JITStubs::cti_op_put_by_id_generic(STUB_ARGS_DECLARATION)
    625618{
    626     BEGIN_STUB_FUNCTION();
    627     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     619    STUB_INIT_STACK_FRAME(stackFrame);
    628620
    629621    PutPropertySlot slot;
     
    634626EncodedJSValue JITStubs::cti_op_get_by_id_generic(STUB_ARGS_DECLARATION)
    635627{
    636     BEGIN_STUB_FUNCTION();
    637     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     628    STUB_INIT_STACK_FRAME(stackFrame);
    638629
    639630    CallFrame* callFrame = stackFrame.callFrame;
     
    652643void JITStubs::cti_op_put_by_id(STUB_ARGS_DECLARATION)
    653644{
    654     BEGIN_STUB_FUNCTION();
    655     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     645    STUB_INIT_STACK_FRAME(stackFrame);
    656646
    657647    CallFrame* callFrame = stackFrame.callFrame;
     
    668658void JITStubs::cti_op_put_by_id_second(STUB_ARGS_DECLARATION)
    669659{
    670     BEGIN_STUB_FUNCTION();
    671     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     660    STUB_INIT_STACK_FRAME(stackFrame);
    672661
    673662    PutPropertySlot slot;
     
    679668void JITStubs::cti_op_put_by_id_fail(STUB_ARGS_DECLARATION)
    680669{
    681     BEGIN_STUB_FUNCTION();
    682     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     670    STUB_INIT_STACK_FRAME(stackFrame);
    683671
    684672    CallFrame* callFrame = stackFrame.callFrame;
     
    693681EncodedJSValue JITStubs::cti_op_get_by_id(STUB_ARGS_DECLARATION)
    694682{
    695     BEGIN_STUB_FUNCTION();
    696     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     683    STUB_INIT_STACK_FRAME(stackFrame);
    697684
    698685    CallFrame* callFrame = stackFrame.callFrame;
     
    711698EncodedJSValue JITStubs::cti_op_get_by_id_second(STUB_ARGS_DECLARATION)
    712699{
    713     BEGIN_STUB_FUNCTION();
    714     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     700    STUB_INIT_STACK_FRAME(stackFrame);
    715701
    716702    CallFrame* callFrame = stackFrame.callFrame;
     
    729715EncodedJSValue JITStubs::cti_op_get_by_id_self_fail(STUB_ARGS_DECLARATION)
    730716{
    731     BEGIN_STUB_FUNCTION();
    732     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     717    STUB_INIT_STACK_FRAME(stackFrame);
    733718
    734719    CallFrame* callFrame = stackFrame.callFrame;
     
    805790EncodedJSValue JITStubs::cti_op_get_by_id_proto_list(STUB_ARGS_DECLARATION)
    806791{
    807     BEGIN_STUB_FUNCTION();
    808     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     792    STUB_INIT_STACK_FRAME(stackFrame);
    809793
    810794    CallFrame* callFrame = stackFrame.callFrame;
     
    858842EncodedJSValue JITStubs::cti_op_get_by_id_proto_list_full(STUB_ARGS_DECLARATION)
    859843{
    860     BEGIN_STUB_FUNCTION();
    861     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     844    STUB_INIT_STACK_FRAME(stackFrame);
    862845
    863846    JSValue baseValue = stackFrame.args[0].jsValue();
     
    871854EncodedJSValue JITStubs::cti_op_get_by_id_proto_fail(STUB_ARGS_DECLARATION)
    872855{
    873     BEGIN_STUB_FUNCTION();
    874     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     856    STUB_INIT_STACK_FRAME(stackFrame);
    875857
    876858    JSValue baseValue = stackFrame.args[0].jsValue();
     
    884866EncodedJSValue JITStubs::cti_op_get_by_id_array_fail(STUB_ARGS_DECLARATION)
    885867{
    886     BEGIN_STUB_FUNCTION();
    887     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     868    STUB_INIT_STACK_FRAME(stackFrame);
    888869
    889870    JSValue baseValue = stackFrame.args[0].jsValue();
     
    897878EncodedJSValue JITStubs::cti_op_get_by_id_string_fail(STUB_ARGS_DECLARATION)
    898879{
    899     BEGIN_STUB_FUNCTION();
    900     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     880    STUB_INIT_STACK_FRAME(stackFrame);
    901881
    902882    JSValue baseValue = stackFrame.args[0].jsValue();
     
    912892EncodedJSValue JITStubs::cti_op_instanceof(STUB_ARGS_DECLARATION)
    913893{
    914     BEGIN_STUB_FUNCTION();
    915     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     894    STUB_INIT_STACK_FRAME(stackFrame);
    916895
    917896    CallFrame* callFrame = stackFrame.callFrame;
     
    956935EncodedJSValue JITStubs::cti_op_del_by_id(STUB_ARGS_DECLARATION)
    957936{
    958     BEGIN_STUB_FUNCTION();
    959     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     937    STUB_INIT_STACK_FRAME(stackFrame);
    960938
    961939    CallFrame* callFrame = stackFrame.callFrame;
     
    970948EncodedJSValue JITStubs::cti_op_mul(STUB_ARGS_DECLARATION)
    971949{
    972     BEGIN_STUB_FUNCTION();
    973     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     950    STUB_INIT_STACK_FRAME(stackFrame);
    974951
    975952    JSValue src1 = stackFrame.args[0].jsValue();
     
    989966JSObject* JITStubs::cti_op_new_func(STUB_ARGS_DECLARATION)
    990967{
    991     BEGIN_STUB_FUNCTION();
    992     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     968    STUB_INIT_STACK_FRAME(stackFrame);
    993969
    994970    return stackFrame.args[0].funcDeclNode()->makeFunction(stackFrame.callFrame, stackFrame.callFrame->scopeChain());
     
    997973void* JITStubs::cti_op_call_JSFunction(STUB_ARGS_DECLARATION)
    998974{
    999     BEGIN_STUB_FUNCTION();
    1000     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     975    STUB_INIT_STACK_FRAME(stackFrame);
    1001976
    1002977#ifndef NDEBUG
     
    1015990VoidPtrPair JITStubs::cti_op_call_arityCheck(STUB_ARGS_DECLARATION)
    1016991{
    1017     BEGIN_STUB_FUNCTION();
    1018     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     992    STUB_INIT_STACK_FRAME(stackFrame);
    1019993
    1020994    CallFrame* callFrame = stackFrame.callFrame;
     
    10611035void* JITStubs::cti_vm_dontLazyLinkCall(STUB_ARGS_DECLARATION)
    10621036{
    1063     BEGIN_STUB_FUNCTION();
    1064     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1037    STUB_INIT_STACK_FRAME(stackFrame);
    10651038
    10661039    JSGlobalData* globalData = stackFrame.globalData;
     
    10761049void* JITStubs::cti_vm_lazyLinkCall(STUB_ARGS_DECLARATION)
    10771050{
    1078     BEGIN_STUB_FUNCTION();
    1079     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1051    STUB_INIT_STACK_FRAME(stackFrame);
    10801052
    10811053    JSFunction* callee = asFunction(stackFrame.args[0].jsValue());
     
    10951067JSObject* JITStubs::cti_op_push_activation(STUB_ARGS_DECLARATION)
    10961068{
    1097     BEGIN_STUB_FUNCTION();
    1098     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1069    STUB_INIT_STACK_FRAME(stackFrame);
    10991070
    11001071    JSActivation* activation = new (stackFrame.globalData) JSActivation(stackFrame.callFrame, static_cast<FunctionBodyNode*>(stackFrame.callFrame->codeBlock()->ownerNode()));
     
    11051076EncodedJSValue JITStubs::cti_op_call_NotJSFunction(STUB_ARGS_DECLARATION)
    11061077{
    1107     BEGIN_STUB_FUNCTION();
    1108     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1078    STUB_INIT_STACK_FRAME(stackFrame);
    11091079
    11101080    JSValue funcVal = stackFrame.args[0].jsValue();
     
    11551125void JITStubs::cti_op_create_arguments(STUB_ARGS_DECLARATION)
    11561126{
    1157     BEGIN_STUB_FUNCTION();
    1158     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1127    STUB_INIT_STACK_FRAME(stackFrame);
    11591128
    11601129    Arguments* arguments = new (stackFrame.globalData) Arguments(stackFrame.callFrame);
     
    11651134void JITStubs::cti_op_create_arguments_no_params(STUB_ARGS_DECLARATION)
    11661135{
    1167     BEGIN_STUB_FUNCTION();
    1168     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1136    STUB_INIT_STACK_FRAME(stackFrame);
    11691137
    11701138    Arguments* arguments = new (stackFrame.globalData) Arguments(stackFrame.callFrame, Arguments::NoParameters);
     
    11751143void JITStubs::cti_op_tear_off_activation(STUB_ARGS_DECLARATION)
    11761144{
    1177     BEGIN_STUB_FUNCTION();
    1178     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1145    STUB_INIT_STACK_FRAME(stackFrame);
    11791146
    11801147    ASSERT(stackFrame.callFrame->codeBlock()->needsFullScopeChain());
     
    11841151void JITStubs::cti_op_tear_off_arguments(STUB_ARGS_DECLARATION)
    11851152{
    1186     BEGIN_STUB_FUNCTION();
    1187     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1153    STUB_INIT_STACK_FRAME(stackFrame);
    11881154
    11891155    ASSERT(stackFrame.callFrame->codeBlock()->usesArguments() && !stackFrame.callFrame->codeBlock()->needsFullScopeChain());
     
    11931159void JITStubs::cti_op_profile_will_call(STUB_ARGS_DECLARATION)
    11941160{
    1195     BEGIN_STUB_FUNCTION();
    1196     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1161    STUB_INIT_STACK_FRAME(stackFrame);
    11971162
    11981163    ASSERT(*stackFrame.enabledProfilerReference);
     
    12021167void JITStubs::cti_op_profile_did_call(STUB_ARGS_DECLARATION)
    12031168{
    1204     BEGIN_STUB_FUNCTION();
    1205     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1169    STUB_INIT_STACK_FRAME(stackFrame);
    12061170
    12071171    ASSERT(*stackFrame.enabledProfilerReference);
     
    12111175void JITStubs::cti_op_ret_scopeChain(STUB_ARGS_DECLARATION)
    12121176{
    1213     BEGIN_STUB_FUNCTION();
    1214     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1177    STUB_INIT_STACK_FRAME(stackFrame);
    12151178
    12161179    ASSERT(stackFrame.callFrame->codeBlock()->needsFullScopeChain());
     
    12201183JSObject* JITStubs::cti_op_new_array(STUB_ARGS_DECLARATION)
    12211184{
    1222     BEGIN_STUB_FUNCTION();
    1223     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1185    STUB_INIT_STACK_FRAME(stackFrame);
    12241186
    12251187    ArgList argList(&stackFrame.callFrame->registers()[stackFrame.args[0].int32()], stackFrame.args[1].int32());
     
    12291191EncodedJSValue JITStubs::cti_op_resolve(STUB_ARGS_DECLARATION)
    12301192{
    1231     BEGIN_STUB_FUNCTION();
    1232     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1193    STUB_INIT_STACK_FRAME(stackFrame);
    12331194
    12341195    CallFrame* callFrame = stackFrame.callFrame;
     
    12581219JSObject* JITStubs::cti_op_construct_JSConstruct(STUB_ARGS_DECLARATION)
    12591220{
    1260     BEGIN_STUB_FUNCTION();
    1261     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1221    STUB_INIT_STACK_FRAME(stackFrame);
    12621222
    12631223    JSFunction* constructor = asFunction(stackFrame.args[0].jsValue());
     
    12851245EncodedJSValue JITStubs::cti_op_construct_NotJSConstruct(STUB_ARGS_DECLARATION)
    12861246{
    1287     BEGIN_STUB_FUNCTION();
    1288     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1247    STUB_INIT_STACK_FRAME(stackFrame);
    12891248
    12901249    CallFrame* callFrame = stackFrame.callFrame;
     
    13201279EncodedJSValue JITStubs::cti_op_get_by_val(STUB_ARGS_DECLARATION)
    13211280{
    1322     BEGIN_STUB_FUNCTION();
    1323     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1281    STUB_INIT_STACK_FRAME(stackFrame);
    13241282
    13251283    CallFrame* callFrame = stackFrame.callFrame;
     
    13601318EncodedJSValue JITStubs::cti_op_get_by_val_string(STUB_ARGS_DECLARATION)
    13611319{
    1362     BEGIN_STUB_FUNCTION();
    1363     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1320    STUB_INIT_STACK_FRAME(stackFrame);
    13641321   
    13651322    CallFrame* callFrame = stackFrame.callFrame;
     
    13921349EncodedJSValue JITStubs::cti_op_get_by_val_byte_array(STUB_ARGS_DECLARATION)
    13931350{
    1394     BEGIN_STUB_FUNCTION();
    1395     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1351    STUB_INIT_STACK_FRAME(stackFrame);
    13961352   
    13971353    CallFrame* callFrame = stackFrame.callFrame;
     
    14241380VoidPtrPair JITStubs::cti_op_resolve_func(STUB_ARGS_DECLARATION)
    14251381{
    1426     BEGIN_STUB_FUNCTION();
    1427     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1382    STUB_INIT_STACK_FRAME(stackFrame);
    14281383
    14291384    CallFrame* callFrame = stackFrame.callFrame;
     
    14671422EncodedJSValue JITStubs::cti_op_sub(STUB_ARGS_DECLARATION)
    14681423{
    1469     BEGIN_STUB_FUNCTION();
    1470     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1424    STUB_INIT_STACK_FRAME(stackFrame);
    14711425
    14721426    JSValue src1 = stackFrame.args[0].jsValue();
     
    14861440void JITStubs::cti_op_put_by_val(STUB_ARGS_DECLARATION)
    14871441{
    1488     BEGIN_STUB_FUNCTION();
    1489     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1442    STUB_INIT_STACK_FRAME(stackFrame);
    14901443
    14911444    CallFrame* callFrame = stackFrame.callFrame;
     
    15351488void JITStubs::cti_op_put_by_val_array(STUB_ARGS_DECLARATION)
    15361489{
    1537     BEGIN_STUB_FUNCTION();
    1538     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1490    STUB_INIT_STACK_FRAME(stackFrame);
    15391491
    15401492    CallFrame* callFrame = stackFrame.callFrame;
     
    15631515void JITStubs::cti_op_put_by_val_byte_array(STUB_ARGS_DECLARATION)
    15641516{
    1565     BEGIN_STUB_FUNCTION();
    1566     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1517    STUB_INIT_STACK_FRAME(stackFrame);
    15671518   
    15681519    CallFrame* callFrame = stackFrame.callFrame;
     
    16071558EncodedJSValue JITStubs::cti_op_lesseq(STUB_ARGS_DECLARATION)
    16081559{
    1609     BEGIN_STUB_FUNCTION();
    1610     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1560    STUB_INIT_STACK_FRAME(stackFrame);
    16111561
    16121562    CallFrame* callFrame = stackFrame.callFrame;
     
    16181568int JITStubs::cti_op_loop_if_true(STUB_ARGS_DECLARATION)
    16191569{
    1620     BEGIN_STUB_FUNCTION();
    1621     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1570    STUB_INIT_STACK_FRAME(stackFrame);
    16221571
    16231572    JSValue src1 = stackFrame.args[0].jsValue();
     
    16321581int JITStubs::cti_op_load_varargs(STUB_ARGS_DECLARATION)
    16331582{
    1634     BEGIN_STUB_FUNCTION();
    1635     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1583    STUB_INIT_STACK_FRAME(stackFrame);
    16361584    CallFrame* callFrame = stackFrame.callFrame;
    16371585    RegisterFile* registerFile = stackFrame.registerFile;
     
    16931641EncodedJSValue JITStubs::cti_op_negate(STUB_ARGS_DECLARATION)
    16941642{
    1695     BEGIN_STUB_FUNCTION();
    1696     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1643    STUB_INIT_STACK_FRAME(stackFrame);
    16971644
    16981645    JSValue src = stackFrame.args[0].jsValue();
     
    17101657EncodedJSValue JITStubs::cti_op_resolve_base(STUB_ARGS_DECLARATION)
    17111658{
    1712     BEGIN_STUB_FUNCTION();
    1713     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1659    STUB_INIT_STACK_FRAME(stackFrame);
    17141660
    17151661    return JSValue::encode(JSC::resolveBase(stackFrame.callFrame, stackFrame.args[0].identifier(), stackFrame.callFrame->scopeChain()));
     
    17181664EncodedJSValue JITStubs::cti_op_resolve_skip(STUB_ARGS_DECLARATION)
    17191665{
    1720     BEGIN_STUB_FUNCTION();
    1721     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1666    STUB_INIT_STACK_FRAME(stackFrame);
    17221667
    17231668    CallFrame* callFrame = stackFrame.callFrame;
     
    17521697EncodedJSValue JITStubs::cti_op_resolve_global(STUB_ARGS_DECLARATION)
    17531698{
    1754     BEGIN_STUB_FUNCTION();
    1755     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1699    STUB_INIT_STACK_FRAME(stackFrame);
    17561700
    17571701    CallFrame* callFrame = stackFrame.callFrame;
     
    17851729EncodedJSValue JITStubs::cti_op_div(STUB_ARGS_DECLARATION)
    17861730{
    1787     BEGIN_STUB_FUNCTION();
    1788     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1731    STUB_INIT_STACK_FRAME(stackFrame);
    17891732
    17901733    JSValue src1 = stackFrame.args[0].jsValue();
     
    18041747EncodedJSValue JITStubs::cti_op_pre_dec(STUB_ARGS_DECLARATION)
    18051748{
    1806     BEGIN_STUB_FUNCTION();
    1807     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1749    STUB_INIT_STACK_FRAME(stackFrame);
    18081750
    18091751    JSValue v = stackFrame.args[0].jsValue();
     
    18171759int JITStubs::cti_op_jless(STUB_ARGS_DECLARATION)
    18181760{
    1819     BEGIN_STUB_FUNCTION();
    1820     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1761    STUB_INIT_STACK_FRAME(stackFrame);
    18211762
    18221763    JSValue src1 = stackFrame.args[0].jsValue();
     
    18311772EncodedJSValue JITStubs::cti_op_not(STUB_ARGS_DECLARATION)
    18321773{
    1833     BEGIN_STUB_FUNCTION();
    1834     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1774    STUB_INIT_STACK_FRAME(stackFrame);
    18351775
    18361776    JSValue src = stackFrame.args[0].jsValue();
     
    18451785int JITStubs::cti_op_jtrue(STUB_ARGS_DECLARATION)
    18461786{
    1847     BEGIN_STUB_FUNCTION();
    1848     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1787    STUB_INIT_STACK_FRAME(stackFrame);
    18491788
    18501789    JSValue src1 = stackFrame.args[0].jsValue();
     
    18591798VoidPtrPair JITStubs::cti_op_post_inc(STUB_ARGS_DECLARATION)
    18601799{
    1861     BEGIN_STUB_FUNCTION();
    1862     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1800    STUB_INIT_STACK_FRAME(stackFrame);
    18631801
    18641802    JSValue v = stackFrame.args[0].jsValue();
     
    18741812EncodedJSValue JITStubs::cti_op_eq(STUB_ARGS_DECLARATION)
    18751813{
    1876     BEGIN_STUB_FUNCTION();
    1877     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1814    STUB_INIT_STACK_FRAME(stackFrame);
    18781815
    18791816    JSValue src1 = stackFrame.args[0].jsValue();
     
    18901827EncodedJSValue JITStubs::cti_op_lshift(STUB_ARGS_DECLARATION)
    18911828{
    1892     BEGIN_STUB_FUNCTION();
    1893     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1829    STUB_INIT_STACK_FRAME(stackFrame);
    18941830
    18951831    JSValue val = stackFrame.args[0].jsValue();
     
    19111847EncodedJSValue JITStubs::cti_op_bitand(STUB_ARGS_DECLARATION)
    19121848{
    1913     BEGIN_STUB_FUNCTION();
    1914     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1849    STUB_INIT_STACK_FRAME(stackFrame);
    19151850
    19161851    JSValue src1 = stackFrame.args[0].jsValue();
     
    19301865EncodedJSValue JITStubs::cti_op_rshift(STUB_ARGS_DECLARATION)
    19311866{
    1932     BEGIN_STUB_FUNCTION();
    1933     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1867    STUB_INIT_STACK_FRAME(stackFrame);
    19341868
    19351869    JSValue val = stackFrame.args[0].jsValue();
     
    19511885EncodedJSValue JITStubs::cti_op_bitnot(STUB_ARGS_DECLARATION)
    19521886{
    1953     BEGIN_STUB_FUNCTION();
    1954     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1887    STUB_INIT_STACK_FRAME(stackFrame);
    19551888
    19561889    JSValue src = stackFrame.args[0].jsValue();
     
    19681901VoidPtrPair JITStubs::cti_op_resolve_with_base(STUB_ARGS_DECLARATION)
    19691902{
    1970     BEGIN_STUB_FUNCTION();
    1971     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1903    STUB_INIT_STACK_FRAME(stackFrame);
    19721904
    19731905    CallFrame* callFrame = stackFrame.callFrame;
     
    20031935JSObject* JITStubs::cti_op_new_func_exp(STUB_ARGS_DECLARATION)
    20041936{
    2005     BEGIN_STUB_FUNCTION();
    2006     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1937    STUB_INIT_STACK_FRAME(stackFrame);
    20071938
    20081939    return stackFrame.args[0].funcExprNode()->makeFunction(stackFrame.callFrame, stackFrame.callFrame->scopeChain());
     
    20111942EncodedJSValue JITStubs::cti_op_mod(STUB_ARGS_DECLARATION)
    20121943{
    2013     BEGIN_STUB_FUNCTION();
    2014     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1944    STUB_INIT_STACK_FRAME(stackFrame);
    20151945
    20161946    JSValue dividendValue = stackFrame.args[0].jsValue();
     
    20261956EncodedJSValue JITStubs::cti_op_less(STUB_ARGS_DECLARATION)
    20271957{
    2028     BEGIN_STUB_FUNCTION();
    2029     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1958    STUB_INIT_STACK_FRAME(stackFrame);
    20301959
    20311960    CallFrame* callFrame = stackFrame.callFrame;
     
    20371966EncodedJSValue JITStubs::cti_op_neq(STUB_ARGS_DECLARATION)
    20381967{
    2039     BEGIN_STUB_FUNCTION();
    2040     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1968    STUB_INIT_STACK_FRAME(stackFrame);
    20411969
    20421970    JSValue src1 = stackFrame.args[0].jsValue();
     
    20531981VoidPtrPair JITStubs::cti_op_post_dec(STUB_ARGS_DECLARATION)
    20541982{
    2055     BEGIN_STUB_FUNCTION();
    2056     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1983    STUB_INIT_STACK_FRAME(stackFrame);
    20571984
    20581985    JSValue v = stackFrame.args[0].jsValue();
     
    20681995EncodedJSValue JITStubs::cti_op_urshift(STUB_ARGS_DECLARATION)
    20691996{
    2070     BEGIN_STUB_FUNCTION();
    2071     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     1997    STUB_INIT_STACK_FRAME(stackFrame);
    20721998
    20731999    JSValue val = stackFrame.args[0].jsValue();
     
    20872013EncodedJSValue JITStubs::cti_op_bitxor(STUB_ARGS_DECLARATION)
    20882014{
    2089     BEGIN_STUB_FUNCTION();
    2090     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2015    STUB_INIT_STACK_FRAME(stackFrame);
    20912016
    20922017    JSValue src1 = stackFrame.args[0].jsValue();
     
    21022027JSObject* JITStubs::cti_op_new_regexp(STUB_ARGS_DECLARATION)
    21032028{
    2104     BEGIN_STUB_FUNCTION();
    2105     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2029    STUB_INIT_STACK_FRAME(stackFrame);
    21062030
    21072031    return new (stackFrame.globalData) RegExpObject(stackFrame.callFrame->lexicalGlobalObject()->regExpStructure(), stackFrame.args[0].regExp());
     
    21102034EncodedJSValue JITStubs::cti_op_bitor(STUB_ARGS_DECLARATION)
    21112035{
    2112     BEGIN_STUB_FUNCTION();
    2113     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2036    STUB_INIT_STACK_FRAME(stackFrame);
    21142037
    21152038    JSValue src1 = stackFrame.args[0].jsValue();
     
    21252048EncodedJSValue JITStubs::cti_op_call_eval(STUB_ARGS_DECLARATION)
    21262049{
    2127     BEGIN_STUB_FUNCTION();
    2128     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2050    STUB_INIT_STACK_FRAME(stackFrame);
    21292051
    21302052    CallFrame* callFrame = stackFrame.callFrame;
     
    21572079EncodedJSValue JITStubs::cti_op_throw(STUB_ARGS_DECLARATION)
    21582080{
    2159     BEGIN_STUB_FUNCTION();
    2160     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2081    STUB_INIT_STACK_FRAME(stackFrame);
    21612082
    21622083    CallFrame* callFrame = stackFrame.callFrame;
     
    21842105JSPropertyNameIterator* JITStubs::cti_op_get_pnames(STUB_ARGS_DECLARATION)
    21852106{
    2186     BEGIN_STUB_FUNCTION();
    2187     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2107    STUB_INIT_STACK_FRAME(stackFrame);
    21882108
    21892109    return JSPropertyNameIterator::create(stackFrame.callFrame, stackFrame.args[0].jsValue());
     
    21922112EncodedJSValue JITStubs::cti_op_next_pname(STUB_ARGS_DECLARATION)
    21932113{
    2194     BEGIN_STUB_FUNCTION();
    2195     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2114    STUB_INIT_STACK_FRAME(stackFrame);
    21962115
    21972116    JSPropertyNameIterator* it = stackFrame.args[0].propertyNameIterator();
     
    22042123JSObject* JITStubs::cti_op_push_scope(STUB_ARGS_DECLARATION)
    22052124{
    2206     BEGIN_STUB_FUNCTION();
    2207     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2125    STUB_INIT_STACK_FRAME(stackFrame);
    22082126
    22092127    JSObject* o = stackFrame.args[0].jsValue().toObject(stackFrame.callFrame);
     
    22152133void JITStubs::cti_op_pop_scope(STUB_ARGS_DECLARATION)
    22162134{
    2217     BEGIN_STUB_FUNCTION();
    2218     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2135    STUB_INIT_STACK_FRAME(stackFrame);
    22192136
    22202137    stackFrame.callFrame->setScopeChain(stackFrame.callFrame->scopeChain()->pop());
     
    22232140EncodedJSValue JITStubs::cti_op_typeof(STUB_ARGS_DECLARATION)
    22242141{
    2225     BEGIN_STUB_FUNCTION();
    2226     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2142    STUB_INIT_STACK_FRAME(stackFrame);
    22272143
    22282144    return JSValue::encode(jsTypeStringForValue(stackFrame.callFrame, stackFrame.args[0].jsValue()));
     
    22312147EncodedJSValue JITStubs::cti_op_is_undefined(STUB_ARGS_DECLARATION)
    22322148{
    2233     BEGIN_STUB_FUNCTION();
    2234     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2149    STUB_INIT_STACK_FRAME(stackFrame);
    22352150
    22362151    JSValue v = stackFrame.args[0].jsValue();
     
    22402155EncodedJSValue JITStubs::cti_op_is_boolean(STUB_ARGS_DECLARATION)
    22412156{
    2242     BEGIN_STUB_FUNCTION();
    2243     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2157    STUB_INIT_STACK_FRAME(stackFrame);
    22442158
    22452159    return JSValue::encode(jsBoolean(stackFrame.args[0].jsValue().isBoolean()));
     
    22482162EncodedJSValue JITStubs::cti_op_is_number(STUB_ARGS_DECLARATION)
    22492163{
    2250     BEGIN_STUB_FUNCTION();
    2251     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2164    STUB_INIT_STACK_FRAME(stackFrame);
    22522165
    22532166    return JSValue::encode(jsBoolean(stackFrame.args[0].jsValue().isNumber()));
     
    22562169EncodedJSValue JITStubs::cti_op_is_string(STUB_ARGS_DECLARATION)
    22572170{
    2258     BEGIN_STUB_FUNCTION();
    2259     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2171    STUB_INIT_STACK_FRAME(stackFrame);
    22602172
    22612173    return JSValue::encode(jsBoolean(isJSString(stackFrame.globalData, stackFrame.args[0].jsValue())));
     
    22642176EncodedJSValue JITStubs::cti_op_is_object(STUB_ARGS_DECLARATION)
    22652177{
    2266     BEGIN_STUB_FUNCTION();
    2267     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2178    STUB_INIT_STACK_FRAME(stackFrame);
    22682179
    22692180    return JSValue::encode(jsBoolean(jsIsObjectType(stackFrame.args[0].jsValue())));
     
    22722183EncodedJSValue JITStubs::cti_op_is_function(STUB_ARGS_DECLARATION)
    22732184{
    2274     BEGIN_STUB_FUNCTION();
    2275     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2185    STUB_INIT_STACK_FRAME(stackFrame);
    22762186
    22772187    return JSValue::encode(jsBoolean(jsIsFunctionType(stackFrame.args[0].jsValue())));
     
    22802190EncodedJSValue JITStubs::cti_op_stricteq(STUB_ARGS_DECLARATION)
    22812191{
    2282     BEGIN_STUB_FUNCTION();
    2283     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2192    STUB_INIT_STACK_FRAME(stackFrame);
    22842193
    22852194    JSValue src1 = stackFrame.args[0].jsValue();
     
    22912200EncodedJSValue JITStubs::cti_op_to_primitive(STUB_ARGS_DECLARATION)
    22922201{
    2293     BEGIN_STUB_FUNCTION();
    2294     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2202    STUB_INIT_STACK_FRAME(stackFrame);
    22952203
    22962204    return JSValue::encode(stackFrame.args[0].jsValue().toPrimitive(stackFrame.callFrame));
     
    22992207EncodedJSValue JITStubs::cti_op_strcat(STUB_ARGS_DECLARATION)
    23002208{
    2301     BEGIN_STUB_FUNCTION();
    2302     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2209    STUB_INIT_STACK_FRAME(stackFrame);
    23032210
    23042211    return JSValue::encode(concatenateStrings(stackFrame.callFrame, &stackFrame.callFrame->registers()[stackFrame.args[0].int32()], stackFrame.args[1].int32()));
     
    23072214EncodedJSValue JITStubs::cti_op_nstricteq(STUB_ARGS_DECLARATION)
    23082215{
    2309     BEGIN_STUB_FUNCTION();
    2310     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2216    STUB_INIT_STACK_FRAME(stackFrame);
    23112217
    23122218    JSValue src1 = stackFrame.args[0].jsValue();
     
    23182224EncodedJSValue JITStubs::cti_op_to_jsnumber(STUB_ARGS_DECLARATION)
    23192225{
    2320     BEGIN_STUB_FUNCTION();
    2321     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2226    STUB_INIT_STACK_FRAME(stackFrame);
    23222227
    23232228    JSValue src = stackFrame.args[0].jsValue();
     
    23312236EncodedJSValue JITStubs::cti_op_in(STUB_ARGS_DECLARATION)
    23322237{
    2333     BEGIN_STUB_FUNCTION();
    2334     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2238    STUB_INIT_STACK_FRAME(stackFrame);
    23352239
    23362240    CallFrame* callFrame = stackFrame.callFrame;
     
    23592263JSObject* JITStubs::cti_op_push_new_scope(STUB_ARGS_DECLARATION)
    23602264{
    2361     BEGIN_STUB_FUNCTION();
    2362     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2265    STUB_INIT_STACK_FRAME(stackFrame);
    23632266
    23642267    JSObject* scope = new (stackFrame.globalData) JSStaticScopeObject(stackFrame.callFrame, stackFrame.args[0].identifier(), stackFrame.args[1].jsValue(), DontDelete);
     
    23712274void JITStubs::cti_op_jmp_scopes(STUB_ARGS_DECLARATION)
    23722275{
    2373     BEGIN_STUB_FUNCTION();
    2374     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2276    STUB_INIT_STACK_FRAME(stackFrame);
    23752277
    23762278    unsigned count = stackFrame.args[0].int32();
     
    23852287void JITStubs::cti_op_put_by_index(STUB_ARGS_DECLARATION)
    23862288{
    2387     BEGIN_STUB_FUNCTION();
    2388     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2289    STUB_INIT_STACK_FRAME(stackFrame);
    23892290
    23902291    CallFrame* callFrame = stackFrame.callFrame;
     
    23962297void* JITStubs::cti_op_switch_imm(STUB_ARGS_DECLARATION)
    23972298{
    2398     BEGIN_STUB_FUNCTION();
    2399     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2299    STUB_INIT_STACK_FRAME(stackFrame);
    24002300
    24012301    JSValue scrutinee = stackFrame.args[0].jsValue();
     
    24182318void* JITStubs::cti_op_switch_char(STUB_ARGS_DECLARATION)
    24192319{
    2420     BEGIN_STUB_FUNCTION();
    2421     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2320    STUB_INIT_STACK_FRAME(stackFrame);
    24222321
    24232322    JSValue scrutinee = stackFrame.args[0].jsValue();
     
    24392338void* JITStubs::cti_op_switch_string(STUB_ARGS_DECLARATION)
    24402339{
    2441     BEGIN_STUB_FUNCTION();
    2442     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2340    STUB_INIT_STACK_FRAME(stackFrame);
    24432341
    24442342    JSValue scrutinee = stackFrame.args[0].jsValue();
     
    24592357EncodedJSValue JITStubs::cti_op_del_by_val(STUB_ARGS_DECLARATION)
    24602358{
    2461     BEGIN_STUB_FUNCTION();
    2462     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2359    STUB_INIT_STACK_FRAME(stackFrame);
    24632360
    24642361    CallFrame* callFrame = stackFrame.callFrame;
     
    24852382void JITStubs::cti_op_put_getter(STUB_ARGS_DECLARATION)
    24862383{
    2487     BEGIN_STUB_FUNCTION();
    2488     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2384    STUB_INIT_STACK_FRAME(stackFrame);
    24892385
    24902386    CallFrame* callFrame = stackFrame.callFrame;
     
    24982394void JITStubs::cti_op_put_setter(STUB_ARGS_DECLARATION)
    24992395{
    2500     BEGIN_STUB_FUNCTION();
    2501     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2396    STUB_INIT_STACK_FRAME(stackFrame);
    25022397
    25032398    CallFrame* callFrame = stackFrame.callFrame;
     
    25112406JSObject* JITStubs::cti_op_new_error(STUB_ARGS_DECLARATION)
    25122407{
    2513     BEGIN_STUB_FUNCTION();
    2514     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2408    STUB_INIT_STACK_FRAME(stackFrame);
    25152409
    25162410    CallFrame* callFrame = stackFrame.callFrame;
     
    25262420void JITStubs::cti_op_debug(STUB_ARGS_DECLARATION)
    25272421{
    2528     BEGIN_STUB_FUNCTION();
    2529     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2422    STUB_INIT_STACK_FRAME(stackFrame);
    25302423
    25312424    CallFrame* callFrame = stackFrame.callFrame;
     
    25402433EncodedJSValue JITStubs::cti_vm_throw(STUB_ARGS_DECLARATION)
    25412434{
    2542     BEGIN_STUB_FUNCTION();
    2543     JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS);
     2435    STUB_INIT_STACK_FRAME(stackFrame);
    25442436
    25452437    CallFrame* callFrame = stackFrame.callFrame;
  • trunk/JavaScriptCore/jit/JITStubs.h

    r43352 r43362  
    8989        Profiler** enabledProfilerReference;
    9090        JSGlobalData* globalData;
     91
     92        // When JIT code makes a call, it pushes its return address just below the rest of the stack.
     93        void** returnAddressSlot() { return reinterpret_cast<void**>(this) - 1; }
    9194    };
    9295#else
     
    107110        Profiler** enabledProfilerReference;
    108111        JSGlobalData* globalData;
     112       
     113        // When JIT code makes a call, it pushes its return address just below the rest of the stack.
     114        void** returnAddressSlot() { return reinterpret_cast<void**>(this) - 1; }
    109115    };
    110116#endif
     
    112118#define STUB_ARGS_code (offsetof(struct JITStackFrame, code) / sizeof (void*))
    113119#define STUB_ARGS_callFrame (offsetof(struct JITStackFrame, callFrame) / sizeof (void*))
    114 
    115 #define STUB_RETURN_ADDRESS_SLOT (STUB_ARGS[-1])
    116120
    117121#if USE(JIT_STUB_ARGUMENT_VA_LIST)
Note: See TracChangeset for help on using the changeset viewer.