Changeset 37581 in webkit for trunk/JavaScriptCore/VM/CTI.h


Ignore:
Timestamp:
Oct 14, 2008, 1:21:19 AM (17 years ago)
Author:
[email protected]
Message:

2008-10-14 Maciej Stachowiak <[email protected]>

Reviewed by Cameron Zwarich.


  • always use CTI_ARGUMENTS and CTI_ARGUMENTS_FASTCALL


This is a small regression for GCC 4.0, but simplifies the code
for future improvements and lets us focus on GCC 4.2+ and MSVC.

  • VM/CTI.cpp:
  • VM/CTI.h:
  • VM/Machine.cpp: (JSC::Machine::cti_op_convert_this): (JSC::Machine::cti_op_end): (JSC::Machine::cti_op_add): (JSC::Machine::cti_op_pre_inc): (JSC::Machine::cti_timeout_check): (JSC::Machine::cti_register_file_check): (JSC::Machine::cti_op_loop_if_less): (JSC::Machine::cti_op_loop_if_lesseq): (JSC::Machine::cti_op_new_object): (JSC::Machine::cti_op_put_by_id): (JSC::Machine::cti_op_put_by_id_second): (JSC::Machine::cti_op_put_by_id_generic): (JSC::Machine::cti_op_put_by_id_fail): (JSC::Machine::cti_op_get_by_id): (JSC::Machine::cti_op_get_by_id_second): (JSC::Machine::cti_op_get_by_id_generic): (JSC::Machine::cti_op_get_by_id_fail): (JSC::Machine::cti_op_instanceof): (JSC::Machine::cti_op_del_by_id): (JSC::Machine::cti_op_mul): (JSC::Machine::cti_op_new_func): (JSC::Machine::cti_op_call_JSFunction): (JSC::Machine::cti_vm_compile): (JSC::Machine::cti_op_push_activation): (JSC::Machine::cti_op_call_NotJSFunction): (JSC::Machine::cti_op_create_arguments): (JSC::Machine::cti_op_tear_off_activation): (JSC::Machine::cti_op_tear_off_arguments): (JSC::Machine::cti_op_ret_profiler): (JSC::Machine::cti_op_ret_scopeChain): (JSC::Machine::cti_op_new_array): (JSC::Machine::cti_op_resolve): (JSC::Machine::cti_op_construct_JSConstruct): (JSC::Machine::cti_op_construct_NotJSConstruct): (JSC::Machine::cti_op_get_by_val): (JSC::Machine::cti_op_resolve_func): (JSC::Machine::cti_op_sub): (JSC::Machine::cti_op_put_by_val): (JSC::Machine::cti_op_put_by_val_array): (JSC::Machine::cti_op_lesseq): (JSC::Machine::cti_op_loop_if_true): (JSC::Machine::cti_op_negate): (JSC::Machine::cti_op_resolve_base): (JSC::Machine::cti_op_resolve_skip): (JSC::Machine::cti_op_resolve_global): (JSC::Machine::cti_op_div): (JSC::Machine::cti_op_pre_dec): (JSC::Machine::cti_op_jless): (JSC::Machine::cti_op_not): (JSC::Machine::cti_op_jtrue): (JSC::Machine::cti_op_post_inc): (JSC::Machine::cti_op_eq): (JSC::Machine::cti_op_lshift): (JSC::Machine::cti_op_bitand): (JSC::Machine::cti_op_rshift): (JSC::Machine::cti_op_bitnot): (JSC::Machine::cti_op_resolve_with_base): (JSC::Machine::cti_op_new_func_exp): (JSC::Machine::cti_op_mod): (JSC::Machine::cti_op_less): (JSC::Machine::cti_op_neq): (JSC::Machine::cti_op_post_dec): (JSC::Machine::cti_op_urshift): (JSC::Machine::cti_op_bitxor): (JSC::Machine::cti_op_new_regexp): (JSC::Machine::cti_op_bitor): (JSC::Machine::cti_op_call_eval): (JSC::Machine::cti_op_throw): (JSC::Machine::cti_op_get_pnames): (JSC::Machine::cti_op_next_pname): (JSC::Machine::cti_op_push_scope): (JSC::Machine::cti_op_pop_scope): (JSC::Machine::cti_op_typeof): (JSC::Machine::cti_op_is_undefined): (JSC::Machine::cti_op_is_boolean): (JSC::Machine::cti_op_is_number): (JSC::Machine::cti_op_is_string): (JSC::Machine::cti_op_is_object): (JSC::Machine::cti_op_is_function): (JSC::Machine::cti_op_stricteq): (JSC::Machine::cti_op_nstricteq): (JSC::Machine::cti_op_to_jsnumber): (JSC::Machine::cti_op_in): (JSC::Machine::cti_op_push_new_scope): (JSC::Machine::cti_op_jmp_scopes): (JSC::Machine::cti_op_put_by_index): (JSC::Machine::cti_op_switch_imm): (JSC::Machine::cti_op_switch_char): (JSC::Machine::cti_op_switch_string): (JSC::Machine::cti_op_del_by_val): (JSC::Machine::cti_op_put_getter): (JSC::Machine::cti_op_put_setter): (JSC::Machine::cti_op_new_error): (JSC::Machine::cti_op_debug): (JSC::Machine::cti_vm_throw):
  • VM/Machine.h:
  • masm/X86Assembler.h: (JSC::X86Assembler::emitRestoreArgumentReference): (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CTI.h

    r37457 r37581  
    4545#define CTI_ARGS_profilerReference 0x10
    4646#define CTI_ARGS_globalData 0x11
    47 #define ARG_registerFile ((RegisterFile*)(ARGS)[CTI_ARGS_registerFile])
    48 #define ARG_callFrame ((CallFrame*)(ARGS)[CTI_ARGS_callFrame])
    49 #define ARG_exception ((JSValue**)(ARGS)[CTI_ARGS_exception])
    50 #define ARG_profilerReference ((Profiler**)(ARGS)[CTI_ARGS_profilerReference])
    51 #define ARG_globalData ((JSGlobalData*)(ARGS)[CTI_ARGS_globalData])
    52 
    53 #define ARG_setCallFrame(newCallFrame) (*(CallFrame**)&(ARGS)[CTI_ARGS_callFrame] = (newCallFrame))
    54 
    55 #define ARG_src1 ((JSValue*)((ARGS)[1]))
    56 #define ARG_src2 ((JSValue*)((ARGS)[2]))
    57 #define ARG_src3 ((JSValue*)((ARGS)[3]))
    58 #define ARG_src4 ((JSValue*)((ARGS)[4]))
    59 #define ARG_src5 ((JSValue*)((ARGS)[5]))
    60 #define ARG_id1 ((Identifier*)((ARGS)[1]))
    61 #define ARG_id2 ((Identifier*)((ARGS)[2]))
    62 #define ARG_id3 ((Identifier*)((ARGS)[3]))
    63 #define ARG_id4 ((Identifier*)((ARGS)[4]))
    64 #define ARG_int1 ((int)((ARGS)[1]))
    65 #define ARG_int2 ((int)((ARGS)[2]))
    66 #define ARG_int3 ((int)((ARGS)[3]))
    67 #define ARG_int4 ((int)((ARGS)[4]))
    68 #define ARG_int5 ((int)((ARGS)[5]))
    69 #define ARG_func1 ((FuncDeclNode*)((ARGS)[1]))
    70 #define ARG_funcexp1 ((FuncExprNode*)((ARGS)[1]))
    71 #define ARG_registers1 ((Register*)((ARGS)[1]))
    72 #define ARG_regexp1 ((RegExp*)((ARGS)[1]))
    73 #define ARG_pni1 ((JSPropertyNameIterator*)((ARGS)[1]))
    74 #define ARG_instr1 ((Instruction*)((ARGS)[1]))
    75 #define ARG_instr2 ((Instruction*)((ARGS)[2]))
    76 #define ARG_instr3 ((Instruction*)((ARGS)[3]))
    77 #define ARG_instr4 ((Instruction*)((ARGS)[4]))
    78 #define ARG_instr5 ((Instruction*)((ARGS)[5]))
    79 #define ARG_instr6 ((Instruction*)((ARGS)[6]))
    80 
    81 #define CTI_RETURN_ADDRESS ((ARGS)[-1])
     47#define ARG_registerFile ((RegisterFile*)(args)[CTI_ARGS_registerFile])
     48#define ARG_callFrame ((CallFrame*)(args)[CTI_ARGS_callFrame])
     49#define ARG_exception ((JSValue**)(args)[CTI_ARGS_exception])
     50#define ARG_profilerReference ((Profiler**)(args)[CTI_ARGS_profilerReference])
     51#define ARG_globalData ((JSGlobalData*)(args)[CTI_ARGS_globalData])
     52
     53#define ARG_setCallFrame(newCallFrame) (*(CallFrame**)&(args)[CTI_ARGS_callFrame] = (newCallFrame))
     54
     55#define ARG_src1 ((JSValue*)((args)[1]))
     56#define ARG_src2 ((JSValue*)((args)[2]))
     57#define ARG_src3 ((JSValue*)((args)[3]))
     58#define ARG_src4 ((JSValue*)((args)[4]))
     59#define ARG_src5 ((JSValue*)((args)[5]))
     60#define ARG_id1 ((Identifier*)((args)[1]))
     61#define ARG_id2 ((Identifier*)((args)[2]))
     62#define ARG_id3 ((Identifier*)((args)[3]))
     63#define ARG_id4 ((Identifier*)((args)[4]))
     64#define ARG_int1 ((int)((args)[1]))
     65#define ARG_int2 ((int)((args)[2]))
     66#define ARG_int3 ((int)((args)[3]))
     67#define ARG_int4 ((int)((args)[4]))
     68#define ARG_int5 ((int)((args)[5]))
     69#define ARG_func1 ((FuncDeclNode*)((args)[1]))
     70#define ARG_funcexp1 ((FuncExprNode*)((args)[1]))
     71#define ARG_registers1 ((Register*)((args)[1]))
     72#define ARG_regexp1 ((RegExp*)((args)[1]))
     73#define ARG_pni1 ((JSPropertyNameIterator*)((args)[1]))
     74#define ARG_instr1 ((Instruction*)((args)[1]))
     75#define ARG_instr2 ((Instruction*)((args)[2]))
     76#define ARG_instr3 ((Instruction*)((args)[3]))
     77#define ARG_instr4 ((Instruction*)((args)[4]))
     78#define ARG_instr5 ((Instruction*)((args)[5]))
     79#define ARG_instr6 ((Instruction*)((args)[6]))
     80
     81#define CTI_RETURN_ADDRESS ((args)[-1])
    8282
    8383namespace JSC {
     
    9696    struct OperandTypes;
    9797
    98     typedef JSValue* (SFX_CALL *CTIHelper_j)(CTI_ARGS);
    99     typedef JSPropertyNameIterator* (SFX_CALL *CTIHelper_p)(CTI_ARGS);
    100     typedef void (SFX_CALL *CTIHelper_v)(CTI_ARGS);
    101     typedef void* (SFX_CALL *CTIHelper_s)(CTI_ARGS);
    102     typedef int (SFX_CALL *CTIHelper_b)(CTI_ARGS);
    103     typedef VoidPtrPair (SFX_CALL *CTIHelper_2)(CTI_ARGS);
     98    typedef JSValue* (SFX_CALL *CTIHelper_j)(void** args);
     99    typedef JSPropertyNameIterator* (SFX_CALL *CTIHelper_p)(void** args);
     100    typedef void (SFX_CALL *CTIHelper_v)(void** args);
     101    typedef void* (SFX_CALL *CTIHelper_s)(void** args);
     102    typedef int (SFX_CALL *CTIHelper_b)(void** args);
     103    typedef VoidPtrPair (SFX_CALL *CTIHelper_2)(void** args);
    104104
    105105    struct CallRecord {
     
    239239        static const int repatchGetByIdDefaultOffset = 256;
    240240
    241 #if USE(FAST_CALL_CTI_ARGUMENT)
    242241        static const int ctiArgumentInitSize = 2;
    243 #elif USE(CTI_ARGUMENT)
    244         static const int ctiArgumentInitSize = 4;
    245 #else
    246         static const int ctiArgumentInitSize = 0;
    247 #endif
     242
    248243        // These architecture specific value are used to enable repatching - see comment on op_put_by_id.
    249244        static const int repatchOffsetPutByIdStructureID = 19;
Note: See TracChangeset for help on using the changeset viewer.