Changeset 39266 in webkit for trunk/JavaScriptCore/jit/JIT.cpp


Ignore:
Timestamp:
Dec 12, 2008, 7:18:10 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-12 Gavin Barraclough <[email protected]>

Reviewed by Geoff Garen.

Remove loop counter 'i' from the JIT generation passes, replace with a member m_bytecodeIndex.

No impact on performance.

  • jit/JIT.cpp: (JSC::JIT::compileOpStrictEq): (JSC::JIT::emitSlowScriptCheck): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile):
  • jit/JIT.h: (JSC::CallRecord::CallRecord): (JSC::JmpTable::JmpTable): (JSC::JIT::emitCTICall):
  • jit/JITArithmetic.cpp: (JSC::JIT::compileBinaryArithOp): (JSC::JIT::compileBinaryArithOpSlowCase):
  • jit/JITCall.cpp: (JSC::JIT::compileOpCall): (JSC::JIT::compileOpCallSlowCase):
  • jit/JITInlineMethods.h: (JSC::JIT::emitGetVirtualRegister): (JSC::JIT::emitGetVirtualRegisters): (JSC::JIT::emitNakedCall): (JSC::JIT::emitCTICall_internal): (JSC::JIT::emitJumpSlowCaseIfJSCell): (JSC::JIT::emitJumpSlowCaseIfNotJSCell): (JSC::JIT::emitJumpSlowCaseIfNotImmNum): (JSC::JIT::emitJumpSlowCaseIfNotImmNums): (JSC::JIT::emitFastArithIntToImmOrSlowCase): (JSC::JIT::addSlowCase): (JSC::JIT::addJump): (JSC::JIT::emitJumpSlowToHot):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::compileGetByIdHotPath): (JSC::JIT::compileGetByIdSlowCase): (JSC::JIT::compilePutByIdHotPath): (JSC::JIT::compilePutByIdSlowCase):
File:
1 edited

