Ignore:
Timestamp:
Sep 9, 2013, 11:01:03 PM (12 years ago)
Author:
[email protected]
Message:

Change virtual register function arguments from unsigned to int
https://bugs.webkit.org/show_bug.cgi?id=121055

Reviewed by Filip Pizlo.

This is a largely mechanical change. This changes function paramaters and local variables used to
represent bytecode operands from being unsigned to be int.

  • bytecode/CodeOrigin.h:
  • dfg/DFGByteCodeParser.cpp:
  • jit/JIT.h:
  • jit/JITArithmetic.cpp:
  • jit/JITArithmetic32_64.cpp:
  • jit/JITInlines.h:
  • jit/JITOpcodes.cpp:
  • jit/JITOpcodes32_64.cpp:
  • jit/JITPropertyAccess.cpp:
  • jit/JITPropertyAccess32_64.cpp:
  • jit/JITStubCall.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp

    r153222 r155418  
    5151void JIT::emit_op_jless(Instruction* currentInstruction)
    5252{
    53     unsigned op1 = currentInstruction[1].u.operand;
    54     unsigned op2 = currentInstruction[2].u.operand;
     53    int op1 = currentInstruction[1].u.operand;
     54    int op2 = currentInstruction[2].u.operand;
    5555    unsigned target = currentInstruction[3].u.operand;
    5656
     
    6060void JIT::emit_op_jlesseq(Instruction* currentInstruction)
    6161{
    62     unsigned op1 = currentInstruction[1].u.operand;
    63     unsigned op2 = currentInstruction[2].u.operand;
     62    int op1 = currentInstruction[1].u.operand;
     63    int op2 = currentInstruction[2].u.operand;
    6464    unsigned target = currentInstruction[3].u.operand;
    6565
     
    6969void JIT::emit_op_jgreater(Instruction* currentInstruction)
    7070{
    71     unsigned op1 = currentInstruction[1].u.operand;
    72     unsigned op2 = currentInstruction[2].u.operand;
     71    int op1 = currentInstruction[1].u.operand;
     72    int op2 = currentInstruction[2].u.operand;
    7373    unsigned target = currentInstruction[3].u.operand;
    7474
     
    7878void JIT::emit_op_jgreatereq(Instruction* currentInstruction)
    7979{
    80     unsigned op1 = currentInstruction[1].u.operand;
    81     unsigned op2 = currentInstruction[2].u.operand;
     80    int op1 = currentInstruction[1].u.operand;
     81    int op2 = currentInstruction[2].u.operand;
    8282    unsigned target = currentInstruction[3].u.operand;
    8383
     
    8787void JIT::emit_op_jnless(Instruction* currentInstruction)
    8888{
    89     unsigned op1 = currentInstruction[1].u.operand;
    90     unsigned op2 = currentInstruction[2].u.operand;
     89    int op1 = currentInstruction[1].u.operand;
     90    int op2 = currentInstruction[2].u.operand;
    9191    unsigned target = currentInstruction[3].u.operand;
    9292
     
    9696void JIT::emit_op_jnlesseq(Instruction* currentInstruction)
    9797{
    98     unsigned op1 = currentInstruction[1].u.operand;
    99     unsigned op2 = currentInstruction[2].u.operand;
     98    int op1 = currentInstruction[1].u.operand;
     99    int op2 = currentInstruction[2].u.operand;
    100100    unsigned target = currentInstruction[3].u.operand;
    101101
     
    105105void JIT::emit_op_jngreater(Instruction* currentInstruction)
    106106{
    107     unsigned op1 = currentInstruction[1].u.operand;
    108     unsigned op2 = currentInstruction[2].u.operand;
     107    int op1 = currentInstruction[1].u.operand;
     108    int op2 = currentInstruction[2].u.operand;
    109109    unsigned target = currentInstruction[3].u.operand;
    110110
     
    114114void JIT::emit_op_jngreatereq(Instruction* currentInstruction)
    115115{
    116     unsigned op1 = currentInstruction[1].u.operand;
    117     unsigned op2 = currentInstruction[2].u.operand;
     116    int op1 = currentInstruction[1].u.operand;
     117    int op2 = currentInstruction[2].u.operand;
    118118    unsigned target = currentInstruction[3].u.operand;
    119119
     
    123123void JIT::emitSlow_op_jless(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    124124{
    125     unsigned op1 = currentInstruction[1].u.operand;
    126     unsigned op2 = currentInstruction[2].u.operand;
     125    int op1 = currentInstruction[1].u.operand;
     126    int op2 = currentInstruction[2].u.operand;
    127127    unsigned target = currentInstruction[3].u.operand;
    128128
     
    132132void JIT::emitSlow_op_jlesseq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    133133{
    134     unsigned op1 = currentInstruction[1].u.operand;
    135     unsigned op2 = currentInstruction[2].u.operand;
     134    int op1 = currentInstruction[1].u.operand;
     135    int op2 = currentInstruction[2].u.operand;
    136136    unsigned target = currentInstruction[3].u.operand;
    137137
     
    141141void JIT::emitSlow_op_jgreater(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    142142{
    143     unsigned op1 = currentInstruction[1].u.operand;
    144     unsigned op2 = currentInstruction[2].u.operand;
     143    int op1 = currentInstruction[1].u.operand;
     144    int op2 = currentInstruction[2].u.operand;
    145145    unsigned target = currentInstruction[3].u.operand;
    146146
     
    150150void JIT::emitSlow_op_jgreatereq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    151151{
    152     unsigned op1 = currentInstruction[1].u.operand;
    153     unsigned op2 = currentInstruction[2].u.operand;
     152    int op1 = currentInstruction[1].u.operand;
     153    int op2 = currentInstruction[2].u.operand;
    154154    unsigned target = currentInstruction[3].u.operand;
    155155
     
    159159void JIT::emitSlow_op_jnless(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    160160{
    161     unsigned op1 = currentInstruction[1].u.operand;
    162     unsigned op2 = currentInstruction[2].u.operand;
     161    int op1 = currentInstruction[1].u.operand;
     162    int op2 = currentInstruction[2].u.operand;
    163163    unsigned target = currentInstruction[3].u.operand;
    164164
     
    168168void JIT::emitSlow_op_jnlesseq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    169169{
    170     unsigned op1 = currentInstruction[1].u.operand;
    171     unsigned op2 = currentInstruction[2].u.operand;
     170    int op1 = currentInstruction[1].u.operand;
     171    int op2 = currentInstruction[2].u.operand;
    172172    unsigned target = currentInstruction[3].u.operand;
    173173
     
    177177void JIT::emitSlow_op_jngreater(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    178178{
    179     unsigned op1 = currentInstruction[1].u.operand;
    180     unsigned op2 = currentInstruction[2].u.operand;
     179    int op1 = currentInstruction[1].u.operand;
     180    int op2 = currentInstruction[2].u.operand;
    181181    unsigned target = currentInstruction[3].u.operand;
    182182
     
    186186void JIT::emitSlow_op_jngreatereq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    187187{
    188     unsigned op1 = currentInstruction[1].u.operand;
    189     unsigned op2 = currentInstruction[2].u.operand;
     188    int op1 = currentInstruction[1].u.operand;
     189    int op2 = currentInstruction[2].u.operand;
    190190    unsigned target = currentInstruction[3].u.operand;
    191191
     
    197197void JIT::emit_op_negate(Instruction* currentInstruction)
    198198{
    199     unsigned dst = currentInstruction[1].u.operand;
    200     unsigned src = currentInstruction[2].u.operand;
     199    int dst = currentInstruction[1].u.operand;
     200    int src = currentInstruction[2].u.operand;
    201201
    202202    emitGetVirtualRegister(src, regT0);
     
    221221void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    222222{
    223     unsigned result = currentInstruction[1].u.operand;
     223    int result = currentInstruction[1].u.operand;
    224224
    225225    linkSlowCase(iter); // 0x7fffffff check
     
    233233void JIT::emit_op_lshift(Instruction* currentInstruction)
    234234{
    235     unsigned result = currentInstruction[1].u.operand;
    236     unsigned op1 = currentInstruction[2].u.operand;
    237     unsigned op2 = currentInstruction[3].u.operand;
     235    int result = currentInstruction[1].u.operand;
     236    int op1 = currentInstruction[2].u.operand;
     237    int op2 = currentInstruction[3].u.operand;
    238238
    239239    emitGetVirtualRegisters(op1, regT0, op2, regT2);
     
    250250void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    251251{
    252     unsigned result = currentInstruction[1].u.operand;
     252    int result = currentInstruction[1].u.operand;
    253253
    254254    linkSlowCase(iter);
     
    261261void JIT::emit_op_rshift(Instruction* currentInstruction)
    262262{
    263     unsigned result = currentInstruction[1].u.operand;
    264     unsigned op1 = currentInstruction[2].u.operand;
    265     unsigned op2 = currentInstruction[3].u.operand;
     263    int result = currentInstruction[1].u.operand;
     264    int op1 = currentInstruction[2].u.operand;
     265    int op2 = currentInstruction[3].u.operand;
    266266
    267267    if (isOperandConstantImmediateInt(op2)) {
     
    296296void JIT::emitSlow_op_rshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    297297{
    298     unsigned result = currentInstruction[1].u.operand;
    299     unsigned op1 = currentInstruction[2].u.operand;
    300     unsigned op2 = currentInstruction[3].u.operand;
     298    int result = currentInstruction[1].u.operand;
     299    int op1 = currentInstruction[2].u.operand;
     300    int op2 = currentInstruction[3].u.operand;
    301301
    302302    UNUSED_PARAM(op1);
     
    323323void JIT::emit_op_urshift(Instruction* currentInstruction)
    324324{
    325     unsigned dst = currentInstruction[1].u.operand;
    326     unsigned op1 = currentInstruction[2].u.operand;
    327     unsigned op2 = currentInstruction[3].u.operand;
     325    int dst = currentInstruction[1].u.operand;
     326    int op1 = currentInstruction[2].u.operand;
     327    int op2 = currentInstruction[3].u.operand;
    328328
    329329    // Slow case of urshift makes assumptions about what registers hold the
     
    359359void JIT::emitSlow_op_urshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    360360{
    361     unsigned dst = currentInstruction[1].u.operand;
    362     unsigned op1 = currentInstruction[2].u.operand;
    363     unsigned op2 = currentInstruction[3].u.operand;
     361    int dst = currentInstruction[1].u.operand;
     362    int op1 = currentInstruction[2].u.operand;
     363    int op2 = currentInstruction[3].u.operand;
    364364    if (isOperandConstantImmediateInt(op2)) {
    365365        int shift = getConstantOperand(op2).asInt32();
     
    414414}
    415415
    416 void JIT::emit_compareAndJump(OpcodeID, unsigned op1, unsigned op2, unsigned target, RelationalCondition condition)
     416void JIT::emit_compareAndJump(OpcodeID, int op1, int op2, unsigned target, RelationalCondition condition)
    417417{
    418418    // We generate inline code for the following cases in the fast path:
     
    458458}
    459459
    460 void JIT::emit_compareAndJumpSlow(unsigned op1, unsigned op2, unsigned target, DoubleCondition condition, int (JIT_STUB *stub)(STUB_ARGS_DECLARATION), bool invert, Vector<SlowCaseEntry>::iterator& iter)
     460void JIT::emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondition condition, int (JIT_STUB *stub)(STUB_ARGS_DECLARATION), bool invert, Vector<SlowCaseEntry>::iterator& iter)
    461461{
    462462    COMPILE_ASSERT(OPCODE_LENGTH(op_jless) == OPCODE_LENGTH(op_jlesseq), OPCODE_LENGTH_op_jlesseq_equals_op_jless);
     
    568568void JIT::emit_op_bitand(Instruction* currentInstruction)
    569569{
    570     unsigned result = currentInstruction[1].u.operand;
    571     unsigned op1 = currentInstruction[2].u.operand;
    572     unsigned op2 = currentInstruction[3].u.operand;
     570    int result = currentInstruction[1].u.operand;
     571    int op1 = currentInstruction[2].u.operand;
     572    int op2 = currentInstruction[3].u.operand;
    573573
    574574    if (isOperandConstantImmediateInt(op1)) {
     
    596596void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    597597{
    598     unsigned result = currentInstruction[1].u.operand;
     598    int result = currentInstruction[1].u.operand;
    599599
    600600    linkSlowCase(iter);
     
    607607void JIT::emit_op_inc(Instruction* currentInstruction)
    608608{
    609     unsigned srcDst = currentInstruction[1].u.operand;
     609    int srcDst = currentInstruction[1].u.operand;
    610610
    611611    emitGetVirtualRegister(srcDst, regT0);
     
    618618void JIT::emitSlow_op_inc(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    619619{
    620     unsigned srcDst = currentInstruction[1].u.operand;
     620    int srcDst = currentInstruction[1].u.operand;
    621621
    622622    linkSlowCase(iter);
     
    629629void JIT::emit_op_dec(Instruction* currentInstruction)
    630630{
    631     unsigned srcDst = currentInstruction[1].u.operand;
     631    int srcDst = currentInstruction[1].u.operand;
    632632
    633633    emitGetVirtualRegister(srcDst, regT0);
     
    640640void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    641641{
    642     unsigned srcDst = currentInstruction[1].u.operand;
     642    int srcDst = currentInstruction[1].u.operand;
    643643
    644644    linkSlowCase(iter);
     
    655655void JIT::emit_op_mod(Instruction* currentInstruction)
    656656{
    657     unsigned result = currentInstruction[1].u.operand;
    658     unsigned op1 = currentInstruction[2].u.operand;
    659     unsigned op2 = currentInstruction[3].u.operand;
     657    int result = currentInstruction[1].u.operand;
     658    int op1 = currentInstruction[2].u.operand;
     659    int op2 = currentInstruction[3].u.operand;
    660660
    661661    // Make sure registers are correct for x86 IDIV instructions.
     
    684684void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    685685{
    686     unsigned result = currentInstruction[1].u.operand;
     686    int result = currentInstruction[1].u.operand;
    687687
    688688    linkSlowCase(iter);
     
    700700void JIT::emit_op_mod(Instruction* currentInstruction)
    701701{
    702     unsigned result = currentInstruction[1].u.operand;
    703     unsigned op1 = currentInstruction[2].u.operand;
    704     unsigned op2 = currentInstruction[3].u.operand;
     702    int result = currentInstruction[1].u.operand;
     703    int op1 = currentInstruction[2].u.operand;
     704    int op2 = currentInstruction[3].u.operand;
    705705
    706706    UNUSED_PARAM(op1);
     
    723723/* ------------------------------ BEGIN: USE(JSVALUE64) (OP_ADD, OP_SUB, OP_MUL) ------------------------------ */
    724724
    725 void JIT::compileBinaryArithOp(OpcodeID opcodeID, unsigned, unsigned op1, unsigned op2, OperandTypes)
     725void JIT::compileBinaryArithOp(OpcodeID opcodeID, int, int op1, int op2, OperandTypes)
    726726{
    727727    emitGetVirtualRegisters(op1, regT0, op2, regT1);
     
    769769}
    770770
    771 void JIT::compileBinaryArithOpSlowCase(Instruction* currentInstruction, OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned result, unsigned op1, unsigned op2, OperandTypes types, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase)
     771void JIT::compileBinaryArithOpSlowCase(Instruction* currentInstruction, OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, int result, int op1, int op2, OperandTypes types, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase)
    772772{
    773773    // We assume that subtracting TagTypeNumber is equivalent to adding DoubleEncodeOffset.
     
    855855void JIT::emit_op_add(Instruction* currentInstruction)
    856856{
    857     unsigned result = currentInstruction[1].u.operand;
    858     unsigned op1 = currentInstruction[2].u.operand;
    859     unsigned op2 = currentInstruction[3].u.operand;
     857    int result = currentInstruction[1].u.operand;
     858    int op1 = currentInstruction[2].u.operand;
     859    int op2 = currentInstruction[3].u.operand;
    860860    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    861861
     
    885885void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    886886{
    887     unsigned result = currentInstruction[1].u.operand;
    888     unsigned op1 = currentInstruction[2].u.operand;
    889     unsigned op2 = currentInstruction[3].u.operand;
     887    int result = currentInstruction[1].u.operand;
     888    int op1 = currentInstruction[2].u.operand;
     889    int op2 = currentInstruction[3].u.operand;
    890890    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    891891
     
    902902void JIT::emit_op_mul(Instruction* currentInstruction)
    903903{
    904     unsigned result = currentInstruction[1].u.operand;
    905     unsigned op1 = currentInstruction[2].u.operand;
    906     unsigned op2 = currentInstruction[3].u.operand;
     904    int result = currentInstruction[1].u.operand;
     905    int op1 = currentInstruction[2].u.operand;
     906    int op2 = currentInstruction[3].u.operand;
    907907    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    908908
     
    935935void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    936936{
    937     unsigned result = currentInstruction[1].u.operand;
    938     unsigned op1 = currentInstruction[2].u.operand;
    939     unsigned op2 = currentInstruction[3].u.operand;
     937    int result = currentInstruction[1].u.operand;
     938    int op1 = currentInstruction[2].u.operand;
     939    int op2 = currentInstruction[3].u.operand;
    940940    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    941941
     
    947947void JIT::emit_op_div(Instruction* currentInstruction)
    948948{
    949     unsigned dst = currentInstruction[1].u.operand;
    950     unsigned op1 = currentInstruction[2].u.operand;
    951     unsigned op2 = currentInstruction[3].u.operand;
     949    int dst = currentInstruction[1].u.operand;
     950    int op1 = currentInstruction[2].u.operand;
     951    int op2 = currentInstruction[3].u.operand;
    952952    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    953953
     
    10291029void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    10301030{
    1031     unsigned result = currentInstruction[1].u.operand;
    1032     unsigned op1 = currentInstruction[2].u.operand;
    1033     unsigned op2 = currentInstruction[3].u.operand;
     1031    int result = currentInstruction[1].u.operand;
     1032    int op1 = currentInstruction[2].u.operand;
     1033    int op2 = currentInstruction[3].u.operand;
    10341034    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    10351035    if (types.first().definitelyIsNumber() && types.second().definitelyIsNumber()) {
     
    10551055void JIT::emit_op_sub(Instruction* currentInstruction)
    10561056{
    1057     unsigned result = currentInstruction[1].u.operand;
    1058     unsigned op1 = currentInstruction[2].u.operand;
    1059     unsigned op2 = currentInstruction[3].u.operand;
     1057    int result = currentInstruction[1].u.operand;
     1058    int op1 = currentInstruction[2].u.operand;
     1059    int op2 = currentInstruction[3].u.operand;
    10601060    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    10611061
     
    10661066void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    10671067{
    1068     unsigned result = currentInstruction[1].u.operand;
    1069     unsigned op1 = currentInstruction[2].u.operand;
    1070     unsigned op2 = currentInstruction[3].u.operand;
     1068    int result = currentInstruction[1].u.operand;
     1069    int op1 = currentInstruction[2].u.operand;
     1070    int op2 = currentInstruction[3].u.operand;
    10711071    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    10721072
Note: See TracChangeset for help on using the changeset viewer.