Ignore:
Timestamp:
Jun 1, 2009, 10:36:18 PM (16 years ago)
Author:
[email protected]
Message:

2009-06-01 Gavin Barraclough <[email protected]>

Reviewed by Olliej Hunt.

Change JITStub functions from being static members on the JITStub class to be
global extern "C" functions, and switch their the function signature declaration
in the definition of the functions to be C-macro generated. This makes it easier
to work with the stub functions from assembler code (since the names no longer
require mangling), and by delaring the functions with a macro we can look at
also auto-generating asm thunks to wrap the JITStub functions to perform the
work currently in 'restoreArgumentReference' (as a memory saving).

Making this change also forces us to be a bit more realistic about what is private
on the Register and CallFrame objects. Presently most everything on these classes
is private, and the classes have plenty of friends. We could befriend all the
global functions to perpetuate the delusion of encapsulation, but using friends is
a bit of a sledgehammer solution here - since friends can poke around with all of
the class's privates, and since all the major classes taht operate on Regsiters are
currently friends, right there is currently in practice very little protection at
all. Better to start removing friend delclarations, and exposing just the parts
that need to be exposed.

  • interpreter/CallFrame.h: (JSC::ExecState::returnPC): (JSC::ExecState::setCallerFrame): (JSC::ExecState::returnValueRegister): (JSC::ExecState::setArgumentCount): (JSC::ExecState::setCallee): (JSC::ExecState::setCodeBlock):
  • interpreter/Interpreter.h:
  • interpreter/Register.h: (JSC::Register::Register): (JSC::Register::i):
  • jit/JITStubs.cpp: (JSC::): (JSC::JITThunks::JITThunks): (JSC::JITThunks::tryCachePutByID): (JSC::JITThunks::tryCacheGetByID): (JSC::JITStubs::DEFINE_STUB_FUNCTION):
  • jit/JITStubs.h: (JSC::JITStubs::):
  • runtime/JSFunction.h: (JSC::JSFunction::nativeFunction): (JSC::JSFunction::classInfo):
  • runtime/JSGlobalData.h:
File:
1 edited