Legend:

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

    r39265 r39266  
    134134}
    135135
    136 #ifndef NDEBUG
    137 
    138 void JIT::printBytecodeOperandTypes(unsigned src1, unsigned src2)
    139 {
    140     char which1 = '*';
    141     if (m_codeBlock->isConstantRegisterIndex(src1)) {
    142         JSValue* value = m_codeBlock->getConstant(src1);
    143         which1 =
    144             JSImmediate::isImmediate(value) ?
    145                 (JSImmediate::isNumber(value) ? 'i' :
    146                 JSImmediate::isBoolean(value) ? 'b' :
    147                 value->isUndefined() ? 'u' :
    148                 value->isNull() ? 'n' : '?')
    149                 :
    150             (value->isString() ? 's' :
    151             value->isObject() ? 'o' :
    152             'k');
    153     }
    154     char which2 = '*';
    155     if (m_codeBlock->isConstantRegisterIndex(src2)) {
    156         JSValue* value = m_codeBlock->getConstant(src2);
    157         which2 =
    158             JSImmediate::isImmediate(value) ?
    159                 (JSImmediate::isNumber(value) ? 'i' :
    160                 JSImmediate::isBoolean(value) ? 'b' :
    161                 value->isUndefined() ? 'u' :
    162                 value->isNull() ? 'n' : '?')
    163                 :
    164             (value->isString() ? 's' :
    165             value->isObject() ? 'o' :
    166             'k');
    167     }
    168     if ((which1 != '*') | (which2 != '*'))
    169         fprintf(stderr, "Types %c %c\n", which1, which2);
    170 }
    171 
    172 #endif
    173 
    174136JIT::JIT(JSGlobalData* globalData, CodeBlock* codeBlock)
    175137    : m_interpreter(globalData->interpreter)
     
    184146}
    185147
    186 #define CTI_COMPILE_BINARY_OP(name) \
    187     case name: { \
    188         emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); \
    189         emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx); \
    190         emitCTICall(i, Interpreter::cti_##name); \
    191         emitPutVirtualRegister(instruction[i + 1].u.operand); \
    192         i += 4; \
    193         break; \
    194     }
    195 
    196 #define CTI_COMPILE_UNARY_OP(name) \
    197     case name: { \
    198         emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); \
    199         emitCTICall(i, Interpreter::cti_##name); \
    200         emitPutVirtualRegister(instruction[i + 1].u.operand); \
    201         i += 3; \
    202         break; \
    203     }
    204 
    205 void JIT::compileOpStrictEq(Instruction* instruction, unsigned i, CompileOpStrictEqType type)
     148void JIT::compileOpStrictEq(Instruction* currentInstruction, CompileOpStrictEqType type)
    206149{
    207150    bool negated = (type == OpNStrictEq);
    208151
    209     unsigned dst = instruction[1].u.operand;
    210     unsigned src1 = instruction[2].u.operand;
    211     unsigned src2 = instruction[3].u.operand;
    212 
    213     emitGetVirtualRegisters(src1, X86::eax, src2, X86::edx, i);
     152    unsigned dst = currentInstruction[1].u.operand;
     153    unsigned src1 = currentInstruction[2].u.operand;
     154    unsigned src2 = currentInstruction[3].u.operand;
     155
     156    emitGetVirtualRegisters(src1, X86::eax, src2, X86::edx);
    214157
    215158    // Check that bot are immediates, if so check if they're equal
     
    226169    // otherwise these values are not equal.
    227170    firstNotImmediate.link(this);
    228     emitJumpSlowCaseIfJSCell(X86::edx, i);
    229     m_slowCases.append(SlowCaseEntry(je32(X86::edx, Imm32(asInteger(JSImmediate::zeroImmediate()))), i));
     171    emitJumpSlowCaseIfJSCell(X86::edx);
     172    addSlowCase(je32(X86::edx, Imm32(asInteger(JSImmediate::zeroImmediate()))));
    230173    Jump firstWasNotImmediate = jump();
    231174
     
    233176    // If eax is 0 jump to a slow case, otherwise these values are not equal.
    234177    secondNotImmediate.link(this);
    235     m_slowCases.append(SlowCaseEntry(je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate()))), i));
     178    addSlowCase(je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate()))));
    236179
    237180    // We get here if the two values are different immediates, or one is 0 and the other is a JSCell.
     
    245188}
    246189
    247 void JIT::emitSlowScriptCheck(unsigned bytecodeIndex)
     190void JIT::emitSlowScriptCheck()
    248191{
    249192    Jump skipTimeout = jnzSub32(Imm32(1), X86::esi);
    250     emitCTICall(bytecodeIndex, Interpreter::cti_timeout_check);
     193    emitCTICall(Interpreter::cti_timeout_check);
    251194    move(X86::eax, X86::esi);
    252195    skipTimeout.link(this);
     
    255198}
    256199
     200
     201#define NEXT_OPCODE(name) \
     202    m_bytecodeIndex += OPCODE_LENGTH(name); \
     203    break;
     204
     205#define CTI_COMPILE_BINARY_OP(name) \
     206    case name: { \
     207        emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 0, X86::ecx); \
     208        emitPutCTIArgFromVirtualRegister(currentInstruction[3].u.operand, 4, X86::ecx); \
     209        emitCTICall(Interpreter::cti_##name); \
     210        emitPutVirtualRegister(currentInstruction[1].u.operand); \
     211        NEXT_OPCODE(name); \
     212    }
     213
     214#define CTI_COMPILE_UNARY_OP(name) \
     215    case name: { \
     216        emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 0, X86::ecx); \
     217        emitCTICall(Interpreter::cti_##name); \
     218        emitPutVirtualRegister(currentInstruction[1].u.operand); \
     219        NEXT_OPCODE(name); \
     220    }
     221
    257222void JIT::privateCompileMainPass()
    258223{
    259     Instruction* instruction = m_codeBlock->instructions().begin();
     224    Instruction* instructionsBegin = m_codeBlock->instructions().begin();
    260225    unsigned instructionCount = m_codeBlock->instructions().size();
    261 
    262226    unsigned propertyAccessInstructionIndex = 0;
    263227    unsigned globalResolveInfoIndex = 0;
    264228    unsigned callLinkInfoIndex = 0;
    265229
    266     for (unsigned i = 0; i < instructionCount; ) {
    267         ASSERT_WITH_MESSAGE(m_interpreter->isOpcode(instruction[i].u.opcode), "privateCompileMainPass gone bad @ %d", i);
     230    for (m_bytecodeIndex = 0; m_bytecodeIndex < instructionCount; ) {
     231        Instruction* currentInstruction = instructionsBegin + m_bytecodeIndex;
     232        ASSERT_WITH_MESSAGE(m_interpreter->isOpcode(currentInstruction->u.opcode), "privateCompileMainPass gone bad @ %d", m_bytecodeIndex);
    268233
    269234#if ENABLE(OPCODE_SAMPLING)
    270         if (i > 0) // Avoid the overhead of sampling op_enter twice.
    271             store32(m_interpreter->sampler()->encodeSample(instruction + i), m_interpreter->sampler()->sampleSlot());
     235        if (m_bytecodeIndex > 0) // Avoid the overhead of sampling op_enter twice.
     236            store32(m_interpreter->sampler()->encodeSample(currentInstruction), m_interpreter->sampler()->sampleSlot());
    272237#endif
    273238
    274         m_labels[i] = __ label();
    275         OpcodeID opcodeID = m_interpreter->getOpcodeID(instruction[i].u.opcode);
     239        m_labels[m_bytecodeIndex] = __ label();
     240        OpcodeID opcodeID = m_interpreter->getOpcodeID(currentInstruction->u.opcode);
     241
    276242        switch (opcodeID) {
    277243        case op_mov: {
    278             emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i);
    279             emitPutVirtualRegister(instruction[i + 1].u.operand);
    280             i += OPCODE_LENGTH(op_mov);
    281             break;
     244            emitGetVirtualRegister(currentInstruction[2].u.operand, X86::eax);
     245            emitPutVirtualRegister(currentInstruction[1].u.operand);
     246            NEXT_OPCODE(op_mov);
    282247        }
    283248        case op_add: {
    284             unsigned dst = instruction[i + 1].u.operand;
    285             unsigned src1 = instruction[i + 2].u.operand;
    286             unsigned src2 = instruction[i + 3].u.operand;
     249            unsigned dst = currentInstruction[1].u.operand;
     250            unsigned src1 = currentInstruction[2].u.operand;
     251            unsigned src2 = currentInstruction[3].u.operand;
    287252
    288253            if (JSValue* value = getConstantImmediateNumericArg(src1)) {
    289                 emitGetVirtualRegister(src2, X86::eax, i);
    290                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    291                 m_slowCases.append(SlowCaseEntry(joAdd32(Imm32(getDeTaggedConstantImmediate(value)), X86::eax), i));
     254                emitGetVirtualRegister(src2, X86::eax);
     255                emitJumpSlowCaseIfNotImmNum(X86::eax);
     256                addSlowCase(joAdd32(Imm32(getDeTaggedConstantImmediate(value)), X86::eax));
    292257                emitPutVirtualRegister(dst);
    293258            } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
    294                 emitGetVirtualRegister(src1, X86::eax, i);
    295                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    296                 m_slowCases.append(SlowCaseEntry(joAdd32(Imm32(getDeTaggedConstantImmediate(value)), X86::eax), i));
     259                emitGetVirtualRegister(src1, X86::eax);
     260                emitJumpSlowCaseIfNotImmNum(X86::eax);
     261                addSlowCase(joAdd32(Imm32(getDeTaggedConstantImmediate(value)), X86::eax));
    297262                emitPutVirtualRegister(dst);
    298263            } else {
    299                 OperandTypes types = OperandTypes::fromInt(instruction[i + 4].u.operand);
     264                OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    300265                if (types.first().mightBeNumber() && types.second().mightBeNumber())
    301                     compileBinaryArithOp(op_add, instruction[i + 1].u.operand, instruction[i + 2].u.operand, instruction[i + 3].u.operand, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
     266                    compileBinaryArithOp(op_add, currentInstruction[1].u.operand, currentInstruction[2].u.operand, currentInstruction[3].u.operand, OperandTypes::fromInt(currentInstruction[4].u.operand));
    302267                else {
    303                     emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx);
    304                     emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx);
    305                     emitCTICall(i, Interpreter::cti_op_add);
    306                     emitPutVirtualRegister(instruction[i + 1].u.operand);
     268                    emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 0, X86::ecx);
     269                    emitPutCTIArgFromVirtualRegister(currentInstruction[3].u.operand, 4, X86::ecx);
     270                    emitCTICall(Interpreter::cti_op_add);
     271                    emitPutVirtualRegister(currentInstruction[1].u.operand);
    307272                }
    308273            }
    309 
    310             i += OPCODE_LENGTH(op_add);
    311             break;
     274            NEXT_OPCODE(op_add);
    312275        }
    313276        case op_end: {
    314277            if (m_codeBlock->needsFullScopeChain())
    315                 emitCTICall(i, Interpreter::cti_op_end);
    316             emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
     278                emitCTICall(Interpreter::cti_op_end);
     279            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    317280            __ pushl_m(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), X86::edi);
    318281            __ ret();
    319             i += OPCODE_LENGTH(op_end);
    320             break;
     282            NEXT_OPCODE(op_end);
    321283        }
    322284        case op_jmp: {
    323             unsigned target = instruction[i + 1].u.operand;
    324             m_jmpTable.append(JmpTable(jump(), i + 1 + target));
    325             i += OPCODE_LENGTH(op_jmp);
    326             break;
     285            unsigned target = currentInstruction[1].u.operand;
     286            addJump(jump(), target + 1);
     287            NEXT_OPCODE(op_jmp);
    327288        }
    328289        case op_pre_inc: {
    329             int srcDst = instruction[i + 1].u.operand;
    330             emitGetVirtualRegister(srcDst, X86::eax, i);
    331             emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    332             m_slowCases.append(SlowCaseEntry(joAdd32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::eax), i));
     290            int srcDst = currentInstruction[1].u.operand;
     291            emitGetVirtualRegister(srcDst, X86::eax);
     292            emitJumpSlowCaseIfNotImmNum(X86::eax);
     293            addSlowCase(joAdd32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::eax));
    333294            emitPutVirtualRegister(srcDst);
    334             i += OPCODE_LENGTH(op_pre_inc);
    335             break;
     295            NEXT_OPCODE(op_pre_inc);
    336296        }
    337297        case op_loop: {
    338             emitSlowScriptCheck(i);
    339 
    340             unsigned target = instruction[i + 1].u.operand;
    341             m_jmpTable.append(JmpTable(jump(), i + 1 + target));
    342             i += OPCODE_LENGTH(op_end);
    343             break;
     298            emitSlowScriptCheck();
     299
     300            unsigned target = currentInstruction[1].u.operand;
     301            addJump(jump(), target + 1);
     302            NEXT_OPCODE(op_end);
    344303        }
    345304        case op_loop_if_less: {
    346             emitSlowScriptCheck(i);
    347 
    348             unsigned target = instruction[i + 3].u.operand;
    349             JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
     305            emitSlowScriptCheck();
     306
     307            unsigned target = currentInstruction[3].u.operand;
     308            JSValue* src2imm = getConstantImmediateNumericArg(currentInstruction[2].u.operand);
    350309            if (src2imm) {
    351                 emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
    352                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    353                 m_jmpTable.append(JmpTable(jl32(X86::eax, Imm32(asInteger(src2imm))), i + 3 + target));
     310                emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
     311                emitJumpSlowCaseIfNotImmNum(X86::eax);
     312                addJump(jl32(X86::eax, Imm32(asInteger(src2imm))), target + 3);
    354313            } else {
    355                 emitGetVirtualRegisters(instruction[i + 1].u.operand, X86::eax, instruction[i + 2].u.operand, X86::edx, i);
    356                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    357                 emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    358                 m_jmpTable.append(JmpTable(jl32(X86::eax, X86::edx), i + 3 + target));
     314                emitGetVirtualRegisters(currentInstruction[1].u.operand, X86::eax, currentInstruction[2].u.operand, X86::edx);
     315                emitJumpSlowCaseIfNotImmNum(X86::eax);
     316                emitJumpSlowCaseIfNotImmNum(X86::edx);
     317                addJump(jl32(X86::eax, X86::edx), target + 3);
    359318            }
    360             i += OPCODE_LENGTH(op_loop_if_less);
    361             break;
     319            NEXT_OPCODE(op_loop_if_less);
    362320        }
    363321        case op_loop_if_lesseq: {
    364             emitSlowScriptCheck(i);
    365 
    366             unsigned target = instruction[i + 3].u.operand;
    367             JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
     322            emitSlowScriptCheck();
     323
     324            unsigned target = currentInstruction[3].u.operand;
     325            JSValue* src2imm = getConstantImmediateNumericArg(currentInstruction[2].u.operand);
    368326            if (src2imm) {
    369                 emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
    370                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    371                 m_jmpTable.append(JmpTable(jle32(X86::eax, Imm32(asInteger(src2imm))), i + 3 + target));
     327                emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
     328                emitJumpSlowCaseIfNotImmNum(X86::eax);
     329                addJump(jle32(X86::eax, Imm32(asInteger(src2imm))), target + 3);
    372330            } else {
    373                 emitGetVirtualRegisters(instruction[i + 1].u.operand, X86::eax, instruction[i + 2].u.operand, X86::edx, i);
    374                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    375                 emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    376                 m_jmpTable.append(JmpTable(jle32(X86::eax, X86::edx), i + 3 + target));
     331                emitGetVirtualRegisters(currentInstruction[1].u.operand, X86::eax, currentInstruction[2].u.operand, X86::edx);
     332                emitJumpSlowCaseIfNotImmNum(X86::eax);
     333                emitJumpSlowCaseIfNotImmNum(X86::edx);
     334                addJump(jle32(X86::eax, X86::edx), target + 3);
    377335            }
    378             i += OPCODE_LENGTH(op_loop_if_lesseq);
    379             break;
     336            NEXT_OPCODE(op_loop_if_lesseq);
    380337        }
    381338        case op_new_object: {
    382             emitCTICall(i, Interpreter::cti_op_new_object);
    383             emitPutVirtualRegister(instruction[i + 1].u.operand);
    384             i += OPCODE_LENGTH(op_new_object);
    385             break;
     339            emitCTICall(Interpreter::cti_op_new_object);
     340            emitPutVirtualRegister(currentInstruction[1].u.operand);
     341            NEXT_OPCODE(op_new_object);
    386342        }
    387343        case op_put_by_id: {
    388             compilePutByIdHotPath(instruction[i + 1].u.operand, &(m_codeBlock->identifier(instruction[i + 2].u.operand)), instruction[i + 3].u.operand, i, propertyAccessInstructionIndex++);
    389             i += OPCODE_LENGTH(op_put_by_id);
    390             break;
     344            compilePutByIdHotPath(currentInstruction[1].u.operand, &(m_codeBlock->identifier(currentInstruction[2].u.operand)), currentInstruction[3].u.operand, propertyAccessInstructionIndex++);
     345            NEXT_OPCODE(op_put_by_id);
    391346        }
    392347        case op_get_by_id: {
    393             compileGetByIdHotPath(instruction[i + 1].u.operand, instruction[i + 2].u.operand, &(m_codeBlock->identifier(instruction[i + 3].u.operand)), i, propertyAccessInstructionIndex++);
    394             i += OPCODE_LENGTH(op_get_by_id);
    395             break;
     348            compileGetByIdHotPath(currentInstruction[1].u.operand, currentInstruction[2].u.operand, &(m_codeBlock->identifier(currentInstruction[3].u.operand)), propertyAccessInstructionIndex++);
     349            NEXT_OPCODE(op_get_by_id);
    396350        }
    397351        case op_instanceof: {
    398             emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i); // value
    399             emitGetVirtualRegister(instruction[i + 3].u.operand, X86::ecx, i); // baseVal
    400             emitGetVirtualRegister(instruction[i + 4].u.operand, X86::edx, i); // proto
     352            emitGetVirtualRegister(currentInstruction[2].u.operand, X86::eax); // value
     353            emitGetVirtualRegister(currentInstruction[3].u.operand, X86::ecx); // baseVal
     354            emitGetVirtualRegister(currentInstruction[4].u.operand, X86::edx); // proto
    401355
    402356            // check if any are immediates
     
    404358            or32(X86::ecx, X86::ebx);
    405359            or32(X86::edx, X86::ebx);
    406             emitJumpSlowCaseIfNotJSCell(X86::ebx, i);
     360            emitJumpSlowCaseIfNotJSCell(X86::ebx);
    407361
    408362            // check that all are object type - this is a bit of a bithack to avoid excess branching;
     
    415369            sub32(Address(X86::eax, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx);
    416370            sub32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx);
    417             m_slowCases.append(SlowCaseEntry(jne32(Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx), i));
     371            addSlowCase(jne32(Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx));
    418372
    419373            // check that baseVal's flags include ImplementsHasInstance but not OverridesHasInstance
    420374            load32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), X86::ecx);
    421375            and32(Imm32(ImplementsHasInstance | OverridesHasInstance), X86::ecx);
    422             m_slowCases.append(SlowCaseEntry(jne32(X86::ecx, Imm32(ImplementsHasInstance)), i));
    423 
    424             emitGetVirtualRegister(instruction[i + 2].u.operand, X86::ecx, i); // reload value
    425             emitGetVirtualRegister(instruction[i + 4].u.operand, X86::edx, i); // reload proto
     376            addSlowCase(jne32(X86::ecx, Imm32(ImplementsHasInstance)));
     377
     378            emitGetVirtualRegister(currentInstruction[2].u.operand, X86::ecx); // reload value
     379            emitGetVirtualRegister(currentInstruction[4].u.operand, X86::edx); // reload proto
    426380
    427381            // optimistically load true result
     
    442396            exit.link(this);
    443397
    444             emitPutVirtualRegister(instruction[i + 1].u.operand);
    445 
    446             i += OPCODE_LENGTH(op_instanceof);
    447             break;
     398            emitPutVirtualRegister(currentInstruction[1].u.operand);
     399
     400            NEXT_OPCODE(op_instanceof);
    448401        }
    449402        case op_del_by_id: {
    450             emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx);
    451             Identifier* ident = &(m_codeBlock->identifier(instruction[i + 3].u.operand));
     403            emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 0, X86::ecx);
     404            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
    452405            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4);
    453             emitCTICall(i, Interpreter::cti_op_del_by_id);
    454             emitPutVirtualRegister(instruction[i + 1].u.operand);
    455             i += OPCODE_LENGTH(op_del_by_id);
    456             break;
     406            emitCTICall(Interpreter::cti_op_del_by_id);
     407            emitPutVirtualRegister(currentInstruction[1].u.operand);
     408            NEXT_OPCODE(op_del_by_id);
    457409        }
    458410        case op_mul: {
    459             unsigned dst = instruction[i + 1].u.operand;
    460             unsigned src1 = instruction[i + 2].u.operand;
    461             unsigned src2 = instruction[i + 3].u.operand;
     411            unsigned dst = currentInstruction[1].u.operand;
     412            unsigned src1 = currentInstruction[2].u.operand;
     413            unsigned src2 = currentInstruction[3].u.operand;
    462414
    463415            // For now, only plant a fast int case if the constant operand is greater than zero.
     
    466418            int32_t value;
    467419            if (src1Value && ((value = JSImmediate::intValue(src1Value)) > 0)) {
    468                 emitGetVirtualRegister(src2, X86::eax, i);
    469                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     420                emitGetVirtualRegister(src2, X86::eax);
     421                emitJumpSlowCaseIfNotImmNum(X86::eax);
    470422                emitFastArithDeTagImmediate(X86::eax);
    471                 m_slowCases.append(SlowCaseEntry(joMul32(Imm32(value), X86::eax, X86::eax), i));
     423                addSlowCase(joMul32(Imm32(value), X86::eax, X86::eax));
    472424                emitFastArithReTagImmediate(X86::eax);
    473425                emitPutVirtualRegister(dst);
    474426            } else if (src2Value && ((value = JSImmediate::intValue(src2Value)) > 0)) {
    475                 emitGetVirtualRegister(src1, X86::eax, i);
    476                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     427                emitGetVirtualRegister(src1, X86::eax);
     428                emitJumpSlowCaseIfNotImmNum(X86::eax);
    477429                emitFastArithDeTagImmediate(X86::eax);
    478                 m_slowCases.append(SlowCaseEntry(joMul32(Imm32(value), X86::eax, X86::eax), i));
     430                addSlowCase(joMul32(Imm32(value), X86::eax, X86::eax));
    479431                emitFastArithReTagImmediate(X86::eax);
    480432                emitPutVirtualRegister(dst);
    481433            } else
    482                 compileBinaryArithOp(op_mul, instruction[i + 1].u.operand, instruction[i + 2].u.operand, instruction[i + 3].u.operand, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    483 
    484             i += OPCODE_LENGTH(op_mul);
    485             break;
     434                compileBinaryArithOp(op_mul, currentInstruction[1].u.operand, currentInstruction[2].u.operand, currentInstruction[3].u.operand, OperandTypes::fromInt(currentInstruction[4].u.operand));
     435
     436            NEXT_OPCODE(op_mul);
    486437        }
    487438        case op_new_func: {
    488             FuncDeclNode* func = m_codeBlock->function(instruction[i + 2].u.operand);
     439            FuncDeclNode* func = m_codeBlock->function(currentInstruction[2].u.operand);
    489440            emitPutCTIArgConstant(reinterpret_cast<unsigned>(func), 0);
    490             emitCTICall(i, Interpreter::cti_op_new_func);
    491             emitPutVirtualRegister(instruction[i + 1].u.operand);
    492             i += OPCODE_LENGTH(op_new_func);
    493             break;
    494         }
    495         case op_call:
    496         case op_call_eval:
     441            emitCTICall(Interpreter::cti_op_new_func);
     442            emitPutVirtualRegister(currentInstruction[1].u.operand);
     443            NEXT_OPCODE(op_new_func);
     444        }
     445        case op_call: {
     446            compileOpCall(opcodeID, currentInstruction, callLinkInfoIndex++);
     447            NEXT_OPCODE(op_call);
     448        }
     449        case op_call_eval: {
     450            compileOpCall(opcodeID, currentInstruction, callLinkInfoIndex++);
     451            NEXT_OPCODE(op_call_eval);
     452        }
    497453        case op_construct: {
    498             compileOpCall(opcodeID, instruction + i, i, callLinkInfoIndex++);
    499             i += (opcodeID == op_construct ? OPCODE_LENGTH(op_construct) : OPCODE_LENGTH(op_call));
    500             break;
     454            compileOpCall(opcodeID, currentInstruction, callLinkInfoIndex++);
     455            NEXT_OPCODE(op_construct);
    501456        }
    502457        case op_get_global_var: {
    503             JSVariableObject* globalObject = static_cast<JSVariableObject*>(instruction[i + 2].u.jsCell);
     458            JSVariableObject* globalObject = static_cast<JSVariableObject*>(currentInstruction[2].u.jsCell);
    504459            move(ImmPtr(globalObject), X86::eax);
    505             emitGetVariableObjectRegister(X86::eax, instruction[i + 3].u.operand, X86::eax);
    506             emitPutVirtualRegister(instruction[i + 1].u.operand);
    507             i += OPCODE_LENGTH(op_get_global_var);
    508             break;
     460            emitGetVariableObjectRegister(X86::eax, currentInstruction[3].u.operand, X86::eax);
     461            emitPutVirtualRegister(currentInstruction[1].u.operand);
     462            NEXT_OPCODE(op_get_global_var);
    509463        }
    510464        case op_put_global_var: {
    511             emitGetVirtualRegister(instruction[i + 3].u.operand, X86::edx, i);
    512             JSVariableObject* globalObject = static_cast<JSVariableObject*>(instruction[i + 1].u.jsCell);
     465            emitGetVirtualRegister(currentInstruction[3].u.operand, X86::edx);
     466            JSVariableObject* globalObject = static_cast<JSVariableObject*>(currentInstruction[1].u.jsCell);
    513467            move(ImmPtr(globalObject), X86::eax);
    514             emitPutVariableObjectRegister(X86::edx, X86::eax, instruction[i + 2].u.operand);
    515             i += OPCODE_LENGTH(op_put_global_var);
    516             break;
     468            emitPutVariableObjectRegister(X86::edx, X86::eax, currentInstruction[2].u.operand);
     469            NEXT_OPCODE(op_put_global_var);
    517470        }
    518471        case op_get_scoped_var: {
    519             int skip = instruction[i + 3].u.operand + m_codeBlock->needsFullScopeChain();
     472            int skip = currentInstruction[3].u.operand + m_codeBlock->needsFullScopeChain();
    520473
    521474            emitGetFromCallFrameHeader(RegisterFile::ScopeChain, X86::eax);
     
    524477
    525478            loadPtr(Address(X86::eax, FIELD_OFFSET(ScopeChainNode, object)), X86::eax);
    526             emitGetVariableObjectRegister(X86::eax, instruction[i + 2].u.operand, X86::eax);
    527             emitPutVirtualRegister(instruction[i + 1].u.operand);
    528             i += OPCODE_LENGTH(op_get_scoped_var);
    529             break;
     479            emitGetVariableObjectRegister(X86::eax, currentInstruction[2].u.operand, X86::eax);
     480            emitPutVirtualRegister(currentInstruction[1].u.operand);
     481            NEXT_OPCODE(op_get_scoped_var);
    530482        }
    531483        case op_put_scoped_var: {
    532             int skip = instruction[i + 2].u.operand + m_codeBlock->needsFullScopeChain();
     484            int skip = currentInstruction[2].u.operand + m_codeBlock->needsFullScopeChain();
    533485
    534486            emitGetFromCallFrameHeader(RegisterFile::ScopeChain, X86::edx);
    535             emitGetVirtualRegister(instruction[i + 3].u.operand, X86::eax, i);
     487            emitGetVirtualRegister(currentInstruction[3].u.operand, X86::eax);
    536488            while (skip--)
    537489                loadPtr(Address(X86::edx, FIELD_OFFSET(ScopeChainNode, next)), X86::edx);
    538490
    539491            loadPtr(Address(X86::edx, FIELD_OFFSET(ScopeChainNode, object)), X86::edx);
    540             emitPutVariableObjectRegister(X86::eax, X86::edx, instruction[i + 1].u.operand);
    541             i += OPCODE_LENGTH(op_put_scoped_var);
    542             break;
     492            emitPutVariableObjectRegister(X86::eax, X86::edx, currentInstruction[1].u.operand);
     493            NEXT_OPCODE(op_put_scoped_var);
    543494        }
    544495        case op_tear_off_activation: {
    545             emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx);
    546             emitCTICall(i, Interpreter::cti_op_tear_off_activation);
    547             i += OPCODE_LENGTH(op_tear_off_activation);
    548             break;
     496            emitPutCTIArgFromVirtualRegister(currentInstruction[1].u.operand, 0, X86::ecx);
     497            emitCTICall(Interpreter::cti_op_tear_off_activation);
     498            NEXT_OPCODE(op_tear_off_activation);
    549499        }
    550500        case op_tear_off_arguments: {
    551             emitCTICall(i, Interpreter::cti_op_tear_off_arguments);
    552             i += OPCODE_LENGTH(op_tear_off_arguments);
    553             break;
     501            emitCTICall(Interpreter::cti_op_tear_off_arguments);
     502            NEXT_OPCODE(op_tear_off_arguments);
    554503        }
    555504        case op_ret: {
    556505            // We could JIT generate the deref, only calling out to C when the refcount hits zero.
    557506            if (m_codeBlock->needsFullScopeChain())
    558                 emitCTICall(i, Interpreter::cti_op_ret_scopeChain);
     507                emitCTICall(Interpreter::cti_op_ret_scopeChain);
    559508
    560509            // Return the result in %eax.
    561             emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
     510            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    562511
    563512            // Grab the return address.
     
    571520            __ ret();
    572521
    573             i += OPCODE_LENGTH(op_ret);
    574             break;
     522            NEXT_OPCODE(op_ret);
    575523        }
    576524        case op_new_array: {
    577             emitPutCTIArgConstant(instruction[i + 2].u.operand, 0);
    578             emitPutCTIArgConstant(instruction[i + 3].u.operand, 4);
    579             emitCTICall(i, Interpreter::cti_op_new_array);
    580             emitPutVirtualRegister(instruction[i + 1].u.operand);
    581             i += OPCODE_LENGTH(op_new_array);
    582             break;
     525            emitPutCTIArgConstant(currentInstruction[2].u.operand, 0);
     526            emitPutCTIArgConstant(currentInstruction[3].u.operand, 4);
     527            emitCTICall(Interpreter::cti_op_new_array);
     528            emitPutVirtualRegister(currentInstruction[1].u.operand);
     529            NEXT_OPCODE(op_new_array);
    583530        }
    584531        case op_resolve: {
    585             Identifier* ident = &(m_codeBlock->identifier(instruction[i + 2].u.operand));
     532            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
    586533            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0);
    587             emitCTICall(i, Interpreter::cti_op_resolve);
    588             emitPutVirtualRegister(instruction[i + 1].u.operand);
    589             i += OPCODE_LENGTH(op_resolve);
    590             break;
     534            emitCTICall(Interpreter::cti_op_resolve);
     535            emitPutVirtualRegister(currentInstruction[1].u.operand);
     536            NEXT_OPCODE(op_resolve);
    591537        }
    592538        case op_construct_verify: {
    593             emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
    594 
    595             emitJumpSlowCaseIfNotJSCell(X86::eax, i);
     539            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
     540
     541            emitJumpSlowCaseIfNotJSCell(X86::eax);
    596542            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx);
    597             m_slowCases.append(SlowCaseEntry(jne32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type)), Imm32(ObjectType)), i));
    598 
    599             i += OPCODE_LENGTH(op_construct_verify);
    600             break;
     543            addSlowCase(jne32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type)), Imm32(ObjectType)));
     544
     545            NEXT_OPCODE(op_construct_verify);
    601546        }
    602547        case op_get_by_val: {
    603             emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    604             emitJumpSlowCaseIfNotImmNum(X86::edx, i);
     548            emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx);
     549            emitJumpSlowCaseIfNotImmNum(X86::edx);
    605550            emitFastArithImmToInt(X86::edx);
    606             emitJumpSlowCaseIfNotJSCell(X86::eax, i);
    607             m_slowCases.append(SlowCaseEntry(jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)), i));
     551            emitJumpSlowCaseIfNotJSCell(X86::eax);
     552            addSlowCase(jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)));
    608553
    609554            // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff
    610555            loadPtr(Address(X86::eax, FIELD_OFFSET(JSArray, m_storage)), X86::ecx);
    611             m_slowCases.append(SlowCaseEntry(jae32(X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff))), i));
     556            addSlowCase(jae32(X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff))));
    612557
    613558            // Get the value from the vector
    614559            loadPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0])), X86::eax);
    615             emitPutVirtualRegister(instruction[i + 1].u.operand);
    616             i += OPCODE_LENGTH(op_get_by_val);
    617             break;
     560            emitPutVirtualRegister(currentInstruction[1].u.operand);
     561            NEXT_OPCODE(op_get_by_val);
    618562        }
    619563        case op_resolve_func: {
    620             Identifier* ident = &(m_codeBlock->identifier(instruction[i + 3].u.operand));
     564            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
    621565            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0);
    622             emitCTICall(i, Interpreter::cti_op_resolve_func);
    623             emitPutVirtualRegister(instruction[i + 2].u.operand, X86::edx);
    624             emitPutVirtualRegister(instruction[i + 1].u.operand);
    625             i += OPCODE_LENGTH(op_resolve_func);
    626             break;
     566            emitCTICall(Interpreter::cti_op_resolve_func);
     567            emitPutVirtualRegister(currentInstruction[2].u.operand, X86::edx);
     568            emitPutVirtualRegister(currentInstruction[1].u.operand);
     569            NEXT_OPCODE(op_resolve_func);
    627570        }
    628571        case op_sub: {
    629             compileBinaryArithOp(op_sub, instruction[i + 1].u.operand, instruction[i + 2].u.operand, instruction[i + 3].u.operand, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    630             i += OPCODE_LENGTH(op_sub);
    631             break;
     572            compileBinaryArithOp(op_sub, currentInstruction[1].u.operand, currentInstruction[2].u.operand, currentInstruction[3].u.operand, OperandTypes::fromInt(currentInstruction[4].u.operand));
     573            NEXT_OPCODE(op_sub);
    632574        }
    633575        case op_put_by_val: {
    634             emitGetVirtualRegisters(instruction[i + 1].u.operand, X86::eax, instruction[i + 2].u.operand, X86::edx, i);
    635             emitJumpSlowCaseIfNotImmNum(X86::edx, i);
     576            emitGetVirtualRegisters(currentInstruction[1].u.operand, X86::eax, currentInstruction[2].u.operand, X86::edx);
     577            emitJumpSlowCaseIfNotImmNum(X86::edx);
    636578            emitFastArithImmToInt(X86::edx);
    637             emitJumpSlowCaseIfNotJSCell(X86::eax, i);
    638             m_slowCases.append(SlowCaseEntry(jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)), i));
     579            emitJumpSlowCaseIfNotJSCell(X86::eax);
     580            addSlowCase(jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)));
    639581
    640582            // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff
     
    642584            Jump inFastVector = jb32(X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff)));
    643585            // No; oh well, check if the access if within the vector - if so, we may still be okay.
    644             m_slowCases.append(SlowCaseEntry(jae32(X86::edx, Address(X86::ecx, FIELD_OFFSET(ArrayStorage, m_vectorLength))), i));
     586            addSlowCase(jae32(X86::edx, Address(X86::ecx, FIELD_OFFSET(ArrayStorage, m_vectorLength))));
    645587
    646588            // This is a write to the slow part of the vector; first, we have to check if this would be the first write to this location.
    647589            // FIXME: should be able to handle initial write to array; increment the the number of items in the array, and potentially update fast access cutoff.
    648             m_slowCases.append(SlowCaseEntry(jzPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0]))), i));
     590            addSlowCase(jzPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0]))));
    649591
    650592            // All good - put the value into the array.
    651593            inFastVector.link(this);
    652             emitGetVirtualRegister(instruction[i + 3].u.operand, X86::eax, i);
     594            emitGetVirtualRegister(currentInstruction[3].u.operand, X86::eax);
    653595            storePtr(X86::eax, BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0])));
    654             i += OPCODE_LENGTH(op_put_by_val);
    655             break;
     596            NEXT_OPCODE(op_put_by_val);
    656597        }
    657598        CTI_COMPILE_BINARY_OP(op_lesseq)
    658599        case op_loop_if_true: {
    659             emitSlowScriptCheck(i);
    660 
    661             unsigned target = instruction[i + 2].u.operand;
    662             emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
     600            emitSlowScriptCheck();
     601
     602            unsigned target = currentInstruction[2].u.operand;
     603            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    663604
    664605            Jump isZero = je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate())));
    665             m_jmpTable.append(JmpTable(jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)), i + 2 + target));
    666 
    667             m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), i + 2 + target));
    668             m_slowCases.append(SlowCaseEntry(jne32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))), i));
     606            addJump(jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)), target + 2);
     607
     608            addJump(je32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), target + 2);
     609            addSlowCase(jne32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))));
    669610
    670611            isZero.link(this);
    671             i += OPCODE_LENGTH(op_loop_if_true);
    672             break;
     612            NEXT_OPCODE(op_loop_if_true);
    673613        };
    674614        case op_resolve_base: {
    675             Identifier* ident = &(m_codeBlock->identifier(instruction[i + 2].u.operand));
     615            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
    676616            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0);
    677             emitCTICall(i, Interpreter::cti_op_resolve_base);
    678             emitPutVirtualRegister(instruction[i + 1].u.operand);
    679             i += OPCODE_LENGTH(op_resolve_base);
    680             break;
     617            emitCTICall(Interpreter::cti_op_resolve_base);
     618            emitPutVirtualRegister(currentInstruction[1].u.operand);
     619            NEXT_OPCODE(op_resolve_base);
    681620        }
    682621        case op_negate: {
    683             emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx);
    684             emitCTICall(i, Interpreter::cti_op_negate);
    685             emitPutVirtualRegister(instruction[i + 1].u.operand);
    686             i += OPCODE_LENGTH(op_negate);
    687             break;
     622            emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 0, X86::ecx);
     623            emitCTICall(Interpreter::cti_op_negate);
     624            emitPutVirtualRegister(currentInstruction[1].u.operand);
     625            NEXT_OPCODE(op_negate);
    688626        }
    689627        case op_resolve_skip: {
    690             Identifier* ident = &(m_codeBlock->identifier(instruction[i + 2].u.operand));
     628            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
    691629            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0);
    692             emitPutCTIArgConstant(instruction[i + 3].u.operand + m_codeBlock->needsFullScopeChain(), 4);
    693             emitCTICall(i, Interpreter::cti_op_resolve_skip);
    694             emitPutVirtualRegister(instruction[i + 1].u.operand);
    695             i += OPCODE_LENGTH(op_resolve_skip);
    696             break;
     630            emitPutCTIArgConstant(currentInstruction[3].u.operand + m_codeBlock->needsFullScopeChain(), 4);
     631            emitCTICall(Interpreter::cti_op_resolve_skip);
     632            emitPutVirtualRegister(currentInstruction[1].u.operand);
     633            NEXT_OPCODE(op_resolve_skip);
    697634        }
    698635        case op_resolve_global: {
    699636            // Fast case
    700             void* globalObject = instruction[i + 2].u.jsCell;
    701             Identifier* ident = &(m_codeBlock->identifier(instruction[i + 3].u.operand));
     637            void* globalObject = currentInstruction[2].u.jsCell;
     638            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
    702639           
    703640            unsigned currentIndex = globalResolveInfoIndex++;
     
    714651            load32(offsetAddr, X86::edx);
    715652            loadPtr(BaseIndex(X86::eax, X86::edx, ScalePtr), X86::eax);
    716             emitPutVirtualRegister(instruction[i + 1].u.operand);
     653            emitPutVirtualRegister(currentInstruction[1].u.operand);
    717654            Jump end = jump();
    718655
     
    722659            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4);
    723660            emitPutCTIArgConstant(currentIndex, 8);
    724             emitCTICall(i, Interpreter::cti_op_resolve_global);
    725             emitPutVirtualRegister(instruction[i + 1].u.operand);
     661            emitCTICall(Interpreter::cti_op_resolve_global);
     662            emitPutVirtualRegister(currentInstruction[1].u.operand);
    726663            end.link(this);
    727             i += OPCODE_LENGTH(op_resolve_global);
    728             break;
     664            NEXT_OPCODE(op_resolve_global);
    729665        }
    730666        CTI_COMPILE_BINARY_OP(op_div)
    731667        case op_pre_dec: {
    732             int srcDst = instruction[i + 1].u.operand;
    733             emitGetVirtualRegister(srcDst, X86::eax, i);
    734             emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    735             m_slowCases.append(SlowCaseEntry(joSub32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::eax), i));
     668            int srcDst = currentInstruction[1].u.operand;
     669            emitGetVirtualRegister(srcDst, X86::eax);
     670            emitJumpSlowCaseIfNotImmNum(X86::eax);
     671            addSlowCase(joSub32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::eax));
    736672            emitPutVirtualRegister(srcDst);
    737             i += OPCODE_LENGTH(op_pre_dec);
    738             break;
     673            NEXT_OPCODE(op_pre_dec);
    739674        }
    740675        case op_jnless: {
    741             unsigned target = instruction[i + 3].u.operand;
    742             JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
     676            unsigned target = currentInstruction[3].u.operand;
     677            JSValue* src2imm = getConstantImmediateNumericArg(currentInstruction[2].u.operand);
    743678            if (src2imm) {
    744                 emitGetVirtualRegister(instruction[i + 1].u.operand, X86::edx, i);
    745                 emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    746                 m_jmpTable.append(JmpTable(jge32(X86::edx, Imm32(asInteger(src2imm))), i + 3 + target));
     679                emitGetVirtualRegister(currentInstruction[1].u.operand, X86::edx);
     680                emitJumpSlowCaseIfNotImmNum(X86::edx);
     681                addJump(jge32(X86::edx, Imm32(asInteger(src2imm))), target + 3);
    747682            } else {
    748                 emitGetVirtualRegisters(instruction[i + 1].u.operand, X86::eax, instruction[i + 2].u.operand, X86::edx, i);
    749                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    750                 emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    751                 m_jmpTable.append(JmpTable(jge32(X86::eax, X86::edx), i + 3 + target));
     683                emitGetVirtualRegisters(currentInstruction[1].u.operand, X86::eax, currentInstruction[2].u.operand, X86::edx);
     684                emitJumpSlowCaseIfNotImmNum(X86::eax);
     685                emitJumpSlowCaseIfNotImmNum(X86::edx);
     686                addJump(jge32(X86::eax, X86::edx), target + 3);
    752687            }
    753             i += OPCODE_LENGTH(op_jnless);
    754             break;
     688            NEXT_OPCODE(op_jnless);
    755689        }
    756690        case op_not: {
    757             emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i);
     691            emitGetVirtualRegister(currentInstruction[2].u.operand, X86::eax);
    758692            xor32(Imm32(JSImmediate::FullTagTypeBool), X86::eax);
    759             m_slowCases.append(SlowCaseEntry(jnz32(X86::eax, Imm32(JSImmediate::FullTagTypeMask)), i));
     693            addSlowCase(jnz32(X86::eax, Imm32(JSImmediate::FullTagTypeMask)));
    760694            xor32(Imm32(JSImmediate::FullTagTypeBool | JSImmediate::ExtendedPayloadBitBoolValue), X86::eax);
    761             emitPutVirtualRegister(instruction[i + 1].u.operand);
    762             i += OPCODE_LENGTH(op_not);
    763             break;
     695            emitPutVirtualRegister(currentInstruction[1].u.operand);
     696            NEXT_OPCODE(op_not);
    764697        }
    765698        case op_jfalse: {
    766             unsigned target = instruction[i + 2].u.operand;
    767             emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
    768 
    769             m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate()))), i + 2 + target));
     699            unsigned target = currentInstruction[2].u.operand;
     700            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
     701
     702            addJump(je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate()))), target + 2);
    770703            Jump isNonZero = jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger));
    771704
    772             m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))), i + 2 + target));
    773             m_slowCases.append(SlowCaseEntry(jne32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), i));
     705            addJump(je32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))), target + 2);
     706            addSlowCase(jne32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))));
    774707
    775708            isNonZero.link(this);
    776             i += OPCODE_LENGTH(op_jfalse);
    777             break;
     709            NEXT_OPCODE(op_jfalse);
    778710        };
    779711        case op_jeq_null: {
    780             unsigned src = instruction[i + 1].u.operand;
    781             unsigned target = instruction[i + 2].u.operand;
    782 
    783             emitGetVirtualRegister(src, X86::eax, i);
     712            unsigned src = currentInstruction[1].u.operand;
     713            unsigned target = currentInstruction[2].u.operand;
     714
     715            emitGetVirtualRegister(src, X86::eax);
    784716            Jump isImmediate = emitJumpIfNotJSCell(X86::eax);
    785717
    786718            // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure.
    787719            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx);
    788             m_jmpTable.append(JmpTable(jnz32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), i + 2 + target));
     720            addJump(jnz32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target + 2);
    789721            Jump wasNotImmediate = jump();
    790722
     
    792724            isImmediate.link(this);
    793725            and32(Imm32(~JSImmediate::ExtendedTagBitUndefined), X86::eax);
    794             m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(jsNull()))), i + 2 + target));           
     726            addJump(je32(X86::eax, Imm32(asInteger(jsNull()))), target + 2);           
    795727
    796728            wasNotImmediate.link(this);
    797             i += OPCODE_LENGTH(op_jeq_null);
    798             break;
     729            NEXT_OPCODE(op_jeq_null);
    799730        };
    800731        case op_jneq_null: {
    801             unsigned src = instruction[i + 1].u.operand;
    802             unsigned target = instruction[i + 2].u.operand;
    803 
    804             emitGetVirtualRegister(src, X86::eax, i);
     732            unsigned src = currentInstruction[1].u.operand;
     733            unsigned target = currentInstruction[2].u.operand;
     734
     735            emitGetVirtualRegister(src, X86::eax);
    805736            Jump isImmediate = emitJumpIfNotJSCell(X86::eax);
    806737
    807738            // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure.
    808739            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx);
    809             m_jmpTable.append(JmpTable(jz32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), i + 2 + target));
     740            addJump(jz32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target + 2);
    810741            Jump wasNotImmediate = jump();
    811742
     
    813744            isImmediate.link(this);
    814745            and32(Imm32(~JSImmediate::ExtendedTagBitUndefined), X86::eax);
    815             m_jmpTable.append(JmpTable(jne32(X86::eax, Imm32(asInteger(jsNull()))), i + 2 + target));           
     746            addJump(jne32(X86::eax, Imm32(asInteger(jsNull()))), target + 2);           
    816747
    817748            wasNotImmediate.link(this);
    818             i += OPCODE_LENGTH(op_jneq_null);
    819             break;
     749            NEXT_OPCODE(op_jneq_null);
    820750        }
    821751        case op_post_inc: {
    822             int srcDst = instruction[i + 2].u.operand;
    823             emitGetVirtualRegister(srcDst, X86::eax, i);
     752            int srcDst = currentInstruction[2].u.operand;
     753            emitGetVirtualRegister(srcDst, X86::eax);
    824754            move(X86::eax, X86::edx);
    825             emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    826             m_slowCases.append(SlowCaseEntry(joAdd32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::edx), i));
     755            emitJumpSlowCaseIfNotImmNum(X86::eax);
     756            addSlowCase(joAdd32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::edx));
    827757            emitPutVirtualRegister(srcDst, X86::edx);
    828             emitPutVirtualRegister(instruction[i + 1].u.operand);
    829             i += OPCODE_LENGTH(op_post_inc);
    830             break;
     758            emitPutVirtualRegister(currentInstruction[1].u.operand);
     759            NEXT_OPCODE(op_post_inc);
    831760        }
    832761        case op_unexpected_load: {
    833             JSValue* v = m_codeBlock->unexpectedConstant(instruction[i + 2].u.operand);
     762            JSValue* v = m_codeBlock->unexpectedConstant(currentInstruction[2].u.operand);
    834763            move(ImmPtr(v), X86::eax);
    835             emitPutVirtualRegister(instruction[i + 1].u.operand);
    836             i += OPCODE_LENGTH(op_unexpected_load);
    837             break;
     764            emitPutVirtualRegister(currentInstruction[1].u.operand);
     765            NEXT_OPCODE(op_unexpected_load);
    838766        }
    839767        case op_jsr: {
    840             int retAddrDst = instruction[i + 1].u.operand;
    841             int target = instruction[i + 2].u.operand;
     768            int retAddrDst = currentInstruction[1].u.operand;
     769            int target = currentInstruction[2].u.operand;
    842770            __ movl_i32m(0, sizeof(Register) * retAddrDst, X86::edi);
    843771            JmpDst addrPosition = __ label();
    844             m_jmpTable.append(JmpTable(__ jmp(), i + 2 + target));
     772            addJump(__ jmp(), target + 2);
    845773            JmpDst sretTarget = __ label();
    846774            m_jsrSites.append(JSRInfo(addrPosition, sretTarget));
    847             i += OPCODE_LENGTH(op_jsr);
    848             break;
     775            NEXT_OPCODE(op_jsr);
    849776        }
    850777        case op_sret: {
    851             __ jmp_m(sizeof(Register) * instruction[i + 1].u.operand, X86::edi);
    852             i += OPCODE_LENGTH(op_sret);
    853             break;
     778            __ jmp_m(sizeof(Register) * currentInstruction[1].u.operand, X86::edi);
     779            NEXT_OPCODE(op_sret);
    854780        }
    855781        case op_eq: {
    856             emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    857             emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
     782            emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx);
     783            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx);
    858784            sete32(X86::edx, X86::eax);
    859785            emitTagAsBoolImmediate(X86::eax);
    860             emitPutVirtualRegister(instruction[i + 1].u.operand);
    861             i += OPCODE_LENGTH(op_eq);
    862             break;
     786            emitPutVirtualRegister(currentInstruction[1].u.operand);
     787            NEXT_OPCODE(op_eq);
    863788        }
    864789        case op_lshift: {
    865             emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::ecx, i);
    866             emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    867             emitJumpSlowCaseIfNotImmNum(X86::ecx, i);
     790            emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::ecx);
     791            emitJumpSlowCaseIfNotImmNum(X86::eax);
     792            emitJumpSlowCaseIfNotImmNum(X86::ecx);
    868793            emitFastArithImmToInt(X86::eax);
    869794            emitFastArithImmToInt(X86::ecx);
    870795            __ shll_CLr(X86::eax);
    871             emitFastArithIntToImmOrSlowCase(X86::eax, i);
    872             emitPutVirtualRegister(instruction[i + 1].u.operand);
    873             i += OPCODE_LENGTH(op_lshift);
    874             break;
     796            emitFastArithIntToImmOrSlowCase(X86::eax);
     797            emitPutVirtualRegister(currentInstruction[1].u.operand);
     798            NEXT_OPCODE(op_lshift);
    875799        }
    876800        case op_bitand: {
    877             unsigned src1 = instruction[i + 2].u.operand;
    878             unsigned src2 = instruction[i + 3].u.operand;
    879             unsigned dst = instruction[i + 1].u.operand;
     801            unsigned src1 = currentInstruction[2].u.operand;
     802            unsigned src2 = currentInstruction[3].u.operand;
     803            unsigned dst = currentInstruction[1].u.operand;
    880804            if (JSValue* value = getConstantImmediateNumericArg(src1)) {
    881                 emitGetVirtualRegister(src2, X86::eax, i);
    882                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     805                emitGetVirtualRegister(src2, X86::eax);
     806                emitJumpSlowCaseIfNotImmNum(X86::eax);
    883807                and32(Imm32(asInteger(value)), X86::eax); // FIXME: make it more obvious this is relying on the format of JSImmediate
    884808                emitPutVirtualRegister(dst);
    885809            } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
    886                 emitGetVirtualRegister(src1, X86::eax, i);
    887                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     810                emitGetVirtualRegister(src1, X86::eax);
     811                emitJumpSlowCaseIfNotImmNum(X86::eax);
    888812                and32(Imm32(asInteger(value)), X86::eax);
    889813                emitPutVirtualRegister(dst);
    890814            } else {
    891                 emitGetVirtualRegisters(src1, X86::eax, src2, X86::edx, i);
     815                emitGetVirtualRegisters(src1, X86::eax, src2, X86::edx);
    892816                and32(X86::edx, X86::eax);
    893                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     817                emitJumpSlowCaseIfNotImmNum(X86::eax);
    894818                emitPutVirtualRegister(dst);
    895819            }
    896             i += OPCODE_LENGTH(op_bitand);
    897             break;
     820            NEXT_OPCODE(op_bitand);
    898821        }
    899822        case op_rshift: {
    900             unsigned src1 = instruction[i + 2].u.operand;
    901             unsigned src2 = instruction[i + 3].u.operand;
     823            unsigned src1 = currentInstruction[2].u.operand;
     824            unsigned src2 = currentInstruction[3].u.operand;
    902825            if (JSValue* value = getConstantImmediateNumericArg(src2)) {
    903                 emitGetVirtualRegister(src1, X86::eax, i);
    904                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     826                emitGetVirtualRegister(src1, X86::eax);
     827                emitJumpSlowCaseIfNotImmNum(X86::eax);
    905828                // Mask with 0x1f as per ecma-262 11.7.2 step 7.
    906829                rshift32(Imm32(JSImmediate::getTruncatedUInt32(value) & 0x1f), X86::eax);
    907830            } else {
    908                 emitGetVirtualRegisters(src1, X86::eax, src2, X86::ecx, i);
    909                 emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    910                 emitJumpSlowCaseIfNotImmNum(X86::ecx, i);
     831                emitGetVirtualRegisters(src1, X86::eax, src2, X86::ecx);
     832                emitJumpSlowCaseIfNotImmNum(X86::eax);
     833                emitJumpSlowCaseIfNotImmNum(X86::ecx);
    911834                emitFastArithImmToInt(X86::ecx);
    912835                __ sarl_CLr(X86::eax);
    913836            }
    914837            emitFastArithPotentiallyReTagImmediate(X86::eax);
    915             emitPutVirtualRegister(instruction[i + 1].u.operand);
    916             i += OPCODE_LENGTH(op_rshift);
    917             break;
     838            emitPutVirtualRegister(currentInstruction[1].u.operand);
     839            NEXT_OPCODE(op_rshift);
    918840        }
    919841        case op_bitnot: {
    920             emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i);
    921             emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     842            emitGetVirtualRegister(currentInstruction[2].u.operand, X86::eax);
     843            emitJumpSlowCaseIfNotImmNum(X86::eax);
    922844            xor32(Imm32(~JSImmediate::TagBitTypeInteger), X86::eax);
    923             emitPutVirtualRegister(instruction[i + 1].u.operand);
    924             i += OPCODE_LENGTH(op_bitnot);
    925             break;
     845            emitPutVirtualRegister(currentInstruction[1].u.operand);
     846            NEXT_OPCODE(op_bitnot);
    926847        }
    927848        case op_resolve_with_base: {
    928             Identifier* ident = &(m_codeBlock->identifier(instruction[i + 3].u.operand));
     849            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
    929850            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0);
    930             emitCTICall(i, Interpreter::cti_op_resolve_with_base);
    931             emitPutVirtualRegister(instruction[i + 2].u.operand, X86::edx);
    932             emitPutVirtualRegister(instruction[i + 1].u.operand);
    933             i += OPCODE_LENGTH(op_resolve_with_base);
    934             break;
     851            emitCTICall(Interpreter::cti_op_resolve_with_base);
     852            emitPutVirtualRegister(currentInstruction[2].u.operand, X86::edx);
     853            emitPutVirtualRegister(currentInstruction[1].u.operand);
     854            NEXT_OPCODE(op_resolve_with_base);
    935855        }
    936856        case op_new_func_exp: {
    937             FuncExprNode* func = m_codeBlock->functionExpression(instruction[i + 2].u.operand);
     857            FuncExprNode* func = m_codeBlock->functionExpression(currentInstruction[2].u.operand);
    938858            emitPutCTIArgConstant(reinterpret_cast<unsigned>(func), 0);
    939             emitCTICall(i, Interpreter::cti_op_new_func_exp);
    940             emitPutVirtualRegister(instruction[i + 1].u.operand);
    941             i += OPCODE_LENGTH(op_new_func_exp);
    942             break;
     859            emitCTICall(Interpreter::cti_op_new_func_exp);
     860            emitPutVirtualRegister(currentInstruction[1].u.operand);
     861            NEXT_OPCODE(op_new_func_exp);
    943862        }
    944863        case op_mod: {
    945             emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::ecx, i);
    946             emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    947             emitJumpSlowCaseIfNotImmNum(X86::ecx, i);
     864            emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::ecx);
     865            emitJumpSlowCaseIfNotImmNum(X86::eax);
     866            emitJumpSlowCaseIfNotImmNum(X86::ecx);
    948867            emitFastArithDeTagImmediate(X86::eax);
    949             m_slowCases.append(SlowCaseEntry(emitFastArithDeTagImmediateJumpIfZero(X86::ecx), i));
     868            addSlowCase(emitFastArithDeTagImmediateJumpIfZero(X86::ecx));
    950869            __ cdq();
    951870            __ idivl_r(X86::ecx);
    952871            emitFastArithReTagImmediate(X86::edx);
    953872            move(X86::edx, X86::eax);
    954             emitPutVirtualRegister(instruction[i + 1].u.operand);
    955             i += OPCODE_LENGTH(op_mod);
    956             break;
     873            emitPutVirtualRegister(currentInstruction[1].u.operand);
     874            NEXT_OPCODE(op_mod);
    957875        }
    958876        case op_jtrue: {
    959             unsigned target = instruction[i + 2].u.operand;
    960             emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
     877            unsigned target = currentInstruction[2].u.operand;
     878            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    961879
    962880            Jump isZero = je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate())));
    963             m_jmpTable.append(JmpTable(jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)), i + 2 + target));
    964 
    965             m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), i + 2 + target));
    966             m_slowCases.append(SlowCaseEntry(jne32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))), i));
     881            addJump(jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)), target + 2);
     882
     883            addJump(je32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), target + 2);
     884            addSlowCase(jne32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))));
    967885
    968886            isZero.link(this);
    969             i += OPCODE_LENGTH(op_jtrue);
    970             break;
     887            NEXT_OPCODE(op_jtrue);
    971888        }
    972889        CTI_COMPILE_BINARY_OP(op_less)
    973890        case op_neq: {
    974             emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    975             emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
     891            emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx);
     892            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx);
    976893            setne32(X86::edx, X86::eax);
    977894            emitTagAsBoolImmediate(X86::eax);
    978895
    979             emitPutVirtualRegister(instruction[i + 1].u.operand);
    980 
    981             i += OPCODE_LENGTH(op_neq);
    982             break;
     896            emitPutVirtualRegister(currentInstruction[1].u.operand);
     897
     898            NEXT_OPCODE(op_neq);
    983899        }
    984900        case op_post_dec: {
    985             int srcDst = instruction[i + 2].u.operand;
    986             emitGetVirtualRegister(srcDst, X86::eax, i);
     901            int srcDst = currentInstruction[2].u.operand;
     902            emitGetVirtualRegister(srcDst, X86::eax);
    987903            move(X86::eax, X86::edx);
    988             emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    989             m_slowCases.append(SlowCaseEntry(joSub32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::edx), i));
     904            emitJumpSlowCaseIfNotImmNum(X86::eax);
     905            addSlowCase(joSub32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::edx));
    990906            emitPutVirtualRegister(srcDst, X86::edx);
    991             emitPutVirtualRegister(instruction[i + 1].u.operand);
    992             i += OPCODE_LENGTH(op_post_dec);
    993             break;
     907            emitPutVirtualRegister(currentInstruction[1].u.operand);
     908            NEXT_OPCODE(op_post_dec);
    994909        }
    995910        CTI_COMPILE_BINARY_OP(op_urshift)
    996911        case op_bitxor: {
    997             emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    998             emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
     912            emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx);
     913            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx);
    999914            xor32(X86::edx, X86::eax);
    1000915            emitFastArithReTagImmediate(X86::eax);
    1001             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1002             i += OPCODE_LENGTH(op_bitxor);
    1003             break;
     916            emitPutVirtualRegister(currentInstruction[1].u.operand);
     917            NEXT_OPCODE(op_bitxor);
    1004918        }
    1005919        case op_new_regexp: {
    1006             RegExp* regExp = m_codeBlock->regexp(instruction[i + 2].u.operand);
     920            RegExp* regExp = m_codeBlock->regexp(currentInstruction[2].u.operand);
    1007921            emitPutCTIArgConstant(reinterpret_cast<unsigned>(regExp), 0);
    1008             emitCTICall(i, Interpreter::cti_op_new_regexp);
    1009             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1010             i += OPCODE_LENGTH(op_new_regexp);
    1011             break;
     922            emitCTICall(Interpreter::cti_op_new_regexp);
     923            emitPutVirtualRegister(currentInstruction[1].u.operand);
     924            NEXT_OPCODE(op_new_regexp);
    1012925        }
    1013926        case op_bitor: {
    1014             emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    1015             emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
     927            emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx);
     928            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx);
    1016929            or32(X86::edx, X86::eax);
    1017             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1018             i += OPCODE_LENGTH(op_bitor);
    1019             break;
     930            emitPutVirtualRegister(currentInstruction[1].u.operand);
     931            NEXT_OPCODE(op_bitor);
    1020932        }
    1021933        case op_throw: {
    1022             emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx);
    1023             emitCTICall(i, Interpreter::cti_op_throw);
     934            emitPutCTIArgFromVirtualRegister(currentInstruction[1].u.operand, 0, X86::ecx);
     935            emitCTICall(Interpreter::cti_op_throw);
    1024936            __ addl_i8r(0x20, X86::esp);
    1025937            __ popl_r(X86::ebx);
     
    1027939            __ popl_r(X86::esi);
    1028940            __ ret();
    1029             i += OPCODE_LENGTH(op_throw);
    1030             break;
     941            NEXT_OPCODE(op_throw);
    1031942        }
    1032943        case op_get_pnames: {
    1033             emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx);
    1034             emitCTICall(i, Interpreter::cti_op_get_pnames);
    1035             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1036             i += OPCODE_LENGTH(op_get_pnames);
    1037             break;
     944            emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 0, X86::ecx);
     945            emitCTICall(Interpreter::cti_op_get_pnames);
     946            emitPutVirtualRegister(currentInstruction[1].u.operand);
     947            NEXT_OPCODE(op_get_pnames);
    1038948        }
    1039949        case op_next_pname: {
    1040             emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx);
    1041             unsigned target = instruction[i + 3].u.operand;
    1042             emitCTICall(i, Interpreter::cti_op_next_pname);
     950            emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 0, X86::ecx);
     951            unsigned target = currentInstruction[3].u.operand;
     952            emitCTICall(Interpreter::cti_op_next_pname);
    1043953            Jump endOfIter = jzPtr(X86::eax);
    1044             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1045             m_jmpTable.append(JmpTable(jump(), i + 3 + target));
     954            emitPutVirtualRegister(currentInstruction[1].u.operand);
     955            addJump(jump(), target + 3);
    1046956            endOfIter.link(this);
    1047             i += OPCODE_LENGTH(op_next_pname);
    1048             break;
     957            NEXT_OPCODE(op_next_pname);
    1049958        }
    1050959        case op_push_scope: {
    1051             emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx);
    1052             emitCTICall(i, Interpreter::cti_op_push_scope);
    1053             i += OPCODE_LENGTH(op_push_scope);
    1054             break;
     960            emitPutCTIArgFromVirtualRegister(currentInstruction[1].u.operand, 0, X86::ecx);
     961            emitCTICall(Interpreter::cti_op_push_scope);
     962            NEXT_OPCODE(op_push_scope);
    1055963        }
    1056964        case op_pop_scope: {
    1057             emitCTICall(i, Interpreter::cti_op_pop_scope);
    1058             i += OPCODE_LENGTH(op_pop_scope);
    1059             break;
     965            emitCTICall(Interpreter::cti_op_pop_scope);
     966            NEXT_OPCODE(op_pop_scope);
    1060967        }
    1061968        CTI_COMPILE_UNARY_OP(op_typeof)
     
    1067974        CTI_COMPILE_UNARY_OP(op_is_function)
    1068975        case op_stricteq: {
    1069             compileOpStrictEq(instruction + i, i, OpStrictEq);
    1070             i += OPCODE_LENGTH(op_stricteq);
    1071             break;
     976            compileOpStrictEq(currentInstruction, OpStrictEq);
     977            NEXT_OPCODE(op_stricteq);
    1072978        }
    1073979        case op_nstricteq: {
    1074             compileOpStrictEq(instruction + i, i, OpNStrictEq);
    1075             i += OPCODE_LENGTH(op_nstricteq);
    1076             break;
     980            compileOpStrictEq(currentInstruction, OpNStrictEq);
     981            NEXT_OPCODE(op_nstricteq);
    1077982        }
    1078983        case op_to_jsnumber: {
    1079             int srcVReg = instruction[i + 2].u.operand;
    1080             emitGetVirtualRegister(srcVReg, X86::eax, i);
     984            int srcVReg = currentInstruction[2].u.operand;
     985            emitGetVirtualRegister(srcVReg, X86::eax);
    1081986           
    1082987            Jump wasImmediate = jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger));
    1083988
    1084             emitJumpSlowCaseIfNotJSCell(X86::eax, i, srcVReg);
     989            emitJumpSlowCaseIfNotJSCell(X86::eax, srcVReg);
    1085990            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx);
    1086             m_slowCases.append(SlowCaseEntry(jne32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), Imm32(NumberType)), i));
     991            addSlowCase(jne32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), Imm32(NumberType)));
    1087992           
    1088993            wasImmediate.link(this);
    1089994
    1090             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1091             i += OPCODE_LENGTH(op_to_jsnumber);
    1092             break;
    1093         }
    1094         case op_in: {
    1095             emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx);
    1096             emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx);
    1097             emitCTICall(i, Interpreter::cti_op_in);
    1098             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1099             i += OPCODE_LENGTH(op_in);
    1100             break;
    1101         }
     995            emitPutVirtualRegister(currentInstruction[1].u.operand);
     996            NEXT_OPCODE(op_to_jsnumber);
     997        }
     998        CTI_COMPILE_BINARY_OP(op_in)
    1102999        case op_push_new_scope: {
    1103             Identifier* ident = &(m_codeBlock->identifier(instruction[i + 2].u.operand));
     1000            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
    11041001            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0);
    1105             emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx);
    1106             emitCTICall(i, Interpreter::cti_op_push_new_scope);
    1107             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1108             i += OPCODE_LENGTH(op_push_new_scope);
    1109             break;
     1002            emitPutCTIArgFromVirtualRegister(currentInstruction[3].u.operand, 4, X86::ecx);
     1003            emitCTICall(Interpreter::cti_op_push_new_scope);
     1004            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1005            NEXT_OPCODE(op_push_new_scope);
    11101006        }
    11111007        case op_catch: {
    11121008            emitGetCTIParam(CTI_ARGS_callFrame, X86::edi); // edi := r
    1113             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1114             i += OPCODE_LENGTH(op_catch);
    1115             break;
     1009            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1010            NEXT_OPCODE(op_catch);
    11161011        }
    11171012        case op_jmp_scopes: {
    1118             unsigned count = instruction[i + 1].u.operand;
     1013            unsigned count = currentInstruction[1].u.operand;
    11191014            emitPutCTIArgConstant(count, 0);
    1120             emitCTICall(i, Interpreter::cti_op_jmp_scopes);
    1121             unsigned target = instruction[i + 2].u.operand;
    1122             m_jmpTable.append(JmpTable(jump(), i + 2 + target));
    1123             i += OPCODE_LENGTH(op_jmp_scopes);
    1124             break;
     1015            emitCTICall(Interpreter::cti_op_jmp_scopes);
     1016            unsigned target = currentInstruction[2].u.operand;
     1017            addJump(jump(), target + 2);
     1018            NEXT_OPCODE(op_jmp_scopes);
    11251019        }
    11261020        case op_put_by_index: {
    1127             emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx);
    1128             emitPutCTIArgConstant(instruction[i + 2].u.operand, 4);
    1129             emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 8, X86::ecx);
    1130             emitCTICall(i, Interpreter::cti_op_put_by_index);
    1131             i += OPCODE_LENGTH(op_put_by_index);
    1132             break;
     1021            emitPutCTIArgFromVirtualRegister(currentInstruction[1].u.operand, 0, X86::ecx);
     1022            emitPutCTIArgConstant(currentInstruction[2].u.operand, 4);
     1023            emitPutCTIArgFromVirtualRegister(currentInstruction[3].u.operand, 8, X86::ecx);
     1024            emitCTICall(Interpreter::cti_op_put_by_index);
     1025            NEXT_OPCODE(op_put_by_index);
    11331026        }
    11341027        case op_switch_imm: {
    1135             unsigned tableIndex = instruction[i + 1].u.operand;
    1136             unsigned defaultOffset = instruction[i + 2].u.operand;
    1137             unsigned scrutinee = instruction[i + 3].u.operand;
     1028            unsigned tableIndex = currentInstruction[1].u.operand;
     1029            unsigned defaultOffset = currentInstruction[2].u.operand;
     1030            unsigned scrutinee = currentInstruction[3].u.operand;
    11381031
    11391032            // create jump table for switch destinations, track this switch statement.
    11401033            SimpleJumpTable* jumpTable = &m_codeBlock->immediateSwitchJumpTable(tableIndex);
    1141             m_switches.append(SwitchRecord(jumpTable, i, defaultOffset, SwitchRecord::Immediate));
     1034            m_switches.append(SwitchRecord(jumpTable, m_bytecodeIndex, defaultOffset, SwitchRecord::Immediate));
    11421035            jumpTable->ctiOffsets.grow(jumpTable->branchOffsets.size());
    11431036
    11441037            emitPutCTIArgFromVirtualRegister(scrutinee, 0, X86::ecx);
    11451038            emitPutCTIArgConstant(tableIndex, 4);
    1146             emitCTICall(i, Interpreter::cti_op_switch_imm);
     1039            emitCTICall(Interpreter::cti_op_switch_imm);
    11471040            jump(X86::eax);
    1148             i += OPCODE_LENGTH(op_switch_imm);
    1149             break;
     1041            NEXT_OPCODE(op_switch_imm);
    11501042        }
    11511043        case op_switch_char: {
    1152             unsigned tableIndex = instruction[i + 1].u.operand;
    1153             unsigned defaultOffset = instruction[i + 2].u.operand;
    1154             unsigned scrutinee = instruction[i + 3].u.operand;
     1044            unsigned tableIndex = currentInstruction[1].u.operand;
     1045            unsigned defaultOffset = currentInstruction[2].u.operand;
     1046            unsigned scrutinee = currentInstruction[3].u.operand;
    11551047
    11561048            // create jump table for switch destinations, track this switch statement.
    11571049            SimpleJumpTable* jumpTable = &m_codeBlock->characterSwitchJumpTable(tableIndex);
    1158             m_switches.append(SwitchRecord(jumpTable, i, defaultOffset, SwitchRecord::Character));
     1050            m_switches.append(SwitchRecord(jumpTable, m_bytecodeIndex, defaultOffset, SwitchRecord::Character));
    11591051            jumpTable->ctiOffsets.grow(jumpTable->branchOffsets.size());
    11601052
    11611053            emitPutCTIArgFromVirtualRegister(scrutinee, 0, X86::ecx);
    11621054            emitPutCTIArgConstant(tableIndex, 4);
    1163             emitCTICall(i, Interpreter::cti_op_switch_char);
     1055            emitCTICall(Interpreter::cti_op_switch_char);
    11641056            jump(X86::eax);
    1165             i += OPCODE_LENGTH(op_switch_char);
    1166             break;
     1057            NEXT_OPCODE(op_switch_char);
    11671058        }
    11681059        case op_switch_string: {
    1169             unsigned tableIndex = instruction[i + 1].u.operand;
    1170             unsigned defaultOffset = instruction[i + 2].u.operand;
    1171             unsigned scrutinee = instruction[i + 3].u.operand;
     1060            unsigned tableIndex = currentInstruction[1].u.operand;
     1061            unsigned defaultOffset = currentInstruction[2].u.operand;
     1062            unsigned scrutinee = currentInstruction[3].u.operand;
    11721063
    11731064            // create jump table for switch destinations, track this switch statement.
    11741065            StringJumpTable* jumpTable = &m_codeBlock->stringSwitchJumpTable(tableIndex);
    1175             m_switches.append(SwitchRecord(jumpTable, i, defaultOffset));
     1066            m_switches.append(SwitchRecord(jumpTable, m_bytecodeIndex, defaultOffset));
    11761067
    11771068            emitPutCTIArgFromVirtualRegister(scrutinee, 0, X86::ecx);
    11781069            emitPutCTIArgConstant(tableIndex, 4);
    1179             emitCTICall(i, Interpreter::cti_op_switch_string);
     1070            emitCTICall(Interpreter::cti_op_switch_string);
    11801071            jump(X86::eax);
    1181             i += OPCODE_LENGTH(op_switch_string);
    1182             break;
     1072            NEXT_OPCODE(op_switch_string);
    11831073        }
    11841074        case op_del_by_val: {
    1185             emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx);
    1186             emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx);
    1187             emitCTICall(i, Interpreter::cti_op_del_by_val);
    1188             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1189             i += OPCODE_LENGTH(op_del_by_val);
    1190             break;
     1075            emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 0, X86::ecx);
     1076            emitPutCTIArgFromVirtualRegister(currentInstruction[3].u.operand, 4, X86::ecx);
     1077            emitCTICall(Interpreter::cti_op_del_by_val);
     1078            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1079            NEXT_OPCODE(op_del_by_val);
    11911080        }
    11921081        case op_put_getter: {
    1193             emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx);
    1194             Identifier* ident = &(m_codeBlock->identifier(instruction[i + 2].u.operand));
     1082            emitPutCTIArgFromVirtualRegister(currentInstruction[1].u.operand, 0, X86::ecx);
     1083            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
    11951084            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4);
    1196             emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 8, X86::ecx);
    1197             emitCTICall(i, Interpreter::cti_op_put_getter);
    1198             i += OPCODE_LENGTH(op_put_getter);
    1199             break;
     1085            emitPutCTIArgFromVirtualRegister(currentInstruction[3].u.operand, 8, X86::ecx);
     1086            emitCTICall(Interpreter::cti_op_put_getter);
     1087            NEXT_OPCODE(op_put_getter);
    12001088        }
    12011089        case op_put_setter: {
    1202             emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx);
    1203             Identifier* ident = &(m_codeBlock->identifier(instruction[i + 2].u.operand));
     1090            emitPutCTIArgFromVirtualRegister(currentInstruction[1].u.operand, 0, X86::ecx);
     1091            Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
    12041092            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4);
    1205             emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 8, X86::ecx);
    1206             emitCTICall(i, Interpreter::cti_op_put_setter);
    1207             i += OPCODE_LENGTH(op_put_setter);
    1208             break;
     1093            emitPutCTIArgFromVirtualRegister(currentInstruction[3].u.operand, 8, X86::ecx);
     1094            emitCTICall(Interpreter::cti_op_put_setter);
     1095            NEXT_OPCODE(op_put_setter);
    12091096        }
    12101097        case op_new_error: {
    1211             JSValue* message = m_codeBlock->unexpectedConstant(instruction[i + 3].u.operand);
    1212             emitPutCTIArgConstant(instruction[i + 2].u.operand, 0);
     1098            JSValue* message = m_codeBlock->unexpectedConstant(currentInstruction[3].u.operand);
     1099            emitPutCTIArgConstant(currentInstruction[2].u.operand, 0);
    12131100            emitPutCTIArgConstant(asInteger(message), 4);
    1214             emitPutCTIArgConstant(m_codeBlock->lineNumberForBytecodeOffset(i), 8);
    1215             emitCTICall(i, Interpreter::cti_op_new_error);
    1216             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1217             i += OPCODE_LENGTH(op_new_error);
    1218             break;
     1101            emitPutCTIArgConstant(m_codeBlock->lineNumberForBytecodeOffset(m_bytecodeIndex), 8);
     1102            emitCTICall(Interpreter::cti_op_new_error);
     1103            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1104            NEXT_OPCODE(op_new_error);
    12191105        }
    12201106        case op_debug: {
    1221             emitPutCTIArgConstant(instruction[i + 1].u.operand, 0);
    1222             emitPutCTIArgConstant(instruction[i + 2].u.operand, 4);
    1223             emitPutCTIArgConstant(instruction[i + 3].u.operand, 8);
    1224             emitCTICall(i, Interpreter::cti_op_debug);
    1225             i += OPCODE_LENGTH(op_debug);
    1226             break;
     1107            emitPutCTIArgConstant(currentInstruction[1].u.operand, 0);
     1108            emitPutCTIArgConstant(currentInstruction[2].u.operand, 4);
     1109            emitPutCTIArgConstant(currentInstruction[3].u.operand, 8);
     1110            emitCTICall(Interpreter::cti_op_debug);
     1111            NEXT_OPCODE(op_debug);
    12271112        }
    12281113        case op_eq_null: {
    1229             unsigned dst = instruction[i + 1].u.operand;
    1230             unsigned src1 = instruction[i + 2].u.operand;
    1231 
    1232             emitGetVirtualRegister(src1, X86::eax, i);
     1114            unsigned dst = currentInstruction[1].u.operand;
     1115            unsigned src1 = currentInstruction[2].u.operand;
     1116
     1117            emitGetVirtualRegister(src1, X86::eax);
    12331118            Jump isImmediate = emitJumpIfNotJSCell(X86::eax);
    12341119
     
    12481133            emitPutVirtualRegister(dst);
    12491134
    1250             i += OPCODE_LENGTH(op_eq_null);
    1251             break;
     1135            NEXT_OPCODE(op_eq_null);
    12521136        }
    12531137        case op_neq_null: {
    1254             unsigned dst = instruction[i + 1].u.operand;
    1255             unsigned src1 = instruction[i + 2].u.operand;
    1256 
    1257             emitGetVirtualRegister(src1, X86::eax, i);
     1138            unsigned dst = currentInstruction[1].u.operand;
     1139            unsigned src1 = currentInstruction[2].u.operand;
     1140
     1141            emitGetVirtualRegister(src1, X86::eax);
    12581142            Jump isImmediate = emitJumpIfNotJSCell(X86::eax);
    12591143
     
    12731157            emitPutVirtualRegister(dst);
    12741158
    1275             i += OPCODE_LENGTH(op_neq_null);
    1276             break;
     1159            NEXT_OPCODE(op_neq_null);
    12771160        }
    12781161        case op_enter: {
     
    12841167                emitInitRegister(j);
    12851168
    1286             i += OPCODE_LENGTH(op_enter);
    1287             break;
     1169            NEXT_OPCODE(op_enter);
    12881170        }
    12891171        case op_enter_with_activation: {
     
    12951177                emitInitRegister(j);
    12961178
    1297             emitCTICall(i, Interpreter::cti_op_push_activation);
    1298             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1299 
    1300             i += OPCODE_LENGTH(op_enter_with_activation);
    1301             break;
     1179            emitCTICall(Interpreter::cti_op_push_activation);
     1180            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1181
     1182            NEXT_OPCODE(op_enter_with_activation);
    13021183        }
    13031184        case op_create_arguments: {
    1304             emitCTICall(i, (m_codeBlock->m_numParameters == 1) ? Interpreter::cti_op_create_arguments_no_params : Interpreter::cti_op_create_arguments);
    1305             i += OPCODE_LENGTH(op_create_arguments);
    1306             break;
     1185            if (m_codeBlock->m_numParameters == 1)
     1186                emitCTICall(Interpreter::cti_op_create_arguments_no_params);
     1187            else
     1188                emitCTICall(Interpreter::cti_op_create_arguments);
     1189            NEXT_OPCODE(op_create_arguments);
    13071190        }
    13081191        case op_convert_this: {
    1309             emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
    1310 
    1311             emitJumpSlowCaseIfNotJSCell(X86::eax, i);
     1192            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
     1193
     1194            emitJumpSlowCaseIfNotJSCell(X86::eax);
    13121195            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::edx);
    1313             m_slowCases.append(SlowCaseEntry(jnz32(Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion)), i));
    1314 
    1315             i += OPCODE_LENGTH(op_convert_this);
    1316             break;
     1196            addSlowCase(jnz32(Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion)));
     1197
     1198            NEXT_OPCODE(op_convert_this);
    13171199        }
    13181200        case op_profile_will_call: {
     
    13201202            __ cmpl_i32m(0, X86::eax);
    13211203            JmpSrc noProfiler = __ je();
    1322             emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::eax);
    1323             emitCTICall(i, Interpreter::cti_op_profile_will_call);
     1204            emitPutCTIArgFromVirtualRegister(currentInstruction[1].u.operand, 0, X86::eax);
     1205            emitCTICall(Interpreter::cti_op_profile_will_call);
    13241206            __ link(noProfiler, __ label());
    13251207
    1326             i += OPCODE_LENGTH(op_profile_will_call);
    1327             break;
     1208            NEXT_OPCODE(op_profile_will_call);
    13281209        }
    13291210        case op_profile_did_call: {
     
    13311212            __ cmpl_i32m(0, X86::eax);
    13321213            JmpSrc noProfiler = __ je();
    1333             emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::eax);
    1334             emitCTICall(i, Interpreter::cti_op_profile_did_call);
     1214            emitPutCTIArgFromVirtualRegister(currentInstruction[1].u.operand, 0, X86::eax);
     1215            emitCTICall(Interpreter::cti_op_profile_did_call);
    13351216            __ link(noProfiler, __ label());
    13361217
    1337             i += OPCODE_LENGTH(op_profile_did_call);
    1338             break;
     1218            NEXT_OPCODE(op_profile_did_call);
    13391219        }
    13401220        case op_get_array_length:
     
    13551235    ASSERT(propertyAccessInstructionIndex == m_codeBlock->numberOfStructureStubInfos());
    13561236    ASSERT(callLinkInfoIndex == m_codeBlock->numberOfCallLinkInfos());
     1237
     1238#ifndef NDEBUG
     1239    // reset this, in order to guard it's use with asserts
     1240    m_bytecodeIndex = -1;
     1241#endif
    13571242}
    13581243
     
    13681253void JIT::privateCompileSlowCases()
    13691254{
     1255    Instruction* instructionsBegin = m_codeBlock->instructions().begin();
    13701256    unsigned propertyAccessInstructionIndex = 0;
    13711257    unsigned callLinkInfoIndex = 0;
    13721258
    1373     Instruction* instruction = m_codeBlock->instructions().begin();
    13741259    for (Vector<SlowCaseEntry>::iterator iter = m_slowCases.begin(); iter != m_slowCases.end();) {
    13751260        // FIXME: enable peephole optimizations for slow cases when applicable
    13761261        killLastResultRegister();
    13771262
    1378         unsigned i = iter->to;
     1263        m_bytecodeIndex = iter->to;
    13791264#ifndef NDEBUG
    1380         unsigned firstTo = i;
     1265        unsigned firstTo = m_bytecodeIndex;
    13811266#endif
    1382 
    1383         switch (OpcodeID opcodeID = m_interpreter->getOpcodeID(instruction[i].u.opcode)) {
     1267        Instruction* currentInstruction = instructionsBegin + m_bytecodeIndex;
     1268
     1269        switch (OpcodeID opcodeID = m_interpreter->getOpcodeID(currentInstruction->u.opcode)) {
    13841270        case op_convert_this: {
    13851271            linkSlowCase(iter);
    13861272            linkSlowCase(iter);
    13871273            emitPutCTIArg(X86::eax, 0);
    1388             emitCTICall(i, Interpreter::cti_op_convert_this);
    1389             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1390             i += OPCODE_LENGTH(op_convert_this);
    1391             break;
     1274            emitCTICall(Interpreter::cti_op_convert_this);
     1275            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1276            NEXT_OPCODE(op_convert_this);
    13921277        }
    13931278        case op_add: {
    1394             unsigned dst = instruction[i + 1].u.operand;
    1395             unsigned src1 = instruction[i + 2].u.operand;
    1396             unsigned src2 = instruction[i + 3].u.operand;
     1279            unsigned dst = currentInstruction[1].u.operand;
     1280            unsigned src1 = currentInstruction[2].u.operand;
     1281            unsigned src2 = currentInstruction[3].u.operand;
    13971282            if (JSValue* value = getConstantImmediateNumericArg(src1)) {
    13981283                Jump notImm = getSlowCase(iter);
     
    14021287                emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx);
    14031288                emitPutCTIArg(X86::eax, 4);
    1404                 emitCTICall(i, Interpreter::cti_op_add);
     1289                emitCTICall(Interpreter::cti_op_add);
    14051290                emitPutVirtualRegister(dst);
    14061291            } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
     
    14111296                emitPutCTIArg(X86::eax, 0);
    14121297                emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx);
    1413                 emitCTICall(i, Interpreter::cti_op_add);
     1298                emitCTICall(Interpreter::cti_op_add);
    14141299                emitPutVirtualRegister(dst);
    14151300            } else {
    1416                 OperandTypes types = OperandTypes::fromInt(instruction[i + 4].u.operand);
     1301                OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    14171302                ASSERT(types.first().mightBeNumber() && types.second().mightBeNumber());
    1418                 compileBinaryArithOpSlowCase(op_add, iter, dst, src1, src2, types, i);
     1303                compileBinaryArithOpSlowCase(op_add, iter, dst, src1, src2, types);
    14191304            }
    14201305
    1421             i += OPCODE_LENGTH(op_add);
    1422             break;
     1306            NEXT_OPCODE(op_add);
    14231307        }
    14241308        case op_construct_verify: {
    14251309            linkSlowCase(iter);
    14261310            linkSlowCase(iter);
    1427             emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i);
    1428             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1429 
    1430             i += OPCODE_LENGTH(op_construct_verify);
    1431             break;
     1311            emitGetVirtualRegister(currentInstruction[2].u.operand, X86::eax);
     1312            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1313
     1314            NEXT_OPCODE(op_construct_verify);
    14321315        }
    14331316        case op_get_by_val: {
     
    14421325            emitPutCTIArg(X86::eax, 0);
    14431326            emitPutCTIArg(X86::edx, 4);
    1444             emitCTICall(i, Interpreter::cti_op_get_by_val);
    1445             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1446             __ link(jump(), m_labels[i + 4]);
     1327            emitCTICall(Interpreter::cti_op_get_by_val);
     1328            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1329            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_get_by_val));
    14471330
    14481331            // This is slow case that handles accesses to arrays above the fast cut-off.
     
    14561339            jzPtr(X86::ecx, beginGetByValSlow);
    14571340            move(X86::ecx, X86::eax);
    1458             emitPutVirtualRegister(instruction[i + 1].u.operand, X86::eax);
    1459 
    1460             i += OPCODE_LENGTH(op_get_by_val);
    1461             break;
     1341            emitPutVirtualRegister(currentInstruction[1].u.operand, X86::eax);
     1342
     1343            NEXT_OPCODE(op_get_by_val);
    14621344        }
    14631345        case op_sub: {
    1464             compileBinaryArithOpSlowCase(op_sub, iter, instruction[i + 1].u.operand, instruction[i + 2].u.operand, instruction[i + 3].u.operand, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    1465             i += OPCODE_LENGTH(op_sub);
    1466             break;
     1346            compileBinaryArithOpSlowCase(op_sub, iter, currentInstruction[1].u.operand, currentInstruction[2].u.operand, currentInstruction[3].u.operand, OperandTypes::fromInt(currentInstruction[4].u.operand));
     1347            NEXT_OPCODE(op_sub);
    14671348        }
    14681349        case op_rshift: {
    1469             unsigned src2 = instruction[i + 3].u.operand;
     1350            unsigned src2 = currentInstruction[3].u.operand;
    14701351            linkSlowCase(iter);
    14711352            if (getConstantImmediateNumericArg(src2))
     
    14771358
    14781359            emitPutCTIArg(X86::eax, 0);
    1479             emitCTICall(i, Interpreter::cti_op_rshift);
    1480             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1481             i += OPCODE_LENGTH(op_rshift);
    1482             break;
     1360            emitCTICall(Interpreter::cti_op_rshift);
     1361            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1362            NEXT_OPCODE(op_rshift);
    14831363        }
    14841364        case op_lshift: {
     
    14861366            Jump notImm2 = getSlowCase(iter);
    14871367            linkSlowCase(iter);
    1488             emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::ecx, i);
     1368            emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::ecx);
    14891369            notImm1.link(this);
    14901370            notImm2.link(this);
    14911371            emitPutCTIArg(X86::eax, 0);
    14921372            emitPutCTIArg(X86::ecx, 4);
    1493             emitCTICall(i, Interpreter::cti_op_lshift);
    1494             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1495             i += OPCODE_LENGTH(op_lshift);
    1496             break;
     1373            emitCTICall(Interpreter::cti_op_lshift);
     1374            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1375            NEXT_OPCODE(op_lshift);
    14971376        }
    14981377        case op_loop_if_less: {
    1499             unsigned target = instruction[i + 3].u.operand;
    1500             JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
     1378            unsigned target = currentInstruction[3].u.operand;
     1379            JSValue* src2imm = getConstantImmediateNumericArg(currentInstruction[2].u.operand);
    15011380            if (src2imm) {
    15021381                linkSlowCase(iter);
    15031382                emitPutCTIArg(X86::eax, 0);
    1504                 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 4, X86::ecx);
    1505                 emitCTICall(i, Interpreter::cti_op_loop_if_less);
    1506                 __ link(jnz32(X86::eax), m_labels[i + 3 + target]);
     1383                emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 4, X86::ecx);
     1384                emitCTICall(Interpreter::cti_op_loop_if_less);
     1385                emitJumpSlowToHot(jnz32(X86::eax), target + 3);
    15071386            } else {
    15081387                linkSlowCase(iter);
     
    15101389                emitPutCTIArg(X86::eax, 0);
    15111390                emitPutCTIArg(X86::edx, 4);
    1512                 emitCTICall(i, Interpreter::cti_op_loop_if_less);
    1513                 __ link(jnz32(X86::eax), m_labels[i + 3 + target]);
     1391                emitCTICall(Interpreter::cti_op_loop_if_less);
     1392                emitJumpSlowToHot(jnz32(X86::eax), target + 3);
    15141393            }
    1515             i += OPCODE_LENGTH(op_loop_if_less);
    1516             break;
     1394            NEXT_OPCODE(op_loop_if_less);
    15171395        }
    15181396        case op_put_by_id: {
    1519             compilePutByIdSlowCase(instruction[i + 1].u.operand, &(m_codeBlock->identifier(instruction[i + 2].u.operand)), instruction[i + 3].u.operand, i, iter, propertyAccessInstructionIndex++);
    1520             i += OPCODE_LENGTH(op_put_by_id);
    1521             break;
     1397            compilePutByIdSlowCase(currentInstruction[1].u.operand, &(m_codeBlock->identifier(currentInstruction[2].u.operand)), currentInstruction[3].u.operand, iter, propertyAccessInstructionIndex++);
     1398            NEXT_OPCODE(op_put_by_id);
    15221399        }
    15231400        case op_get_by_id: {
    1524             compileGetByIdSlowCase(instruction[i + 1].u.operand, instruction[i + 2].u.operand, &(m_codeBlock->identifier(instruction[i + 3].u.operand)), i, iter, propertyAccessInstructionIndex++);
    1525             i += OPCODE_LENGTH(op_get_by_id);
    1526             break;
     1401            compileGetByIdSlowCase(currentInstruction[1].u.operand, currentInstruction[2].u.operand, &(m_codeBlock->identifier(currentInstruction[3].u.operand)), iter, propertyAccessInstructionIndex++);
     1402            NEXT_OPCODE(op_get_by_id);
    15271403        }
    15281404        case op_loop_if_lesseq: {
    1529             unsigned target = instruction[i + 3].u.operand;
    1530             JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
     1405            unsigned target = currentInstruction[3].u.operand;
     1406            JSValue* src2imm = getConstantImmediateNumericArg(currentInstruction[2].u.operand);
    15311407            if (src2imm) {
    15321408                linkSlowCase(iter);
    15331409                emitPutCTIArg(X86::eax, 0);
    1534                 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 4, X86::ecx);
    1535                 emitCTICall(i, Interpreter::cti_op_loop_if_lesseq);
    1536                 __ link(jnz32(X86::eax), m_labels[i + 3 + target]);
     1410                emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 4, X86::ecx);
     1411                emitCTICall(Interpreter::cti_op_loop_if_lesseq);
     1412                emitJumpSlowToHot(jnz32(X86::eax), target + 3);
    15371413            } else {
    15381414                linkSlowCase(iter);
     
    15401416                emitPutCTIArg(X86::eax, 0);
    15411417                emitPutCTIArg(X86::edx, 4);
    1542                 emitCTICall(i, Interpreter::cti_op_loop_if_lesseq);
    1543                 __ link(jnz32(X86::eax), m_labels[i + 3 + target]);
     1418                emitCTICall(Interpreter::cti_op_loop_if_lesseq);
     1419                emitJumpSlowToHot(jnz32(X86::eax), target + 3);
    15441420            }
    1545             i += OPCODE_LENGTH(op_loop_if_lesseq);
    1546             break;
     1421            NEXT_OPCODE(op_loop_if_lesseq);
    15471422        }
    15481423        case op_pre_inc: {
    1549             unsigned srcDst = instruction[i + 1].u.operand;
     1424            unsigned srcDst = currentInstruction[1].u.operand;
    15501425            Jump notImm = getSlowCase(iter);
    15511426            linkSlowCase(iter);
     
    15531428            notImm.link(this);
    15541429            emitPutCTIArg(X86::eax, 0);
    1555             emitCTICall(i, Interpreter::cti_op_pre_inc);
     1430            emitCTICall(Interpreter::cti_op_pre_inc);
    15561431            emitPutVirtualRegister(srcDst);
    1557             i += OPCODE_LENGTH(op_pre_inc);
    1558             break;
     1432            NEXT_OPCODE(op_pre_inc);
    15591433        }
    15601434        case op_put_by_val: {
     
    15651439            emitFastArithIntToImmNoCheck(X86::edx);
    15661440            notImm.link(this);
    1567             emitGetVirtualRegister(instruction[i + 3].u.operand, X86::ecx, i);
     1441            emitGetVirtualRegister(currentInstruction[3].u.operand, X86::ecx);
    15681442            emitPutCTIArg(X86::eax, 0);
    15691443            emitPutCTIArg(X86::edx, 4);
    15701444            emitPutCTIArg(X86::ecx, 8);
    1571             emitCTICall(i, Interpreter::cti_op_put_by_val);
    1572             __ link(jump(), m_labels[i + 4]);
     1445            emitCTICall(Interpreter::cti_op_put_by_val);
     1446            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_put_by_val));
    15731447
    15741448            // slow cases for immediate int accesses to arrays
    15751449            linkSlowCase(iter);
    15761450            linkSlowCase(iter);
    1577             emitGetVirtualRegister(instruction[i + 3].u.operand, X86::ecx, i);
     1451            emitGetVirtualRegister(currentInstruction[3].u.operand, X86::ecx);
    15781452            emitPutCTIArg(X86::eax, 0);
    15791453            emitPutCTIArg(X86::edx, 4);
    15801454            emitPutCTIArg(X86::ecx, 8);
    1581             emitCTICall(i, Interpreter::cti_op_put_by_val_array);
    1582 
    1583             i += OPCODE_LENGTH(op_put_by_val);
    1584             break;
     1455            emitCTICall(Interpreter::cti_op_put_by_val_array);
     1456
     1457            NEXT_OPCODE(op_put_by_val);
    15851458        }
    15861459        case op_loop_if_true: {
    15871460            linkSlowCase(iter);
    15881461            emitPutCTIArg(X86::eax, 0);
    1589             emitCTICall(i, Interpreter::cti_op_jtrue);
    1590             unsigned target = instruction[i + 2].u.operand;
    1591             __ link(jnz32(X86::eax), m_labels[i + 2 + target]);
    1592             i += OPCODE_LENGTH(op_loop_if_true);
    1593             break;
     1462            emitCTICall(Interpreter::cti_op_jtrue);
     1463            unsigned target = currentInstruction[2].u.operand;
     1464            emitJumpSlowToHot(jnz32(X86::eax), target + 2);
     1465            NEXT_OPCODE(op_loop_if_true);
    15941466        }
    15951467        case op_pre_dec: {
    1596             unsigned srcDst = instruction[i + 1].u.operand;
     1468            unsigned srcDst = currentInstruction[1].u.operand;
    15971469            Jump notImm = getSlowCase(iter);
    15981470            linkSlowCase(iter);
     
    16001472            notImm.link(this);
    16011473            emitPutCTIArg(X86::eax, 0);
    1602             emitCTICall(i, Interpreter::cti_op_pre_dec);
     1474            emitCTICall(Interpreter::cti_op_pre_dec);
    16031475            emitPutVirtualRegister(srcDst);
    1604             i += OPCODE_LENGTH(op_pre_dec);
    1605             break;
     1476            NEXT_OPCODE(op_pre_dec);
    16061477        }
    16071478        case op_jnless: {
    1608             unsigned target = instruction[i + 3].u.operand;
    1609             JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
     1479            unsigned target = currentInstruction[3].u.operand;
     1480            JSValue* src2imm = getConstantImmediateNumericArg(currentInstruction[2].u.operand);
    16101481            if (src2imm) {
    16111482                linkSlowCase(iter);
    16121483                emitPutCTIArg(X86::edx, 0);
    1613                 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 4, X86::ecx);
    1614                 emitCTICall(i, Interpreter::cti_op_jless);
    1615                 __ link(jz32(X86::eax), m_labels[i + 3 + target]);
     1484                emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 4, X86::ecx);
     1485                emitCTICall(Interpreter::cti_op_jless);
     1486                emitJumpSlowToHot(jz32(X86::eax), target + 3);
    16161487            } else {
    16171488                linkSlowCase(iter);
     
    16191490                emitPutCTIArg(X86::eax, 0);
    16201491                emitPutCTIArg(X86::edx, 4);
    1621                 emitCTICall(i, Interpreter::cti_op_jless);
    1622                 __ link(jz32(X86::eax), m_labels[i + 3 + target]);
     1492                emitCTICall(Interpreter::cti_op_jless);
     1493                emitJumpSlowToHot(jz32(X86::eax), target + 3);
    16231494            }
    1624             i += OPCODE_LENGTH(op_jnless);
    1625             break;
     1495            NEXT_OPCODE(op_jnless);
    16261496        }
    16271497        case op_not: {
     
    16291499            xor32(Imm32(JSImmediate::FullTagTypeBool), X86::eax);
    16301500            emitPutCTIArg(X86::eax, 0);
    1631             emitCTICall(i, Interpreter::cti_op_not);
    1632             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1633             i += OPCODE_LENGTH(op_not);
    1634             break;
     1501            emitCTICall(Interpreter::cti_op_not);
     1502            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1503            NEXT_OPCODE(op_not);
    16351504        }
    16361505        case op_jfalse: {
    16371506            linkSlowCase(iter);
    16381507            emitPutCTIArg(X86::eax, 0);
    1639             emitCTICall(i, Interpreter::cti_op_jtrue);
    1640             unsigned target = instruction[i + 2].u.operand;
    1641             __ link(jz32(X86::eax), m_labels[i + 2 + target]); // inverted!
    1642             i += OPCODE_LENGTH(op_jfalse);
    1643             break;
     1508            emitCTICall(Interpreter::cti_op_jtrue);
     1509            unsigned target = currentInstruction[2].u.operand;
     1510            emitJumpSlowToHot(jz32(X86::eax), target + 2); // inverted!
     1511            NEXT_OPCODE(op_jfalse);
    16441512        }
    16451513        case op_post_inc: {
    1646             unsigned srcDst = instruction[i + 2].u.operand;
    1647             linkSlowCase(iter);
    1648             linkSlowCase(iter);
    1649             emitPutCTIArg(X86::eax, 0);
    1650             emitCTICall(i, Interpreter::cti_op_post_inc);
     1514            unsigned srcDst = currentInstruction[2].u.operand;
     1515            linkSlowCase(iter);
     1516            linkSlowCase(iter);
     1517            emitPutCTIArg(X86::eax, 0);
     1518            emitCTICall(Interpreter::cti_op_post_inc);
    16511519            emitPutVirtualRegister(srcDst, X86::edx);
    1652             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1653             i += OPCODE_LENGTH(op_post_inc);
    1654             break;
     1520            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1521            NEXT_OPCODE(op_post_inc);
    16551522        }
    16561523        case op_bitnot: {
    16571524            linkSlowCase(iter);
    16581525            emitPutCTIArg(X86::eax, 0);
    1659             emitCTICall(i, Interpreter::cti_op_bitnot);
    1660             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1661             i += OPCODE_LENGTH(op_bitnot);
    1662             break;
     1526            emitCTICall(Interpreter::cti_op_bitnot);
     1527            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1528            NEXT_OPCODE(op_bitnot);
    16631529        }
    16641530        case op_bitand: {
    16651531            linkSlowCase(iter);
    1666             unsigned src1 = instruction[i + 2].u.operand;
    1667             unsigned src2 = instruction[i + 3].u.operand;
    1668             unsigned dst = instruction[i + 1].u.operand;
     1532            unsigned src1 = currentInstruction[2].u.operand;
     1533            unsigned src2 = currentInstruction[3].u.operand;
     1534            unsigned dst = currentInstruction[1].u.operand;
    16691535            if (getConstantImmediateNumericArg(src1)) {
    16701536                emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx);
    16711537                emitPutCTIArg(X86::eax, 4);
    1672                 emitCTICall(i, Interpreter::cti_op_bitand);
     1538                emitCTICall(Interpreter::cti_op_bitand);
    16731539                emitPutVirtualRegister(dst);
    16741540            } else if (getConstantImmediateNumericArg(src2)) {
    16751541                emitPutCTIArg(X86::eax, 0);
    16761542                emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx);
    1677                 emitCTICall(i, Interpreter::cti_op_bitand);
     1543                emitCTICall(Interpreter::cti_op_bitand);
    16781544                emitPutVirtualRegister(dst);
    16791545            } else {
    16801546                emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx);
    16811547                emitPutCTIArg(X86::edx, 4);
    1682                 emitCTICall(i, Interpreter::cti_op_bitand);
     1548                emitCTICall(Interpreter::cti_op_bitand);
    16831549                emitPutVirtualRegister(dst);
    16841550            }
    1685             i += OPCODE_LENGTH(op_bitand);
    1686             break;
     1551            NEXT_OPCODE(op_bitand);
    16871552        }
    16881553        case op_jtrue: {
    16891554            linkSlowCase(iter);
    16901555            emitPutCTIArg(X86::eax, 0);
    1691             emitCTICall(i, Interpreter::cti_op_jtrue);
    1692             unsigned target = instruction[i + 2].u.operand;
    1693             __ link(jnz32(X86::eax), m_labels[i + 2 + target]);
    1694             i += OPCODE_LENGTH(op_jtrue);
    1695             break;
     1556            emitCTICall(Interpreter::cti_op_jtrue);
     1557            unsigned target = currentInstruction[2].u.operand;
     1558            emitJumpSlowToHot(jnz32(X86::eax), target + 2);
     1559            NEXT_OPCODE(op_jtrue);
    16961560        }
    16971561        case op_post_dec: {
    1698             unsigned srcDst = instruction[i + 2].u.operand;
    1699             linkSlowCase(iter);
    1700             linkSlowCase(iter);
    1701             emitPutCTIArg(X86::eax, 0);
    1702             emitCTICall(i, Interpreter::cti_op_post_dec);
     1562            unsigned srcDst = currentInstruction[2].u.operand;
     1563            linkSlowCase(iter);
     1564            linkSlowCase(iter);
     1565            emitPutCTIArg(X86::eax, 0);
     1566            emitCTICall(Interpreter::cti_op_post_dec);
    17031567            emitPutVirtualRegister(srcDst, X86::edx);
    1704             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1705             i += OPCODE_LENGTH(op_post_dec);
    1706             break;
     1568            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1569            NEXT_OPCODE(op_post_dec);
    17071570        }
    17081571        case op_bitxor: {
     
    17101573            emitPutCTIArg(X86::eax, 0);
    17111574            emitPutCTIArg(X86::edx, 4);
    1712             emitCTICall(i, Interpreter::cti_op_bitxor);
    1713             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1714             i += OPCODE_LENGTH(op_bitxor);
    1715             break;
     1575            emitCTICall(Interpreter::cti_op_bitxor);
     1576            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1577            NEXT_OPCODE(op_bitxor);
    17161578        }
    17171579        case op_bitor: {
     
    17191581            emitPutCTIArg(X86::eax, 0);
    17201582            emitPutCTIArg(X86::edx, 4);
    1721             emitCTICall(i, Interpreter::cti_op_bitor);
    1722             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1723             i += OPCODE_LENGTH(op_bitor);
    1724             break;
     1583            emitCTICall(Interpreter::cti_op_bitor);
     1584            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1585            NEXT_OPCODE(op_bitor);
    17251586        }
    17261587        case op_eq: {
     
    17281589            emitPutCTIArg(X86::eax, 0);
    17291590            emitPutCTIArg(X86::edx, 4);
    1730             emitCTICall(i, Interpreter::cti_op_eq);
    1731             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1732             i += OPCODE_LENGTH(op_eq);
    1733             break;
     1591            emitCTICall(Interpreter::cti_op_eq);
     1592            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1593            NEXT_OPCODE(op_eq);
    17341594        }
    17351595        case op_neq: {
     
    17371597            emitPutCTIArg(X86::eax, 0);
    17381598            emitPutCTIArg(X86::edx, 4);
    1739             emitCTICall(i, Interpreter::cti_op_neq);
    1740             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1741             i += OPCODE_LENGTH(op_neq);
    1742             break;
     1599            emitCTICall(Interpreter::cti_op_neq);
     1600            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1601            NEXT_OPCODE(op_neq);
    17431602        }
    17441603        case op_stricteq: {
     
    17481607            emitPutCTIArg(X86::eax, 0);
    17491608            emitPutCTIArg(X86::edx, 4);
    1750             emitCTICall(i, Interpreter::cti_op_stricteq);
    1751             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1752             i += OPCODE_LENGTH(op_stricteq);
    1753             break;
     1609            emitCTICall(Interpreter::cti_op_stricteq);
     1610            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1611            NEXT_OPCODE(op_stricteq);
    17541612        }
    17551613        case op_nstricteq: {
     
    17591617            emitPutCTIArg(X86::eax, 0);
    17601618            emitPutCTIArg(X86::edx, 4);
    1761             emitCTICall(i, Interpreter::cti_op_nstricteq);
    1762             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1763             i += OPCODE_LENGTH(op_nstricteq);
    1764             break;
     1619            emitCTICall(Interpreter::cti_op_nstricteq);
     1620            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1621            NEXT_OPCODE(op_nstricteq);
    17651622        }
    17661623        case op_instanceof: {
     
    17681625            linkSlowCase(iter);
    17691626            linkSlowCase(iter);
    1770             emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx);
    1771             emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx);
    1772             emitPutCTIArgFromVirtualRegister(instruction[i + 4].u.operand, 8, X86::ecx);
    1773             emitCTICall(i, Interpreter::cti_op_instanceof);
    1774             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1775             i += OPCODE_LENGTH(op_instanceof);
    1776             break;
     1627            emitPutCTIArgFromVirtualRegister(currentInstruction[2].u.operand, 0, X86::ecx);
     1628            emitPutCTIArgFromVirtualRegister(currentInstruction[3].u.operand, 4, X86::ecx);
     1629            emitPutCTIArgFromVirtualRegister(currentInstruction[4].u.operand, 8, X86::ecx);
     1630            emitCTICall(Interpreter::cti_op_instanceof);
     1631            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1632            NEXT_OPCODE(op_instanceof);
    17771633        }
    17781634        case op_mod: {
     
    17861642            emitPutCTIArg(X86::eax, 0);
    17871643            emitPutCTIArg(X86::ecx, 4);
    1788             emitCTICall(i, Interpreter::cti_op_mod);
    1789             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1790             i += OPCODE_LENGTH(op_mod);
    1791             break;
     1644            emitCTICall(Interpreter::cti_op_mod);
     1645            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1646            NEXT_OPCODE(op_mod);
    17921647        }
    17931648        case op_mul: {
    1794             int dst = instruction[i + 1].u.operand;
    1795             int src1 = instruction[i + 2].u.operand;
    1796             int src2 = instruction[i + 3].u.operand;
     1649            int dst = currentInstruction[1].u.operand;
     1650            int src1 = currentInstruction[2].u.operand;
     1651            int src2 = currentInstruction[3].u.operand;
    17971652            JSValue* src1Value = getConstantImmediateNumericArg(src1);
    17981653            JSValue* src2Value = getConstantImmediateNumericArg(src2);
     
    18041659                emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx);
    18051660                emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx);
    1806                 emitCTICall(i, Interpreter::cti_op_mul);
     1661                emitCTICall(Interpreter::cti_op_mul);
    18071662                emitPutVirtualRegister(dst);
    18081663            } else if (src2Value && ((value = JSImmediate::intValue(src2Value)) > 0)) {
     
    18121667                emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx);
    18131668                emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx);
    1814                 emitCTICall(i, Interpreter::cti_op_mul);
     1669                emitCTICall(Interpreter::cti_op_mul);
    18151670                emitPutVirtualRegister(dst);
    18161671            } else
    1817                 compileBinaryArithOpSlowCase(op_mul, iter, dst, src1, src2, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    1818             i += OPCODE_LENGTH(op_mul);
    1819             break;
    1820         }
    1821 
    1822         case op_call:
    1823         case op_call_eval:
     1672                compileBinaryArithOpSlowCase(op_mul, iter, dst, src1, src2, OperandTypes::fromInt(currentInstruction[4].u.operand));
     1673            NEXT_OPCODE(op_mul);
     1674        }
     1675
     1676        case op_call: {
     1677            compileOpCallSlowCase(currentInstruction, iter, callLinkInfoIndex++, opcodeID);
     1678            NEXT_OPCODE(op_call);
     1679        }
     1680        case op_call_eval: {
     1681            compileOpCallSlowCase(currentInstruction, iter, callLinkInfoIndex++, opcodeID);
     1682            NEXT_OPCODE(op_call_eval);
     1683        }
    18241684        case op_construct: {
    1825             compileOpCallSlowCase(instruction + i, i, iter, callLinkInfoIndex++, opcodeID);
    1826             i += (opcodeID == op_construct ? OPCODE_LENGTH(op_construct) : OPCODE_LENGTH(op_call));
    1827             break;
     1685            compileOpCallSlowCase(currentInstruction, iter, callLinkInfoIndex++, opcodeID);
     1686            NEXT_OPCODE(op_construct);
    18281687        }
    18291688        case op_to_jsnumber: {
    1830             linkSlowCaseIfNotJSCell(iter, instruction[i + 2].u.operand);
    1831             linkSlowCase(iter);
    1832 
    1833             emitPutCTIArg(X86::eax, 0);
    1834             emitCTICall(i, Interpreter::cti_op_to_jsnumber);
    1835 
    1836             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1837             i += OPCODE_LENGTH(op_to_jsnumber);
    1838             break;
     1689            linkSlowCaseIfNotJSCell(iter, currentInstruction[2].u.operand);
     1690            linkSlowCase(iter);
     1691
     1692            emitPutCTIArg(X86::eax, 0);
     1693            emitCTICall(Interpreter::cti_op_to_jsnumber);
     1694
     1695            emitPutVirtualRegister(currentInstruction[1].u.operand);
     1696            NEXT_OPCODE(op_to_jsnumber);
    18391697        }
    18401698
    18411699        default:
    18421700            ASSERT_NOT_REACHED();
    1843             break;
    18441701        }
    18451702
     
    18471704        ASSERT_WITH_MESSAGE(firstTo == (iter - 1)->to, "Too many jumps linked in slow case codegen.");
    18481705
    1849         __ link(jump(), m_labels[i]);
     1706        emitJumpSlowToHot(jump(), 0);
    18501707    }
    18511708
     1709#if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
    18521710    ASSERT(propertyAccessInstructionIndex == m_codeBlock->numberOfStructureStubInfos());
     1711#endif
    18531712    ASSERT(callLinkInfoIndex == m_codeBlock->numberOfCallLinkInfos());
     1713
     1714#ifndef NDEBUG
     1715    // reset this, in order to guard it's use with asserts
     1716    m_bytecodeIndex = -1;
     1717#endif
    18541718}
    18551719
     
    18851749    if (m_codeBlock->codeType() == FunctionCode) {
    18861750        slowRegisterFileCheck.link(this);
    1887         emitCTICall(0, Interpreter::cti_register_file_check);
     1751        m_bytecodeIndex = 0; // emitCTICall will add to the map, but doesn't actually need this...
     1752        emitCTICall(Interpreter::cti_register_file_check);
     1753#ifndef NDEBUG
     1754        // reset this, in order to guard it's use with asserts
     1755        m_bytecodeIndex = -1;
     1756#endif
    18881757        jump(afterRegisterFileCheck);
    18891758    }
Note: See TracChangeset for help on using the changeset viewer.