Changeset 43276 in webkit for trunk/JavaScriptCore/jit


Ignore:
Timestamp:
May 5, 2009, 9:50:19 PM (16 years ago)
Author:
[email protected]
Message:

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

Reviewed by Maciej Stachowiak.


Simplified a bit of codegen.

  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass):
File:
1 edited

Legend:

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

    r43273 r43276  
    110110    break;
    111111
    112 #define CTI_COMPILE_BINARY_OP(name) \
     112#define DEFINE_BINARY_OP(name) \
    113113    case name: { \
    114114        emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2); \
     
    119119    }
    120120
    121 #define CTI_COMPILE_UNARY_OP(name) \
     121#define DEFINE_UNARY_OP(name) \
    122122    case name: { \
    123123        emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2); \
     
    154154
    155155        switch (opcodeID) {
     156        DEFINE_BINARY_OP(op_del_by_val)
     157        DEFINE_BINARY_OP(op_div)
     158        DEFINE_BINARY_OP(op_in)
     159        DEFINE_BINARY_OP(op_less)
     160        DEFINE_BINARY_OP(op_lesseq)
     161        DEFINE_BINARY_OP(op_urshift)
     162        DEFINE_UNARY_OP(op_get_pnames)
     163        DEFINE_UNARY_OP(op_is_boolean)
     164        DEFINE_UNARY_OP(op_is_function)
     165        DEFINE_UNARY_OP(op_is_number)
     166        DEFINE_UNARY_OP(op_is_object)
     167        DEFINE_UNARY_OP(op_is_string)
     168        DEFINE_UNARY_OP(op_is_undefined)
     169        DEFINE_UNARY_OP(op_negate)
     170        DEFINE_UNARY_OP(op_typeof)
    156171        case op_mov: {
    157172            int src = currentInstruction[2].u.operand;
     
    515530            NEXT_OPCODE(op_put_by_val);
    516531        }
    517         CTI_COMPILE_BINARY_OP(op_lesseq)
    518532        case op_loop_if_true: {
    519533            emitTimeoutCheck();
     
    537551            emitPutVirtualRegister(currentInstruction[1].u.operand);
    538552            NEXT_OPCODE(op_resolve_base);
    539         }
    540         case op_negate: {
    541             emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);
    542             emitCTICall(JITStubs::cti_op_negate);
    543             emitPutVirtualRegister(currentInstruction[1].u.operand);
    544             NEXT_OPCODE(op_negate);
    545553        }
    546554        case op_resolve_skip: {
     
    583591            NEXT_OPCODE(op_resolve_global);
    584592        }
    585         CTI_COMPILE_BINARY_OP(op_div)
    586593        case op_pre_dec: {
    587594            compileFastArith_op_pre_dec(currentInstruction[1].u.operand);
     
    775782            NEXT_OPCODE(op_jtrue);
    776783        }
    777         CTI_COMPILE_BINARY_OP(op_less)
    778784        case op_neq: {
    779785            emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1);
     
    790796            NEXT_OPCODE(op_post_dec);
    791797        }
    792         CTI_COMPILE_BINARY_OP(op_urshift)
    793798        case op_bitxor: {
    794799            emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1);
     
    836841            NEXT_OPCODE(op_throw);
    837842        }
    838         case op_get_pnames: {
    839             emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);
    840             emitCTICall(JITStubs::cti_op_get_pnames);
    841             emitPutVirtualRegister(currentInstruction[1].u.operand);
    842             NEXT_OPCODE(op_get_pnames);
    843         }
    844843        case op_next_pname: {
    845844            emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);
     
    862861            NEXT_OPCODE(op_pop_scope);
    863862        }
    864         CTI_COMPILE_UNARY_OP(op_typeof)
    865         CTI_COMPILE_UNARY_OP(op_is_undefined)
    866         CTI_COMPILE_UNARY_OP(op_is_boolean)
    867         CTI_COMPILE_UNARY_OP(op_is_number)
    868         CTI_COMPILE_UNARY_OP(op_is_string)
    869         CTI_COMPILE_UNARY_OP(op_is_object)
    870         CTI_COMPILE_UNARY_OP(op_is_function)
    871863        case op_stricteq: {
    872864            compileOpStrictEq(currentInstruction, OpStrictEq);
     
    892884            NEXT_OPCODE(op_to_jsnumber);
    893885        }
    894         CTI_COMPILE_BINARY_OP(op_in)
    895886        case op_push_new_scope: {
    896887            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
     
    968959            jump(regT0);
    969960            NEXT_OPCODE(op_switch_string);
    970         }
    971         case op_del_by_val: {
    972             emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);
    973             emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 2, regT2);
    974             emitCTICall(JITStubs::cti_op_del_by_val);
    975             emitPutVirtualRegister(currentInstruction[1].u.operand);
    976             NEXT_OPCODE(op_del_by_val);
    977961        }
    978962        case op_put_getter: {
Note: See TracChangeset for help on using the changeset viewer.