Legend:

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

    r44171 r44344  
    102102SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
    103103#if USE(JIT_STUB_ARGUMENT_VA_LIST)
    104     "call " SYMBOL_STRING(_ZN3JSC8JITStubs12cti_vm_throwEPvz) "\n"
     104    "call " SYMBOL_STRING(cti_vm_throw) "\n"
    105105#else
    106106#if USE(JIT_STUB_ARGUMENT_REGISTER)
     
    109109    "movl %esp, 0(%esp)" "\n"
    110110#endif
    111     "call " SYMBOL_STRING(_ZN3JSC8JITStubs12cti_vm_throwEPPv) "\n"
     111    "call " SYMBOL_STRING(cti_vm_throw) "\n"
    112112#endif
    113113    "addl $0x1c, %esp" "\n"
     
    164164#if USE(JIT_STUB_ARGUMENT_REGISTER)
    165165    "movq %rsp, %rdi" "\n"
    166     "call " SYMBOL_STRING(_ZN3JSC8JITStubs12cti_vm_throwEPPv) "\n"
     166    "call " SYMBOL_STRING(cti_vm_throw) "\n"
    167167#else // JIT_STUB_ARGUMENT_VA_LIST or JIT_STUB_ARGUMENT_STACK
    168168#error "JIT_STUB_ARGUMENT configuration not supported."
     
    218218#error "JIT_STUB_ARGUMENT configuration not supported."
    219219#endif
    220             call JSC::JITStubs::cti_vm_throw;
     220            call cti_vm_throw;
    221221            add esp, 0x1c;
    222222            pop ebx;
     
    238238#endif
    239239
    240 JITStubs::JITStubs(JSGlobalData* globalData)
     240JITThunks::JITThunks(JSGlobalData* globalData)
    241241    : m_ctiArrayLengthTrampoline(0)
    242242    , m_ctiStringLengthTrampoline(0)
     
    251251#if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
    252252
    253 NEVER_INLINE void JITStubs::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue baseValue, const PutPropertySlot& slot)
     253NEVER_INLINE void JITThunks::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue baseValue, const PutPropertySlot& slot)
    254254{
    255255    // The interpreter checks for recursion here; I do not believe this can occur in CTI.
     
    295295}
    296296
    297 NEVER_INLINE void JITStubs::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue baseValue, const Identifier& propertyName, const PropertySlot& slot)
     297NEVER_INLINE void JITThunks::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue baseValue, const Identifier& propertyName, const PropertySlot& slot)
    298298{
    299299    // FIXME: Write a test that proves we need to check for recursion here just
     
    469469    } while (0)
    470470
    471 
    472 JSObject* JITStubs::cti_op_convert_this(STUB_ARGS_DECLARATION)
     471namespace JITStubs {
     472
     473#define DEFINE_STUB_FUNCTION(rtype, op) rtype cti_##op(STUB_ARGS_DECLARATION)
     474
     475DEFINE_STUB_FUNCTION(JSObject*, op_convert_this)
    473476{
    474477    STUB_INIT_STACK_FRAME(stackFrame);
     
    482485}
    483486
    484 void JITStubs::cti_op_end(STUB_ARGS_DECLARATION)
     487DEFINE_STUB_FUNCTION(void, op_end)
    485488{
    486489    STUB_INIT_STACK_FRAME(stackFrame);
     
    491494}
    492495
    493 EncodedJSValue JITStubs::cti_op_add(STUB_ARGS_DECLARATION)
     496DEFINE_STUB_FUNCTION(EncodedJSValue, op_add)
    494497{
    495498    STUB_INIT_STACK_FRAME(stackFrame);
     
    536539}
    537540
    538 EncodedJSValue JITStubs::cti_op_pre_inc(STUB_ARGS_DECLARATION)
     541DEFINE_STUB_FUNCTION(EncodedJSValue, op_pre_inc)
    539542{
    540543    STUB_INIT_STACK_FRAME(stackFrame);
     
    548551}
    549552
    550 int JITStubs::cti_timeout_check(STUB_ARGS_DECLARATION)
     553DEFINE_STUB_FUNCTION(int, timeout_check)
    551554{
    552555    STUB_INIT_STACK_FRAME(stackFrame);
     
    563566}
    564567
    565 void JITStubs::cti_register_file_check(STUB_ARGS_DECLARATION)
    566 {
    567     STUB_INIT_STACK_FRAME(stackFrame);
    568 
    569     if (LIKELY(stackFrame.registerFile->grow(stackFrame.callFrame + stackFrame.callFrame->codeBlock()->m_numCalleeRegisters)))
     568DEFINE_STUB_FUNCTION(void, register_file_check)
     569{
     570    STUB_INIT_STACK_FRAME(stackFrame);
     571
     572    if (LIKELY(stackFrame.registerFile->grow(&stackFrame.callFrame->registers()[stackFrame.callFrame->codeBlock()->m_numCalleeRegisters])))
    570573        return;
    571574
     
    577580}
    578581
    579 int JITStubs::cti_op_loop_if_less(STUB_ARGS_DECLARATION)
     582DEFINE_STUB_FUNCTION(int, op_loop_if_less)
    580583{
    581584    STUB_INIT_STACK_FRAME(stackFrame);
     
    590593}
    591594
    592 int JITStubs::cti_op_loop_if_lesseq(STUB_ARGS_DECLARATION)
     595DEFINE_STUB_FUNCTION(int, op_loop_if_lesseq)
    593596{
    594597    STUB_INIT_STACK_FRAME(stackFrame);
     
    603606}
    604607
    605 JSObject* JITStubs::cti_op_new_object(STUB_ARGS_DECLARATION)
     608DEFINE_STUB_FUNCTION(JSObject*, op_new_object)
    606609{
    607610    STUB_INIT_STACK_FRAME(stackFrame);
     
    610613}
    611614
    612 void JITStubs::cti_op_put_by_id_generic(STUB_ARGS_DECLARATION)
     615DEFINE_STUB_FUNCTION(void, op_put_by_id_generic)
    613616{
    614617    STUB_INIT_STACK_FRAME(stackFrame);
     
    619622}
    620623
    621 EncodedJSValue JITStubs::cti_op_get_by_id_generic(STUB_ARGS_DECLARATION)
     624DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_generic)
    622625{
    623626    STUB_INIT_STACK_FRAME(stackFrame);
     
    636639#if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
    637640
    638 void JITStubs::cti_op_put_by_id(STUB_ARGS_DECLARATION)
     641DEFINE_STUB_FUNCTION(void, op_put_by_id)
    639642{
    640643    STUB_INIT_STACK_FRAME(stackFrame);
     
    651654}
    652655
    653 void JITStubs::cti_op_put_by_id_second(STUB_ARGS_DECLARATION)
     656DEFINE_STUB_FUNCTION(void, op_put_by_id_second)
    654657{
    655658    STUB_INIT_STACK_FRAME(stackFrame);
     
    657660    PutPropertySlot slot;
    658661    stackFrame.args[0].jsValue().put(stackFrame.callFrame, stackFrame.args[1].identifier(), stackFrame.args[2].jsValue(), slot);
    659     tryCachePutByID(stackFrame.callFrame, stackFrame.callFrame->codeBlock(), STUB_RETURN_ADDRESS, stackFrame.args[0].jsValue(), slot);
    660     CHECK_FOR_EXCEPTION_AT_END();
    661 }
    662 
    663 void JITStubs::cti_op_put_by_id_fail(STUB_ARGS_DECLARATION)
     662    JITThunks::tryCachePutByID(stackFrame.callFrame, stackFrame.callFrame->codeBlock(), STUB_RETURN_ADDRESS, stackFrame.args[0].jsValue(), slot);
     663    CHECK_FOR_EXCEPTION_AT_END();
     664}
     665
     666DEFINE_STUB_FUNCTION(void, op_put_by_id_fail)
    664667{
    665668    STUB_INIT_STACK_FRAME(stackFrame);
     
    674677}
    675678
    676 EncodedJSValue JITStubs::cti_op_get_by_id(STUB_ARGS_DECLARATION)
     679DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id)
    677680{
    678681    STUB_INIT_STACK_FRAME(stackFrame);
     
    691694}
    692695
    693 EncodedJSValue JITStubs::cti_op_get_by_id_method_check(STUB_ARGS_DECLARATION)
     696DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_method_check)
    694697{
    695698    STUB_INIT_STACK_FRAME(stackFrame);
     
    708711}
    709712
    710 EncodedJSValue JITStubs::cti_op_get_by_id_method_check_second(STUB_ARGS_DECLARATION)
     713DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_method_check_second)
    711714{
    712715    STUB_INIT_STACK_FRAME(stackFrame);
     
    773776}
    774777
    775 EncodedJSValue JITStubs::cti_op_get_by_id_second(STUB_ARGS_DECLARATION)
     778DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_second)
    776779{
    777780    STUB_INIT_STACK_FRAME(stackFrame);
     
    784787    JSValue result = baseValue.get(callFrame, ident, slot);
    785788
    786     tryCacheGetByID(callFrame, callFrame->codeBlock(), STUB_RETURN_ADDRESS, baseValue, ident, slot);
    787 
    788     CHECK_FOR_EXCEPTION_AT_END();
    789     return JSValue::encode(result);
    790 }
    791 
    792 EncodedJSValue JITStubs::cti_op_get_by_id_self_fail(STUB_ARGS_DECLARATION)
     789    JITThunks::tryCacheGetByID(callFrame, callFrame->codeBlock(), STUB_RETURN_ADDRESS, baseValue, ident, slot);
     790
     791    CHECK_FOR_EXCEPTION_AT_END();
     792    return JSValue::encode(result);
     793}
     794
     795DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_self_fail)
    793796{
    794797    STUB_INIT_STACK_FRAME(stackFrame);
     
    865868}
    866869
    867 EncodedJSValue JITStubs::cti_op_get_by_id_proto_list(STUB_ARGS_DECLARATION)
     870DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_proto_list)
    868871{
    869872    STUB_INIT_STACK_FRAME(stackFrame);
     
    917920}
    918921
    919 EncodedJSValue JITStubs::cti_op_get_by_id_proto_list_full(STUB_ARGS_DECLARATION)
     922DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_proto_list_full)
    920923{
    921924    STUB_INIT_STACK_FRAME(stackFrame);
     
    929932}
    930933
    931 EncodedJSValue JITStubs::cti_op_get_by_id_proto_fail(STUB_ARGS_DECLARATION)
     934DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_proto_fail)
    932935{
    933936    STUB_INIT_STACK_FRAME(stackFrame);
     
    941944}
    942945
    943 EncodedJSValue JITStubs::cti_op_get_by_id_array_fail(STUB_ARGS_DECLARATION)
     946DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_array_fail)
    944947{
    945948    STUB_INIT_STACK_FRAME(stackFrame);
     
    953956}
    954957
    955 EncodedJSValue JITStubs::cti_op_get_by_id_string_fail(STUB_ARGS_DECLARATION)
     958DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_string_fail)
    956959{
    957960    STUB_INIT_STACK_FRAME(stackFrame);
     
    967970#endif
    968971
    969 EncodedJSValue JITStubs::cti_op_instanceof(STUB_ARGS_DECLARATION)
     972DEFINE_STUB_FUNCTION(EncodedJSValue, op_instanceof)
    970973{
    971974    STUB_INIT_STACK_FRAME(stackFrame);
     
    10101013}
    10111014
    1012 EncodedJSValue JITStubs::cti_op_del_by_id(STUB_ARGS_DECLARATION)
     1015DEFINE_STUB_FUNCTION(EncodedJSValue, op_del_by_id)
    10131016{
    10141017    STUB_INIT_STACK_FRAME(stackFrame);
     
    10231026}
    10241027
    1025 EncodedJSValue JITStubs::cti_op_mul(STUB_ARGS_DECLARATION)
     1028DEFINE_STUB_FUNCTION(EncodedJSValue, op_mul)
    10261029{
    10271030    STUB_INIT_STACK_FRAME(stackFrame);
     
    10411044}
    10421045
    1043 JSObject* JITStubs::cti_op_new_func(STUB_ARGS_DECLARATION)
     1046DEFINE_STUB_FUNCTION(JSObject*, op_new_func)
    10441047{
    10451048    STUB_INIT_STACK_FRAME(stackFrame);
     
    10481051}
    10491052
    1050 void* JITStubs::cti_op_call_JSFunction(STUB_ARGS_DECLARATION)
     1053DEFINE_STUB_FUNCTION(void*, op_call_JSFunction)
    10511054{
    10521055    STUB_INIT_STACK_FRAME(stackFrame);
     
    10651068}
    10661069
    1067 VoidPtrPair JITStubs::cti_op_call_arityCheck(STUB_ARGS_DECLARATION)
     1070DEFINE_STUB_FUNCTION(VoidPtrPair, op_call_arityCheck)
    10681071{
    10691072    STUB_INIT_STACK_FRAME(stackFrame);
     
    11101113}
    11111114
    1112 void* JITStubs::cti_vm_dontLazyLinkCall(STUB_ARGS_DECLARATION)
     1115DEFINE_STUB_FUNCTION(void*, vm_dontLazyLinkCall)
    11131116{
    11141117    STUB_INIT_STACK_FRAME(stackFrame);
     
    11221125}
    11231126
    1124 void* JITStubs::cti_vm_lazyLinkCall(STUB_ARGS_DECLARATION)
     1127DEFINE_STUB_FUNCTION(void*, vm_lazyLinkCall)
    11251128{
    11261129    STUB_INIT_STACK_FRAME(stackFrame);
     
    11391142}
    11401143
    1141 JSObject* JITStubs::cti_op_push_activation(STUB_ARGS_DECLARATION)
     1144DEFINE_STUB_FUNCTION(JSObject*, op_push_activation)
    11421145{
    11431146    STUB_INIT_STACK_FRAME(stackFrame);
     
    11481151}
    11491152
    1150 EncodedJSValue JITStubs::cti_op_call_NotJSFunction(STUB_ARGS_DECLARATION)
     1153DEFINE_STUB_FUNCTION(EncodedJSValue, op_call_NotJSFunction)
    11511154{
    11521155    STUB_INIT_STACK_FRAME(stackFrame);
     
    11971200}
    11981201
    1199 void JITStubs::cti_op_create_arguments(STUB_ARGS_DECLARATION)
     1202DEFINE_STUB_FUNCTION(void, op_create_arguments)
    12001203{
    12011204    STUB_INIT_STACK_FRAME(stackFrame);
     
    12061209}
    12071210
    1208 void JITStubs::cti_op_create_arguments_no_params(STUB_ARGS_DECLARATION)
     1211DEFINE_STUB_FUNCTION(void, op_create_arguments_no_params)
    12091212{
    12101213    STUB_INIT_STACK_FRAME(stackFrame);
     
    12151218}
    12161219
    1217 void JITStubs::cti_op_tear_off_activation(STUB_ARGS_DECLARATION)
     1220DEFINE_STUB_FUNCTION(void, op_tear_off_activation)
    12181221{
    12191222    STUB_INIT_STACK_FRAME(stackFrame);
     
    12231226}
    12241227
    1225 void JITStubs::cti_op_tear_off_arguments(STUB_ARGS_DECLARATION)
     1228DEFINE_STUB_FUNCTION(void, op_tear_off_arguments)
    12261229{
    12271230    STUB_INIT_STACK_FRAME(stackFrame);
     
    12321235}
    12331236
    1234 void JITStubs::cti_op_profile_will_call(STUB_ARGS_DECLARATION)
     1237DEFINE_STUB_FUNCTION(void, op_profile_will_call)
    12351238{
    12361239    STUB_INIT_STACK_FRAME(stackFrame);
     
    12401243}
    12411244
    1242 void JITStubs::cti_op_profile_did_call(STUB_ARGS_DECLARATION)
     1245DEFINE_STUB_FUNCTION(void, op_profile_did_call)
    12431246{
    12441247    STUB_INIT_STACK_FRAME(stackFrame);
     
    12481251}
    12491252
    1250 void JITStubs::cti_op_ret_scopeChain(STUB_ARGS_DECLARATION)
     1253DEFINE_STUB_FUNCTION(void, op_ret_scopeChain)
    12511254{
    12521255    STUB_INIT_STACK_FRAME(stackFrame);
     
    12561259}
    12571260
    1258 JSObject* JITStubs::cti_op_new_array(STUB_ARGS_DECLARATION)
     1261DEFINE_STUB_FUNCTION(JSObject*, op_new_array)
    12591262{
    12601263    STUB_INIT_STACK_FRAME(stackFrame);
     
    12641267}
    12651268
    1266 EncodedJSValue JITStubs::cti_op_resolve(STUB_ARGS_DECLARATION)
     1269DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve)
    12671270{
    12681271    STUB_INIT_STACK_FRAME(stackFrame);
     
    12921295}
    12931296
    1294 JSObject* JITStubs::cti_op_construct_JSConstruct(STUB_ARGS_DECLARATION)
     1297DEFINE_STUB_FUNCTION(JSObject*, op_construct_JSConstruct)
    12951298{
    12961299    STUB_INIT_STACK_FRAME(stackFrame);
     
    13181321}
    13191322
    1320 EncodedJSValue JITStubs::cti_op_construct_NotJSConstruct(STUB_ARGS_DECLARATION)
     1323DEFINE_STUB_FUNCTION(EncodedJSValue, op_construct_NotJSConstruct)
    13211324{
    13221325    STUB_INIT_STACK_FRAME(stackFrame);
     
    13521355}
    13531356
    1354 EncodedJSValue JITStubs::cti_op_get_by_val(STUB_ARGS_DECLARATION)
     1357DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_val)
    13551358{
    13561359    STUB_INIT_STACK_FRAME(stackFrame);
     
    13911394}
    13921395   
    1393 EncodedJSValue JITStubs::cti_op_get_by_val_string(STUB_ARGS_DECLARATION)
     1396DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_val_string)
    13941397{
    13951398    STUB_INIT_STACK_FRAME(stackFrame);
     
    14221425   
    14231426
    1424 EncodedJSValue JITStubs::cti_op_get_by_val_byte_array(STUB_ARGS_DECLARATION)
     1427DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_val_byte_array)
    14251428{
    14261429    STUB_INIT_STACK_FRAME(stackFrame);
     
    14531456}
    14541457
    1455 EncodedJSValue JITStubs::cti_op_resolve_func(STUB_ARGS_DECLARATION)
     1458DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_func)
    14561459{
    14571460    STUB_INIT_STACK_FRAME(stackFrame);
     
    14971500}
    14981501
    1499 EncodedJSValue JITStubs::cti_op_sub(STUB_ARGS_DECLARATION)
     1502DEFINE_STUB_FUNCTION(EncodedJSValue, op_sub)
    15001503{
    15011504    STUB_INIT_STACK_FRAME(stackFrame);
     
    15151518}
    15161519
    1517 void JITStubs::cti_op_put_by_val(STUB_ARGS_DECLARATION)
     1520DEFINE_STUB_FUNCTION(void, op_put_by_val)
    15181521{
    15191522    STUB_INIT_STACK_FRAME(stackFrame);
     
    15631566}
    15641567
    1565 void JITStubs::cti_op_put_by_val_array(STUB_ARGS_DECLARATION)
     1568DEFINE_STUB_FUNCTION(void, op_put_by_val_array)
    15661569{
    15671570    STUB_INIT_STACK_FRAME(stackFrame);
     
    15901593}
    15911594
    1592 void JITStubs::cti_op_put_by_val_byte_array(STUB_ARGS_DECLARATION)
     1595DEFINE_STUB_FUNCTION(void, op_put_by_val_byte_array)
    15931596{
    15941597    STUB_INIT_STACK_FRAME(stackFrame);
     
    16331636}
    16341637
    1635 EncodedJSValue JITStubs::cti_op_lesseq(STUB_ARGS_DECLARATION)
     1638DEFINE_STUB_FUNCTION(EncodedJSValue, op_lesseq)
    16361639{
    16371640    STUB_INIT_STACK_FRAME(stackFrame);
     
    16431646}
    16441647
    1645 int JITStubs::cti_op_loop_if_true(STUB_ARGS_DECLARATION)
     1648DEFINE_STUB_FUNCTION(int, op_loop_if_true)
    16461649{
    16471650    STUB_INIT_STACK_FRAME(stackFrame);
     
    16561659}
    16571660   
    1658 int JITStubs::cti_op_load_varargs(STUB_ARGS_DECLARATION)
     1661DEFINE_STUB_FUNCTION(int, op_load_varargs)
    16591662{
    16601663    STUB_INIT_STACK_FRAME(stackFrame);
     
    16621665    RegisterFile* registerFile = stackFrame.registerFile;
    16631666    int argsOffset = stackFrame.args[0].int32();
    1664     JSValue arguments = callFrame[argsOffset].jsValue();
     1667    JSValue arguments = callFrame->registers()[argsOffset].jsValue();
    16651668    uint32_t argCount = 0;
    16661669    if (!arguments) {
    1667         int providedParams = callFrame[RegisterFile::ArgumentCount].u.i - 1;
     1670        int providedParams = callFrame->registers()[RegisterFile::ArgumentCount].i() - 1;
    16681671        argCount = providedParams;
    16691672        int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize;
     
    16731676            VM_THROW_EXCEPTION();
    16741677        }
    1675         int32_t expectedParams = asFunction(callFrame[RegisterFile::Callee].jsValue())->body()->parameterCount();
     1678        int32_t expectedParams = asFunction(callFrame->registers()[RegisterFile::Callee].jsValue())->body()->parameterCount();
    16761679        int32_t inplaceArgs = min(providedParams, expectedParams);
    16771680       
     
    17441747}
    17451748
    1746 EncodedJSValue JITStubs::cti_op_negate(STUB_ARGS_DECLARATION)
     1749DEFINE_STUB_FUNCTION(EncodedJSValue, op_negate)
    17471750{
    17481751    STUB_INIT_STACK_FRAME(stackFrame);
     
    17601763}
    17611764
    1762 EncodedJSValue JITStubs::cti_op_resolve_base(STUB_ARGS_DECLARATION)
     1765DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_base)
    17631766{
    17641767    STUB_INIT_STACK_FRAME(stackFrame);
     
    17671770}
    17681771
    1769 EncodedJSValue JITStubs::cti_op_resolve_skip(STUB_ARGS_DECLARATION)
     1772DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_skip)
    17701773{
    17711774    STUB_INIT_STACK_FRAME(stackFrame);
     
    18001803}
    18011804
    1802 EncodedJSValue JITStubs::cti_op_resolve_global(STUB_ARGS_DECLARATION)
     1805DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_global)
    18031806{
    18041807    STUB_INIT_STACK_FRAME(stackFrame);
     
    18321835}
    18331836
    1834 EncodedJSValue JITStubs::cti_op_div(STUB_ARGS_DECLARATION)
     1837DEFINE_STUB_FUNCTION(EncodedJSValue, op_div)
    18351838{
    18361839    STUB_INIT_STACK_FRAME(stackFrame);
     
    18501853}
    18511854
    1852 EncodedJSValue JITStubs::cti_op_pre_dec(STUB_ARGS_DECLARATION)
     1855DEFINE_STUB_FUNCTION(EncodedJSValue, op_pre_dec)
    18531856{
    18541857    STUB_INIT_STACK_FRAME(stackFrame);
     
    18621865}
    18631866
    1864 int JITStubs::cti_op_jless(STUB_ARGS_DECLARATION)
     1867DEFINE_STUB_FUNCTION(int, op_jless)
    18651868{
    18661869    STUB_INIT_STACK_FRAME(stackFrame);
     
    18751878}
    18761879
    1877 int JITStubs::cti_op_jlesseq(STUB_ARGS_DECLARATION)
     1880DEFINE_STUB_FUNCTION(int, op_jlesseq)
    18781881{
    18791882    STUB_INIT_STACK_FRAME(stackFrame);
     
    18881891}
    18891892
    1890 EncodedJSValue JITStubs::cti_op_not(STUB_ARGS_DECLARATION)
     1893DEFINE_STUB_FUNCTION(EncodedJSValue, op_not)
    18911894{
    18921895    STUB_INIT_STACK_FRAME(stackFrame);
     
    19011904}
    19021905
    1903 int JITStubs::cti_op_jtrue(STUB_ARGS_DECLARATION)
     1906DEFINE_STUB_FUNCTION(int, op_jtrue)
    19041907{
    19051908    STUB_INIT_STACK_FRAME(stackFrame);
     
    19141917}
    19151918
    1916 EncodedJSValue JITStubs::cti_op_post_inc(STUB_ARGS_DECLARATION)
     1919DEFINE_STUB_FUNCTION(EncodedJSValue, op_post_inc)
    19171920{
    19181921    STUB_INIT_STACK_FRAME(stackFrame);
     
    19291932}
    19301933
    1931 EncodedJSValue JITStubs::cti_op_eq(STUB_ARGS_DECLARATION)
     1934DEFINE_STUB_FUNCTION(EncodedJSValue, op_eq)
    19321935{
    19331936    STUB_INIT_STACK_FRAME(stackFrame);
     
    19441947}
    19451948
    1946 EncodedJSValue JITStubs::cti_op_lshift(STUB_ARGS_DECLARATION)
     1949DEFINE_STUB_FUNCTION(EncodedJSValue, op_lshift)
    19471950{
    19481951    STUB_INIT_STACK_FRAME(stackFrame);
     
    19641967}
    19651968
    1966 EncodedJSValue JITStubs::cti_op_bitand(STUB_ARGS_DECLARATION)
     1969DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitand)
    19671970{
    19681971    STUB_INIT_STACK_FRAME(stackFrame);
     
    19821985}
    19831986
    1984 EncodedJSValue JITStubs::cti_op_rshift(STUB_ARGS_DECLARATION)
     1987DEFINE_STUB_FUNCTION(EncodedJSValue, op_rshift)
    19851988{
    19861989    STUB_INIT_STACK_FRAME(stackFrame);
     
    20022005}
    20032006
    2004 EncodedJSValue JITStubs::cti_op_bitnot(STUB_ARGS_DECLARATION)
     2007DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitnot)
    20052008{
    20062009    STUB_INIT_STACK_FRAME(stackFrame);
     
    20182021}
    20192022
    2020 EncodedJSValue JITStubs::cti_op_resolve_with_base(STUB_ARGS_DECLARATION)
     2023DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_with_base)
    20212024{
    20222025    STUB_INIT_STACK_FRAME(stackFrame);
     
    20542057}
    20552058
    2056 JSObject* JITStubs::cti_op_new_func_exp(STUB_ARGS_DECLARATION)
     2059DEFINE_STUB_FUNCTION(JSObject*, op_new_func_exp)
    20572060{
    20582061    STUB_INIT_STACK_FRAME(stackFrame);
     
    20612064}
    20622065
    2063 EncodedJSValue JITStubs::cti_op_mod(STUB_ARGS_DECLARATION)
     2066DEFINE_STUB_FUNCTION(EncodedJSValue, op_mod)
    20642067{
    20652068    STUB_INIT_STACK_FRAME(stackFrame);
     
    20752078}
    20762079
    2077 EncodedJSValue JITStubs::cti_op_less(STUB_ARGS_DECLARATION)
     2080DEFINE_STUB_FUNCTION(EncodedJSValue, op_less)
    20782081{
    20792082    STUB_INIT_STACK_FRAME(stackFrame);
     
    20852088}
    20862089
    2087 EncodedJSValue JITStubs::cti_op_neq(STUB_ARGS_DECLARATION)
     2090DEFINE_STUB_FUNCTION(EncodedJSValue, op_neq)
    20882091{
    20892092    STUB_INIT_STACK_FRAME(stackFrame);
     
    21002103}
    21012104
    2102 EncodedJSValue JITStubs::cti_op_post_dec(STUB_ARGS_DECLARATION)
     2105DEFINE_STUB_FUNCTION(EncodedJSValue, op_post_dec)
    21032106{
    21042107    STUB_INIT_STACK_FRAME(stackFrame);
     
    21152118}
    21162119
    2117 EncodedJSValue JITStubs::cti_op_urshift(STUB_ARGS_DECLARATION)
     2120DEFINE_STUB_FUNCTION(EncodedJSValue, op_urshift)
    21182121{
    21192122    STUB_INIT_STACK_FRAME(stackFrame);
     
    21332136}
    21342137
    2135 EncodedJSValue JITStubs::cti_op_bitxor(STUB_ARGS_DECLARATION)
     2138DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitxor)
    21362139{
    21372140    STUB_INIT_STACK_FRAME(stackFrame);
     
    21472150}
    21482151
    2149 JSObject* JITStubs::cti_op_new_regexp(STUB_ARGS_DECLARATION)
     2152DEFINE_STUB_FUNCTION(JSObject*, op_new_regexp)
    21502153{
    21512154    STUB_INIT_STACK_FRAME(stackFrame);
     
    21542157}
    21552158
    2156 EncodedJSValue JITStubs::cti_op_bitor(STUB_ARGS_DECLARATION)
     2159DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitor)
    21572160{
    21582161    STUB_INIT_STACK_FRAME(stackFrame);
     
    21682171}
    21692172
    2170 EncodedJSValue JITStubs::cti_op_call_eval(STUB_ARGS_DECLARATION)
     2173DEFINE_STUB_FUNCTION(EncodedJSValue, op_call_eval)
    21712174{
    21722175    STUB_INIT_STACK_FRAME(stackFrame);
     
    21992202}
    22002203
    2201 EncodedJSValue JITStubs::cti_op_throw(STUB_ARGS_DECLARATION)
     2204DEFINE_STUB_FUNCTION(EncodedJSValue, op_throw)
    22022205{
    22032206    STUB_INIT_STACK_FRAME(stackFrame);
     
    22252228}
    22262229
    2227 JSPropertyNameIterator* JITStubs::cti_op_get_pnames(STUB_ARGS_DECLARATION)
     2230DEFINE_STUB_FUNCTION(JSPropertyNameIterator*, op_get_pnames)
    22282231{
    22292232    STUB_INIT_STACK_FRAME(stackFrame);
     
    22322235}
    22332236
    2234 EncodedJSValue JITStubs::cti_op_next_pname(STUB_ARGS_DECLARATION)
     2237DEFINE_STUB_FUNCTION(EncodedJSValue, op_next_pname)
    22352238{
    22362239    STUB_INIT_STACK_FRAME(stackFrame);
     
    22432246}
    22442247
    2245 JSObject* JITStubs::cti_op_push_scope(STUB_ARGS_DECLARATION)
     2248DEFINE_STUB_FUNCTION(JSObject*, op_push_scope)
    22462249{
    22472250    STUB_INIT_STACK_FRAME(stackFrame);
     
    22532256}
    22542257
    2255 void JITStubs::cti_op_pop_scope(STUB_ARGS_DECLARATION)
     2258DEFINE_STUB_FUNCTION(void, op_pop_scope)
    22562259{
    22572260    STUB_INIT_STACK_FRAME(stackFrame);
     
    22602263}
    22612264
    2262 EncodedJSValue JITStubs::cti_op_typeof(STUB_ARGS_DECLARATION)
     2265DEFINE_STUB_FUNCTION(EncodedJSValue, op_typeof)
    22632266{
    22642267    STUB_INIT_STACK_FRAME(stackFrame);
     
    22672270}
    22682271
    2269 EncodedJSValue JITStubs::cti_op_is_undefined(STUB_ARGS_DECLARATION)
     2272DEFINE_STUB_FUNCTION(EncodedJSValue, op_is_undefined)
    22702273{
    22712274    STUB_INIT_STACK_FRAME(stackFrame);
     
    22752278}
    22762279
    2277 EncodedJSValue JITStubs::cti_op_is_boolean(STUB_ARGS_DECLARATION)
     2280DEFINE_STUB_FUNCTION(EncodedJSValue, op_is_boolean)
    22782281{
    22792282    STUB_INIT_STACK_FRAME(stackFrame);
     
    22822285}
    22832286
    2284 EncodedJSValue JITStubs::cti_op_is_number(STUB_ARGS_DECLARATION)
     2287DEFINE_STUB_FUNCTION(EncodedJSValue, op_is_number)
    22852288{
    22862289    STUB_INIT_STACK_FRAME(stackFrame);
     
    22892292}
    22902293
    2291 EncodedJSValue JITStubs::cti_op_is_string(STUB_ARGS_DECLARATION)
     2294DEFINE_STUB_FUNCTION(EncodedJSValue, op_is_string)
    22922295{
    22932296    STUB_INIT_STACK_FRAME(stackFrame);
     
    22962299}
    22972300
    2298 EncodedJSValue JITStubs::cti_op_is_object(STUB_ARGS_DECLARATION)
     2301DEFINE_STUB_FUNCTION(EncodedJSValue, op_is_object)
    22992302{
    23002303    STUB_INIT_STACK_FRAME(stackFrame);
     
    23032306}
    23042307
    2305 EncodedJSValue JITStubs::cti_op_is_function(STUB_ARGS_DECLARATION)
     2308DEFINE_STUB_FUNCTION(EncodedJSValue, op_is_function)
    23062309{
    23072310    STUB_INIT_STACK_FRAME(stackFrame);
     
    23102313}
    23112314
    2312 EncodedJSValue JITStubs::cti_op_stricteq(STUB_ARGS_DECLARATION)
     2315DEFINE_STUB_FUNCTION(EncodedJSValue, op_stricteq)
    23132316{
    23142317    STUB_INIT_STACK_FRAME(stackFrame);
     
    23202323}
    23212324
    2322 EncodedJSValue JITStubs::cti_op_to_primitive(STUB_ARGS_DECLARATION)
     2325DEFINE_STUB_FUNCTION(EncodedJSValue, op_to_primitive)
    23232326{
    23242327    STUB_INIT_STACK_FRAME(stackFrame);
     
    23272330}
    23282331
    2329 EncodedJSValue JITStubs::cti_op_strcat(STUB_ARGS_DECLARATION)
     2332DEFINE_STUB_FUNCTION(EncodedJSValue, op_strcat)
    23302333{
    23312334    STUB_INIT_STACK_FRAME(stackFrame);
     
    23342337}
    23352338
    2336 EncodedJSValue JITStubs::cti_op_nstricteq(STUB_ARGS_DECLARATION)
     2339DEFINE_STUB_FUNCTION(EncodedJSValue, op_nstricteq)
    23372340{
    23382341    STUB_INIT_STACK_FRAME(stackFrame);
     
    23442347}
    23452348
    2346 EncodedJSValue JITStubs::cti_op_to_jsnumber(STUB_ARGS_DECLARATION)
     2349DEFINE_STUB_FUNCTION(EncodedJSValue, op_to_jsnumber)
    23472350{
    23482351    STUB_INIT_STACK_FRAME(stackFrame);
     
    23562359}
    23572360
    2358 EncodedJSValue JITStubs::cti_op_in(STUB_ARGS_DECLARATION)
     2361DEFINE_STUB_FUNCTION(EncodedJSValue, op_in)
    23592362{
    23602363    STUB_INIT_STACK_FRAME(stackFrame);
     
    23832386}
    23842387
    2385 JSObject* JITStubs::cti_op_push_new_scope(STUB_ARGS_DECLARATION)
     2388DEFINE_STUB_FUNCTION(JSObject*, op_push_new_scope)
    23862389{
    23872390    STUB_INIT_STACK_FRAME(stackFrame);
     
    23942397}
    23952398
    2396 void JITStubs::cti_op_jmp_scopes(STUB_ARGS_DECLARATION)
     2399DEFINE_STUB_FUNCTION(void, op_jmp_scopes)
    23972400{
    23982401    STUB_INIT_STACK_FRAME(stackFrame);
     
    24072410}
    24082411
    2409 void JITStubs::cti_op_put_by_index(STUB_ARGS_DECLARATION)
     2412DEFINE_STUB_FUNCTION(void, op_put_by_index)
    24102413{
    24112414    STUB_INIT_STACK_FRAME(stackFrame);
     
    24172420}
    24182421
    2419 void* JITStubs::cti_op_switch_imm(STUB_ARGS_DECLARATION)
     2422DEFINE_STUB_FUNCTION(void*, op_switch_imm)
    24202423{
    24212424    STUB_INIT_STACK_FRAME(stackFrame);
     
    24382441}
    24392442
    2440 void* JITStubs::cti_op_switch_char(STUB_ARGS_DECLARATION)
     2443DEFINE_STUB_FUNCTION(void*, op_switch_char)
    24412444{
    24422445    STUB_INIT_STACK_FRAME(stackFrame);
     
    24582461}
    24592462
    2460 void* JITStubs::cti_op_switch_string(STUB_ARGS_DECLARATION)
     2463DEFINE_STUB_FUNCTION(void*, op_switch_string)
    24612464{
    24622465    STUB_INIT_STACK_FRAME(stackFrame);
     
    24772480}
    24782481
    2479 EncodedJSValue JITStubs::cti_op_del_by_val(STUB_ARGS_DECLARATION)
     2482DEFINE_STUB_FUNCTION(EncodedJSValue, op_del_by_val)
    24802483{
    24812484    STUB_INIT_STACK_FRAME(stackFrame);
     
    25022505}
    25032506
    2504 void JITStubs::cti_op_put_getter(STUB_ARGS_DECLARATION)
     2507DEFINE_STUB_FUNCTION(void, op_put_getter)
    25052508{
    25062509    STUB_INIT_STACK_FRAME(stackFrame);
     
    25142517}
    25152518
    2516 void JITStubs::cti_op_put_setter(STUB_ARGS_DECLARATION)
     2519DEFINE_STUB_FUNCTION(void, op_put_setter)
    25172520{
    25182521    STUB_INIT_STACK_FRAME(stackFrame);
     
    25262529}
    25272530
    2528 JSObject* JITStubs::cti_op_new_error(STUB_ARGS_DECLARATION)
     2531DEFINE_STUB_FUNCTION(JSObject*, op_new_error)
    25292532{
    25302533    STUB_INIT_STACK_FRAME(stackFrame);
     
    25402543}
    25412544
    2542 void JITStubs::cti_op_debug(STUB_ARGS_DECLARATION)
     2545DEFINE_STUB_FUNCTION(void, op_debug)
    25432546{
    25442547    STUB_INIT_STACK_FRAME(stackFrame);
     
    25532556}
    25542557
    2555 EncodedJSValue JITStubs::cti_vm_throw(STUB_ARGS_DECLARATION)
     2558DEFINE_STUB_FUNCTION(EncodedJSValue, vm_throw)
    25562559{
    25572560    STUB_INIT_STACK_FRAME(stackFrame);
     
    25812584}
    25822585
     2586} // namespace JITStubs
     2587
    25832588} // namespace JSC
    25842589
Note: See TracChangeset for help on using the changeset viewer.