Changeset 37891 in webkit for trunk/JavaScriptCore/VM/CTI.cpp


Ignore:
Timestamp:
Oct 25, 2008, 12:59:47 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-25 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig, with Gavin Barraclough's help.


Fixed Sampling Tool:

  • Made CodeBlock sampling work with CTI
  • Improved accuracy by unifying most sampling data into a single 32bit word, which can be written / read atomically.
  • Split out three different #ifdefs for modularity: OPCODE_SAMPLING; CODEBLOCK_SAMPLING; OPCODE_STATS.
  • Improved reporting clarity
  • Refactored for code clarity
  • VM/CTI.cpp: (JSC::CTI::emitCTICall): (JSC::CTI::compileOpCall): (JSC::CTI::emitSlowScriptCheck): (JSC::CTI::compileBinaryArithOpSlowCase): (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases): (JSC::CTI::privateCompile):
  • VM/CTI.h: Updated CTI codegen to use the unified SamplingTool interface for encoding samples. (This required passing the current vPC to a lot more functions, since the unified interface samples the current vPC.) Added hooks for writing the current CodeBlock* on function entry and after a function call, for the sake of the CodeBlock sampler. Removed obsolete hook for clearing the current sample inside op_end. Also removed the custom enum used to differentiate flavors of op_call, since the OpcodeID enum works just as well. (This was important in an earlier version of the patch, but now it's just cleanup.)
  • VM/CodeBlock.cpp: (JSC::CodeBlock::lineNumberForVPC):
  • VM/CodeBlock.h: Upated for refactored #ifdefs. Changed lineNumberForVPC to be robust against vPCs not recorded for exception handling, since the Sampler may ask for an arbitrary vPC.
  • VM/Machine.cpp: (JSC::Machine::execute): (JSC::Machine::privateExecute): (JSC::Machine::cti_op_call_NotJSFunction): (JSC::Machine::cti_op_construct_NotJSConstruct):
  • VM/Machine.h: (JSC::Machine::setSampler): (JSC::Machine::sampler): (JSC::Machine::jitCodeBuffer): Upated for refactored #ifdefs. Changed Machine to use SamplingTool helper objects to record movement in and out of host code. This makes samples a bit more precise.


  • VM/Opcode.cpp: (JSC::OpcodeStats::~OpcodeStats):
  • VM/Opcode.h: Upated for refactored #ifdefs. Added a little more padding, to accomodate our more verbose opcode names.
  • VM/SamplingTool.cpp: (JSC::ScopeSampleRecord::sample): Only count a sample toward our total if we actually record it. This solves cases where a CodeBlock will claim to have been sampled many times, with reported samples that don't match.

(JSC::SamplingTool::run): Read the current sample into a Sample helper
object, to ensure that the data doesn't change while we're analyzing it,
and to help decode the data. Only access the CodeBlock sampling hash
table if CodeBlock sampling has been enabled, so non-CodeBlock sampling
runs can operate with even less overhead.

(JSC::SamplingTool::dump): I reorganized this code a lot to print the
most important info at the top, print as a table, annotate and document
the stuff I didn't understand when I started, etc.

  • VM/SamplingTool.h: New helper classes, described above.
  • kjs/Parser.h:
  • kjs/Shell.cpp: (runWithScripts):
  • kjs/nodes.cpp: (JSC::ScopeNode::ScopeNode): Updated for new sampling APIs.
  • wtf/Platform.h: Moved sampling #defines here, since our custom is to put ENABLE #defines into Platform.h. Made explicit the fact that CODEBLOCK_SAMPLING depends on OPCODE_SAMPLING.
File:
1 edited

Legend:

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

    r37888 r37891  
    3535#include "wrec/WREC.h"
    3636#include "ResultType.h"
     37#include "SamplingTool.h"
    3738
    3839#ifndef NDEBUG
     
    262263    // FIXME: #ifndef NDEBUG, Write the correct m_type to the register.
    263264}
    264 
    265 #if ENABLE(SAMPLING_TOOL)
    266 unsigned inCalledCode = 0;
    267 #endif
    268265
    269266void ctiSetReturnAddress(void** where, void* what)
     
    330327}
    331328
    332 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_j helper)
    333 {
    334 #if ENABLE(SAMPLING_TOOL)
    335     m_jit.movl_i32m(1, &inCalledCode);
     329ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned opcodeIndex, CTIHelper_j helper)
     330{
     331#if ENABLE(OPCODE_SAMPLING)
     332    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, true), m_machine->sampler()->sampleSlot());
     333#else
     334    UNUSED_PARAM(vPC);
    336335#endif
    337336    m_jit.emitRestoreArgumentReference();
     
    339338    X86Assembler::JmpSrc call = m_jit.emitCall();
    340339    m_calls.append(CallRecord(call, helper, opcodeIndex));
    341 #if ENABLE(SAMPLING_TOOL)
    342     m_jit.movl_i32m(0, &inCalledCode);
     340#if ENABLE(OPCODE_SAMPLING)
     341    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, false), m_machine->sampler()->sampleSlot());
    343342#endif
    344343
     
    346345}
    347346
    348 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_o helper)
    349 {
    350 #if ENABLE(SAMPLING_TOOL)
    351     m_jit.movl_i32m(1, &inCalledCode);
     347ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned opcodeIndex, CTIHelper_o helper)
     348{
     349#if ENABLE(OPCODE_SAMPLING)
     350    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, true), m_machine->sampler()->sampleSlot());
     351#else
     352    UNUSED_PARAM(vPC);
    352353#endif
    353354    m_jit.emitRestoreArgumentReference();
     
    355356    X86Assembler::JmpSrc call = m_jit.emitCall();
    356357    m_calls.append(CallRecord(call, helper, opcodeIndex));
    357 #if ENABLE(SAMPLING_TOOL)
    358     m_jit.movl_i32m(0, &inCalledCode);
     358#if ENABLE(OPCODE_SAMPLING)
     359    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, false), m_machine->sampler()->sampleSlot());
    359360#endif
    360361
     
    362363}
    363364
    364 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_p helper)
    365 {
    366 #if ENABLE(SAMPLING_TOOL)
    367     m_jit.movl_i32m(1, &inCalledCode);
     365ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned opcodeIndex, CTIHelper_p helper)
     366{
     367#if ENABLE(OPCODE_SAMPLING)
     368    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, true), m_machine->sampler()->sampleSlot());
     369#else
     370    UNUSED_PARAM(vPC);
    368371#endif
    369372    m_jit.emitRestoreArgumentReference();
     
    371374    X86Assembler::JmpSrc call = m_jit.emitCall();
    372375    m_calls.append(CallRecord(call, helper, opcodeIndex));
    373 #if ENABLE(SAMPLING_TOOL)
    374     m_jit.movl_i32m(0, &inCalledCode);
     376#if ENABLE(OPCODE_SAMPLING)
     377    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, false), m_machine->sampler()->sampleSlot());
    375378#endif
    376379
     
    378381}
    379382
    380 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_b helper)
    381 {
    382 #if ENABLE(SAMPLING_TOOL)
    383     m_jit.movl_i32m(1, &inCalledCode);
     383ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned opcodeIndex, CTIHelper_b helper)
     384{
     385#if ENABLE(OPCODE_SAMPLING)
     386    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, true), m_machine->sampler()->sampleSlot());
     387#else
     388    UNUSED_PARAM(vPC);
    384389#endif
    385390    m_jit.emitRestoreArgumentReference();
     
    387392    X86Assembler::JmpSrc call = m_jit.emitCall();
    388393    m_calls.append(CallRecord(call, helper, opcodeIndex));
    389 #if ENABLE(SAMPLING_TOOL)
    390     m_jit.movl_i32m(0, &inCalledCode);
     394#if ENABLE(OPCODE_SAMPLING)
     395    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, false), m_machine->sampler()->sampleSlot());
    391396#endif
    392397
     
    394399}
    395400
    396 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_v helper)
    397 {
    398 #if ENABLE(SAMPLING_TOOL)
    399     m_jit.movl_i32m(1, &inCalledCode);
     401ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned opcodeIndex, CTIHelper_v helper)
     402{
     403#if ENABLE(OPCODE_SAMPLING)
     404    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, true), m_machine->sampler()->sampleSlot());
     405#else
     406    UNUSED_PARAM(vPC);
    400407#endif
    401408    m_jit.emitRestoreArgumentReference();
     
    403410    X86Assembler::JmpSrc call = m_jit.emitCall();
    404411    m_calls.append(CallRecord(call, helper, opcodeIndex));
    405 #if ENABLE(SAMPLING_TOOL)
    406     m_jit.movl_i32m(0, &inCalledCode);
     412#if ENABLE(OPCODE_SAMPLING)
     413    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, false), m_machine->sampler()->sampleSlot());
    407414#endif
    408415
     
    410417}
    411418
    412 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_s helper)
    413 {
    414 #if ENABLE(SAMPLING_TOOL)
    415     m_jit.movl_i32m(1, &inCalledCode);
     419ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned opcodeIndex, CTIHelper_s helper)
     420{
     421#if ENABLE(OPCODE_SAMPLING)
     422    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, true), m_machine->sampler()->sampleSlot());
     423#else
     424    UNUSED_PARAM(vPC);
    416425#endif
    417426    m_jit.emitRestoreArgumentReference();
     
    419428    X86Assembler::JmpSrc call = m_jit.emitCall();
    420429    m_calls.append(CallRecord(call, helper, opcodeIndex));
    421 #if ENABLE(SAMPLING_TOOL)
    422     m_jit.movl_i32m(0, &inCalledCode);
     430#if ENABLE(OPCODE_SAMPLING)
     431    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, false), m_machine->sampler()->sampleSlot());
    423432#endif
    424433
     
    426435}
    427436
    428 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_2 helper)
    429 {
    430 #if ENABLE(SAMPLING_TOOL)
    431     m_jit.movl_i32m(1, &inCalledCode);
     437ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned opcodeIndex, CTIHelper_2 helper)
     438{
     439#if ENABLE(OPCODE_SAMPLING)
     440    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, true), m_machine->sampler()->sampleSlot());
     441#else
     442    UNUSED_PARAM(vPC);
    432443#endif
    433444    m_jit.emitRestoreArgumentReference();
     
    435446    X86Assembler::JmpSrc call = m_jit.emitCall();
    436447    m_calls.append(CallRecord(call, helper, opcodeIndex));
    437 #if ENABLE(SAMPLING_TOOL)
    438     m_jit.movl_i32m(0, &inCalledCode);
     448#if ENABLE(OPCODE_SAMPLING)
     449    m_jit.movl_i32m(m_machine->sampler()->encodeSample(vPC, false), m_machine->sampler()->sampleSlot());
    439450#endif
    440451
     
    527538        emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); \
    528539        emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); \
    529         emitCTICall(i, Machine::cti_##name); \
     540        emitCTICall(instruction + i, i, Machine::cti_##name); \
    530541        emitPutResult(instruction[i + 1].u.operand); \
    531542        i += 4; \
     
    536547    case name: { \
    537548        emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); \
    538         emitCTICall(i, Machine::cti_##name); \
     549        emitCTICall(instruction + i, i, Machine::cti_##name); \
    539550        emitPutResult(instruction[i + 1].u.operand); \
    540551        i += 3; \
    541552        break; \
    542553    }
    543 
    544 #if ENABLE(SAMPLING_TOOL)
    545 OpcodeID currentOpcodeID = static_cast<OpcodeID>(-1);
    546 #endif
    547554
    548555static void unreachable()
     
    582589}
    583590
    584 void CTI::compileOpCall(Instruction* instruction, unsigned i, unsigned callLinkInfoIndex, CompileOpCallType type)
     591void CTI::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned i, unsigned callLinkInfoIndex)
    585592{
    586593    int dst = instruction[1].u.operand;
     
    591598
    592599    // Setup this value as the first argument (does not apply to constructors)
    593     if (type != OpConstruct) {
     600    if (opcodeID != op_construct) {
    594601        int thisVal = instruction[3].u.operand;
    595602        if (thisVal == missingThisObjectMarker()) {
     
    604611    // Handle eval
    605612    X86Assembler::JmpSrc wasEval;
    606     if (type == OpCallEval) {
     613    if (opcodeID == op_call_eval) {
    607614        emitGetArg(callee, X86::ecx);
    608615        compileOpCallSetupArgs(instruction, false, true);
    609616
    610         emitCTICall(i, Machine::cti_op_call_eval);
     617        emitCTICall(instruction, i, Machine::cti_op_call_eval);
    611618        m_jit.cmpl_i32r(asInteger(JSImmediate::impossibleValue()), X86::eax);
    612619        wasEval = m_jit.emitUnlinkedJne();
     
    625632
    626633    // In the case of OpConstruct, call oout to a cti_ function to create the new object.
    627     if (type == OpConstruct) {
     634    if (opcodeID == op_construct) {
    628635        emitPutArg(X86::ecx, 0);
    629636        emitGetPutArg(instruction[3].u.operand, 4, X86::eax);
    630         emitCTICall(i, Machine::cti_op_construct_JSConstructFast);
     637        emitCTICall(instruction, i, Machine::cti_op_construct_JSConstructFast);
    631638        emitPutResult(instruction[4].u.operand);
    632639        emitGetArg(callee, X86::ecx);
     
    646653    m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall(i, unreachable);
    647654   
    648     if (type == OpCallEval)
     655    if (opcodeID == op_call_eval)
    649656        m_jit.link(wasEval, m_jit.label());
    650657
    651658    // Put the return value in dst. In the interpreter, op_ret does this.
    652659    emitPutResult(dst);
     660
     661#if ENABLE(CODEBLOCK_SAMPLING)
     662        m_jit.movl_i32m(reinterpret_cast<unsigned>(m_codeBlock), m_machine->sampler()->codeBlockSlot());
     663#endif
    653664}
    654665
     
    709720}
    710721
    711 void CTI::emitSlowScriptCheck(unsigned opcodeIndex)
     722void CTI::emitSlowScriptCheck(Instruction* vPC, unsigned opcodeIndex)
    712723{
    713724    m_jit.subl_i8r(1, X86::esi);
    714725    X86Assembler::JmpSrc skipTimeout = m_jit.emitUnlinkedJne();
    715     emitCTICall(opcodeIndex, Machine::cti_timeout_check);
     726    emitCTICall(vPC, opcodeIndex, Machine::cti_timeout_check);
    716727
    717728    emitGetCTIParam(CTI_ARGS_globalData, X86::ecx);
     
    906917}
    907918
    908 void CTI::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes types, unsigned i)
     919void CTI::compileBinaryArithOpSlowCase(Instruction* vPC, OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes types, unsigned i)
    909920{
    910921    X86Assembler::JmpDst here = m_jit.label();
     
    940951    emitGetPutArg(src2, 4, X86::ecx);
    941952    if (opcodeID == op_add)
    942         emitCTICall(i, Machine::cti_op_add);
     953        emitCTICall(vPC, i, Machine::cti_op_add);
    943954    else if (opcodeID == op_sub)
    944         emitCTICall(i, Machine::cti_op_sub);
     955        emitCTICall(vPC, i, Machine::cti_op_sub);
    945956    else {
    946957        ASSERT(opcodeID == op_mul);
    947         emitCTICall(i, Machine::cti_op_mul);
     958        emitCTICall(vPC, i, Machine::cti_op_mul);
    948959    }
    949960    emitPutResult(dst);
     
    959970
    960971    for (unsigned i = 0; i < instructionCount; ) {
     972        ASSERT_WITH_MESSAGE(m_machine->isOpcode(instruction[i].u.opcode), "privateCompileMainPass gone bad @ %d", i);
     973
     974#if ENABLE(OPCODE_SAMPLING)
     975        m_jit.movl_i32m(m_machine->sampler()->encodeSample(instruction + i), m_machine->sampler()->sampleSlot());
     976#endif
     977
    961978        m_labels[i] = m_jit.label();
    962 
    963 #if ENABLE(SAMPLING_TOOL)
    964         m_jit.movl_i32m(m_machine->getOpcodeID(instruction[i].u.opcode), &currentOpcodeID);
    965 #endif
    966 
    967         ASSERT_WITH_MESSAGE(m_machine->isOpcode(instruction[i].u.opcode), "privateCompileMainPass gone bad @ %d", i);
    968         switch (m_machine->getOpcodeID(instruction[i].u.opcode)) {
     979        OpcodeID opcodeID = m_machine->getOpcodeID(instruction[i].u.opcode);
     980        switch (opcodeID) {
    969981        case op_mov: {
    970982            unsigned src = instruction[i + 2].u.operand;
     
    10011013                    emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    10021014                    emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    1003                     emitCTICall(i, Machine::cti_op_add);
     1015                    emitCTICall(instruction + i, i, Machine::cti_op_add);
    10041016                    emitPutResult(instruction[i + 1].u.operand);
    10051017                }
     
    10111023        case op_end: {
    10121024            if (m_codeBlock->needsFullScopeChain)
    1013                 emitCTICall(i, Machine::cti_op_end);
     1025                emitCTICall(instruction + i, i, Machine::cti_op_end);
    10141026            emitGetArg(instruction[i + 1].u.operand, X86::eax);
    1015 #if ENABLE(SAMPLING_TOOL)
    1016             m_jit.movl_i32m(-1, &currentOpcodeID);
    1017 #endif
    10181027            m_jit.pushl_m(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), X86::edi);
    10191028            m_jit.ret();
     
    10381047        }
    10391048        case op_loop: {
    1040             emitSlowScriptCheck(i);
     1049            emitSlowScriptCheck(instruction, i);
    10411050
    10421051            unsigned target = instruction[i + 1].u.operand;
     
    10461055        }
    10471056        case op_loop_if_less: {
    1048             emitSlowScriptCheck(i);
     1057            emitSlowScriptCheck(instruction, i);
    10491058
    10501059            unsigned target = instruction[i + 3].u.operand;
     
    10671076        }
    10681077        case op_loop_if_lesseq: {
    1069             emitSlowScriptCheck(i);
     1078            emitSlowScriptCheck(instruction, i);
    10701079
    10711080            unsigned target = instruction[i + 3].u.operand;
     
    10881097        }
    10891098        case op_new_object: {
    1090             emitCTICall(i, Machine::cti_op_new_object);
     1099            emitCTICall(instruction + i, i, Machine::cti_op_new_object);
    10911100            emitPutResult(instruction[i + 1].u.operand);
    10921101            i += 2;
     
    12141223            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]);
    12151224            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4);
    1216             emitCTICall(i, Machine::cti_op_del_by_id);
     1225            emitCTICall(instruction + i, i, Machine::cti_op_del_by_id);
    12171226            emitPutResult(instruction[i + 1].u.operand);
    12181227            i += 4;
     
    12531262            FuncDeclNode* func = (m_codeBlock->functions[instruction[i + 2].u.operand]).get();
    12541263            emitPutArgConstant(reinterpret_cast<unsigned>(func), 0);
    1255             emitCTICall(i, Machine::cti_op_new_func);
     1264            emitCTICall(instruction + i, i, Machine::cti_op_new_func);
    12561265            emitPutResult(instruction[i + 1].u.operand);
    12571266            i += 3;
     
    12591268        }
    12601269        case op_call: {
    1261             compileOpCall(instruction + i, i, callLinkInfoIndex++);
     1270            compileOpCall(opcodeID, instruction + i, i, callLinkInfoIndex++);
    12621271            i += 7;
    12631272            break;
     
    13071316        case op_tear_off_activation: {
    13081317            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx);
    1309             emitCTICall(i, Machine::cti_op_tear_off_activation);
     1318            emitCTICall(instruction + i, i, Machine::cti_op_tear_off_activation);
    13101319            i += 2;
    13111320            break;
    13121321        }
    13131322        case op_tear_off_arguments: {
    1314             emitCTICall(i, Machine::cti_op_tear_off_arguments);
     1323            emitCTICall(instruction + i, i, Machine::cti_op_tear_off_arguments);
    13151324            i += 1;
    13161325            break;
     
    13191328            // We could JIT generate the deref, only calling out to C when the refcount hits zero.
    13201329            if (m_codeBlock->needsFullScopeChain)
    1321                 emitCTICall(i, Machine::cti_op_ret_scopeChain);
     1330                emitCTICall(instruction + i, i, Machine::cti_op_ret_scopeChain);
    13221331
    13231332            // Return the result in %eax.
     
    13411350            emitPutArg(X86::edx, 0);
    13421351            emitPutArgConstant(instruction[i + 3].u.operand, 4);
    1343             emitCTICall(i, Machine::cti_op_new_array);
     1352            emitCTICall(instruction + i, i, Machine::cti_op_new_array);
    13441353            emitPutResult(instruction[i + 1].u.operand);
    13451354            i += 4;
     
    13491358            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]);
    13501359            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0);
    1351             emitCTICall(i, Machine::cti_op_resolve);
     1360            emitCTICall(instruction + i, i, Machine::cti_op_resolve);
    13521361            emitPutResult(instruction[i + 1].u.operand);
    13531362            i += 3;
     
    13551364        }
    13561365        case op_construct: {
    1357             compileOpCall(instruction + i, i, callLinkInfoIndex++, OpConstruct);
     1366            compileOpCall(opcodeID, instruction + i, i, callLinkInfoIndex++);
    13581367            i += 7;
    13591368            break;
     
    14001409            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]);
    14011410            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0);
    1402             emitCTICall(i, Machine::cti_op_resolve_func);
     1411            emitCTICall(instruction + i, i, Machine::cti_op_resolve_func);
    14031412            emitPutResult(instruction[i + 1].u.operand);
    14041413            emitPutResult(instruction[i + 2].u.operand, X86::edx);
     
    14431452        CTI_COMPILE_BINARY_OP(op_lesseq)
    14441453        case op_loop_if_true: {
    1445             emitSlowScriptCheck(i);
     1454            emitSlowScriptCheck(instruction, i);
    14461455
    14471456            unsigned target = instruction[i + 2].u.operand;
     
    14651474            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]);
    14661475            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0);
    1467             emitCTICall(i, Machine::cti_op_resolve_base);
     1476            emitCTICall(instruction + i, i, Machine::cti_op_resolve_base);
    14681477            emitPutResult(instruction[i + 1].u.operand);
    14691478            i += 3;
     
    14721481        case op_negate: {
    14731482            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    1474             emitCTICall(i, Machine::cti_op_negate);
     1483            emitCTICall(instruction + i, i, Machine::cti_op_negate);
    14751484            emitPutResult(instruction[i + 1].u.operand);
    14761485            i += 3;
     
    14811490            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0);
    14821491            emitPutArgConstant(instruction[i + 3].u.operand + m_codeBlock->needsFullScopeChain, 4);
    1483             emitCTICall(i, Machine::cti_op_resolve_skip);
     1492            emitCTICall(instruction + i, i, Machine::cti_op_resolve_skip);
    14841493            emitPutResult(instruction[i + 1].u.operand);
    14851494            i += 4;
     
    15111520            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4);
    15121521            emitPutArgConstant(reinterpret_cast<unsigned>(instruction + i), 8);
    1513             emitCTICall(i, Machine::cti_op_resolve_global);
     1522            emitCTICall(instruction + i, i, Machine::cti_op_resolve_global);
    15141523            emitPutResult(instruction[i + 1].u.operand);
    15151524            m_jit.link(end, m_jit.label());
     
    17421751            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]);
    17431752            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0);
    1744             emitCTICall(i, Machine::cti_op_resolve_with_base);
     1753            emitCTICall(instruction + i, i, Machine::cti_op_resolve_with_base);
    17451754            emitPutResult(instruction[i + 1].u.operand);
    17461755            emitPutResult(instruction[i + 2].u.operand, X86::edx);
     
    17511760            FuncExprNode* func = (m_codeBlock->functionExpressions[instruction[i + 2].u.operand]).get();
    17521761            emitPutArgConstant(reinterpret_cast<unsigned>(func), 0);
    1753             emitCTICall(i, Machine::cti_op_new_func_exp);
     1762            emitCTICall(instruction + i, i, Machine::cti_op_new_func_exp);
    17541763            emitPutResult(instruction[i + 1].u.operand);
    17551764            i += 3;
     
    18311840            RegExp* regExp = m_codeBlock->regexps[instruction[i + 2].u.operand].get();
    18321841            emitPutArgConstant(reinterpret_cast<unsigned>(regExp), 0);
    1833             emitCTICall(i, Machine::cti_op_new_regexp);
     1842            emitCTICall(instruction + i, i, Machine::cti_op_new_regexp);
    18341843            emitPutResult(instruction[i + 1].u.operand);
    18351844            i += 3;
     
    18461855        }
    18471856        case op_call_eval: {
    1848             compileOpCall(instruction + i, i, callLinkInfoIndex++, OpCallEval);
     1857            compileOpCall(opcodeID, instruction + i, i, callLinkInfoIndex++);
    18491858            i += 7;
    18501859            break;
     
    18521861        case op_throw: {
    18531862            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx);
    1854             emitCTICall(i, Machine::cti_op_throw);
     1863            emitCTICall(instruction + i, i, Machine::cti_op_throw);
    18551864            m_jit.addl_i8r(0x20, X86::esp);
    18561865            m_jit.popl_r(X86::ebx);
     
    18631872        case op_get_pnames: {
    18641873            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    1865             emitCTICall(i, Machine::cti_op_get_pnames);
     1874            emitCTICall(instruction + i, i, Machine::cti_op_get_pnames);
    18661875            emitPutResult(instruction[i + 1].u.operand);
    18671876            i += 3;
     
    18711880            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    18721881            unsigned target = instruction[i + 3].u.operand;
    1873             emitCTICall(i, Machine::cti_op_next_pname);
     1882            emitCTICall(instruction + i, i, Machine::cti_op_next_pname);
    18741883            m_jit.testl_rr(X86::eax, X86::eax);
    18751884            X86Assembler::JmpSrc endOfIter = m_jit.emitUnlinkedJe();
     
    18821891        case op_push_scope: {
    18831892            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx);
    1884             emitCTICall(i, Machine::cti_op_push_scope);
     1893            emitCTICall(instruction + i, i, Machine::cti_op_push_scope);
    18851894            i += 2;
    18861895            break;
    18871896        }
    18881897        case op_pop_scope: {
    1889             emitCTICall(i, Machine::cti_op_pop_scope);
     1898            emitCTICall(instruction + i, i, Machine::cti_op_pop_scope);
    18901899            i += 1;
    18911900            break;
     
    19301939            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    19311940            emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    1932             emitCTICall(i, Machine::cti_op_in);
     1941            emitCTICall(instruction + i, i, Machine::cti_op_in);
    19331942            emitPutResult(instruction[i + 1].u.operand);
    19341943            i += 4;
     
    19391948            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0);
    19401949            emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    1941             emitCTICall(i, Machine::cti_op_push_new_scope);
     1950            emitCTICall(instruction + i, i, Machine::cti_op_push_new_scope);
    19421951            emitPutResult(instruction[i + 1].u.operand);
    19431952            i += 4;
     
    19531962            unsigned count = instruction[i + 1].u.operand;
    19541963            emitPutArgConstant(count, 0);
    1955             emitCTICall(i, Machine::cti_op_jmp_scopes);
     1964            emitCTICall(instruction + i, i, Machine::cti_op_jmp_scopes);
    19561965            unsigned target = instruction[i + 2].u.operand;
    19571966            m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJmp(), i + 2 + target));
     
    19631972            emitPutArgConstant(instruction[i + 2].u.operand, 4);
    19641973            emitGetPutArg(instruction[i + 3].u.operand, 8, X86::ecx);
    1965             emitCTICall(i, Machine::cti_op_put_by_index);
     1974            emitCTICall(instruction + i, i, Machine::cti_op_put_by_index);
    19661975            i += 4;
    19671976            break;
     
    19791988            emitGetPutArg(scrutinee, 0, X86::ecx);
    19801989            emitPutArgConstant(tableIndex, 4);
    1981             emitCTICall(i, Machine::cti_op_switch_imm);
     1990            emitCTICall(instruction + i, i, Machine::cti_op_switch_imm);
    19821991            m_jit.jmp_r(X86::eax);
    19831992            i += 4;
     
    19962005            emitGetPutArg(scrutinee, 0, X86::ecx);
    19972006            emitPutArgConstant(tableIndex, 4);
    1998             emitCTICall(i, Machine::cti_op_switch_char);
     2007            emitCTICall(instruction + i, i, Machine::cti_op_switch_char);
    19992008            m_jit.jmp_r(X86::eax);
    20002009            i += 4;
     
    20122021            emitGetPutArg(scrutinee, 0, X86::ecx);
    20132022            emitPutArgConstant(tableIndex, 4);
    2014             emitCTICall(i, Machine::cti_op_switch_string);
     2023            emitCTICall(instruction + i, i, Machine::cti_op_switch_string);
    20152024            m_jit.jmp_r(X86::eax);
    20162025            i += 4;
     
    20202029            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    20212030            emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    2022             emitCTICall(i, Machine::cti_op_del_by_val);
     2031            emitCTICall(instruction + i, i, Machine::cti_op_del_by_val);
    20232032            emitPutResult(instruction[i + 1].u.operand);
    20242033            i += 4;
     
    20302039            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4);
    20312040            emitGetPutArg(instruction[i + 3].u.operand, 8, X86::ecx);
    2032             emitCTICall(i, Machine::cti_op_put_getter);
     2041            emitCTICall(instruction + i, i, Machine::cti_op_put_getter);
    20332042            i += 4;
    20342043            break;
     
    20392048            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4);
    20402049            emitGetPutArg(instruction[i + 3].u.operand, 8, X86::ecx);
    2041             emitCTICall(i, Machine::cti_op_put_setter);
     2050            emitCTICall(instruction + i, i, Machine::cti_op_put_setter);
    20422051            i += 4;
    20432052            break;
     
    20482057            emitPutArgConstant(asInteger(message), 4);
    20492058            emitPutArgConstant(m_codeBlock->lineNumberForVPC(&instruction[i]), 8);
    2050             emitCTICall(i, Machine::cti_op_new_error);
     2059            emitCTICall(instruction + i, i, Machine::cti_op_new_error);
    20512060            emitPutResult(instruction[i + 1].u.operand);
    20522061            i += 4;
     
    20572066            emitPutArgConstant(instruction[i + 2].u.operand, 4);
    20582067            emitPutArgConstant(instruction[i + 3].u.operand, 8);
    2059             emitCTICall(i, Machine::cti_op_debug);
     2068            emitCTICall(instruction + i, i, Machine::cti_op_debug);
    20602069            i += 4;
    20612070            break;
     
    21402149                emitInitRegister(j);
    21412150
    2142             emitCTICall(i, Machine::cti_op_push_activation);
     2151            emitCTICall(instruction + i, i, Machine::cti_op_push_activation);
    21432152            emitPutResult(instruction[i + 1].u.operand);
    21442153
     
    21472156        }
    21482157        case op_create_arguments: {
    2149             emitCTICall(i, (m_codeBlock->numParameters == 1) ? Machine::cti_op_create_arguments_no_params : Machine::cti_op_create_arguments);
     2158            emitCTICall(instruction + i, i, (m_codeBlock->numParameters == 1) ? Machine::cti_op_create_arguments_no_params : Machine::cti_op_create_arguments);
    21502159            i += 1;
    21512160            break;
     
    21672176            X86Assembler::JmpSrc noProfiler = m_jit.emitUnlinkedJe();
    21682177            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::eax);
    2169             emitCTICall(i, Machine::cti_op_profile_will_call);
     2178            emitCTICall(instruction + i, i, Machine::cti_op_profile_will_call);
    21702179            m_jit.link(noProfiler, m_jit.label());
    21712180
     
    21782187            X86Assembler::JmpSrc noProfiler = m_jit.emitUnlinkedJe();
    21792188            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::eax);
    2180             emitCTICall(i, Machine::cti_op_profile_did_call);
     2189            emitCTICall(instruction + i, i, Machine::cti_op_profile_did_call);
    21812190            m_jit.link(noProfiler, m_jit.label());
    21822191
     
    22152224        emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); \
    22162225        emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); \
    2217         emitCTICall(i, Machine::cti_##name); \
     2226        emitCTICall(instruction + i, i, Machine::cti_##name); \
    22182227        emitPutResult(instruction[i + 1].u.operand); \
    22192228        i += 4; \
     
    22342243            m_jit.link((++iter)->from, m_jit.label());
    22352244            emitPutArg(X86::eax, 0);
    2236             emitCTICall(i, Machine::cti_op_convert_this);
     2245            emitCTICall(instruction + i, i, Machine::cti_op_convert_this);
    22372246            emitPutResult(instruction[i + 1].u.operand);
    22382247            i += 2;
     
    22502259                emitGetPutArg(src1, 0, X86::ecx);
    22512260                emitPutArg(X86::edx, 4);
    2252                 emitCTICall(i, Machine::cti_op_add);
     2261                emitCTICall(instruction + i, i, Machine::cti_op_add);
    22532262                emitPutResult(dst);
    22542263            } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
     
    22592268                emitPutArg(X86::eax, 0);
    22602269                emitGetPutArg(src2, 4, X86::ecx);
    2261                 emitCTICall(i, Machine::cti_op_add);
     2270                emitCTICall(instruction + i, i, Machine::cti_op_add);
    22622271                emitPutResult(dst);
    22632272            } else {
    22642273                OperandTypes types = OperandTypes::fromInt(instruction[i + 4].u.operand);
    22652274                if (types.first().mightBeNumber() && types.second().mightBeNumber())
    2266                     compileBinaryArithOpSlowCase(op_add, iter, dst, src1, src2, types, i);
     2275                    compileBinaryArithOpSlowCase(instruction, op_add, iter, dst, src1, src2, types, i);
    22672276                else
    22682277                    ASSERT_NOT_REACHED();
     
    22832292            emitPutArg(X86::eax, 0);
    22842293            emitPutArg(X86::edx, 4);
    2285             emitCTICall(i, Machine::cti_op_get_by_val);
     2294            emitCTICall(instruction + i, i, Machine::cti_op_get_by_val);
    22862295            emitPutResult(instruction[i + 1].u.operand);
    22872296            m_jit.link(m_jit.emitUnlinkedJmp(), m_labels[i + 4]);
     
    23042313        }
    23052314        case op_sub: {
    2306             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);
     2315            compileBinaryArithOpSlowCase(instruction, 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);
    23072316            i += 5;
    23082317            break;
     
    23132322            emitPutArg(X86::eax, 0);
    23142323            emitPutArg(X86::ecx, 4);
    2315             emitCTICall(i, Machine::cti_op_rshift);
     2324            emitCTICall(instruction + i, i, Machine::cti_op_rshift);
    23162325            emitPutResult(instruction[i + 1].u.operand);
    23172326            i += 4;
     
    23282337            emitPutArg(X86::eax, 0);
    23292338            emitPutArg(X86::ecx, 4);
    2330             emitCTICall(i, Machine::cti_op_lshift);
     2339            emitCTICall(instruction + i, i, Machine::cti_op_lshift);
    23312340            emitPutResult(instruction[i + 1].u.operand);
    23322341            i += 4;
     
    23342343        }
    23352344        case op_loop_if_less: {
    2336             emitSlowScriptCheck(i);
     2345            emitSlowScriptCheck(instruction, i);
    23372346
    23382347            unsigned target = instruction[i + 3].u.operand;
     
    23422351                emitPutArg(X86::edx, 0);
    23432352                emitGetPutArg(instruction[i + 2].u.operand, 4, X86::ecx);
    2344                 emitCTICall(i, Machine::cti_op_loop_if_less);
     2353                emitCTICall(instruction + i, i, Machine::cti_op_loop_if_less);
    23452354                m_jit.testl_rr(X86::eax, X86::eax);
    23462355                m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]);
     
    23502359                emitPutArg(X86::eax, 0);
    23512360                emitPutArg(X86::edx, 4);
    2352                 emitCTICall(i, Machine::cti_op_loop_if_less);
     2361                emitCTICall(instruction + i, i, Machine::cti_op_loop_if_less);
    23532362                m_jit.testl_rr(X86::eax, X86::eax);
    23542363                m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]);
     
    23652374            emitPutArg(X86::eax, 0);
    23662375            emitPutArg(X86::edx, 8);
    2367             X86Assembler::JmpSrc call = emitCTICall(i, Machine::cti_op_put_by_id);
     2376            X86Assembler::JmpSrc call = emitCTICall(instruction + i, i, Machine::cti_op_put_by_id);
    23682377
    23692378            // Track the location of the call; this will be used to recover repatch information.
     
    23912400            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]);
    23922401            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4);
    2393             X86Assembler::JmpSrc call = emitCTICall(i, Machine::cti_op_get_by_id);
     2402            X86Assembler::JmpSrc call = emitCTICall(instruction + i, i, Machine::cti_op_get_by_id);
    23942403            ASSERT(X86Assembler::getDifferenceBetweenLabels(coldPathBegin, call) == repatchOffsetGetByIdSlowCaseCall);
    23952404            emitPutResult(instruction[i + 1].u.operand);
     
    24042413        }
    24052414        case op_loop_if_lesseq: {
    2406             emitSlowScriptCheck(i);
     2415            emitSlowScriptCheck(instruction, i);
    24072416
    24082417            unsigned target = instruction[i + 3].u.operand;
     
    24122421                emitPutArg(X86::edx, 0);
    24132422                emitGetPutArg(instruction[i + 2].u.operand, 4, X86::ecx);
    2414                 emitCTICall(i, Machine::cti_op_loop_if_lesseq);
     2423                emitCTICall(instruction + i, i, Machine::cti_op_loop_if_lesseq);
    24152424                m_jit.testl_rr(X86::eax, X86::eax);
    24162425                m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]);
     
    24202429                emitPutArg(X86::eax, 0);
    24212430                emitPutArg(X86::edx, 4);
    2422                 emitCTICall(i, Machine::cti_op_loop_if_lesseq);
     2431                emitCTICall(instruction + i, i, Machine::cti_op_loop_if_lesseq);
    24232432                m_jit.testl_rr(X86::eax, X86::eax);
    24242433                m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]);
     
    24342443            m_jit.link(notImm, m_jit.label());
    24352444            emitPutArg(X86::eax, 0);
    2436             emitCTICall(i, Machine::cti_op_pre_inc);
     2445            emitCTICall(instruction + i, i, Machine::cti_op_pre_inc);
    24372446            emitPutResult(srcDst);
    24382447            i += 2;
     
    24502459            emitPutArg(X86::edx, 4);
    24512460            emitPutArg(X86::ecx, 8);
    2452             emitCTICall(i, Machine::cti_op_put_by_val);
     2461            emitCTICall(instruction + i, i, Machine::cti_op_put_by_val);
    24532462            m_jit.link(m_jit.emitUnlinkedJmp(), m_labels[i + 4]);
    24542463
     
    24602469            emitPutArg(X86::edx, 4);
    24612470            emitPutArg(X86::ecx, 8);
    2462             emitCTICall(i, Machine::cti_op_put_by_val_array);
     2471            emitCTICall(instruction + i, i, Machine::cti_op_put_by_val_array);
    24632472
    24642473            i += 4;
     
    24662475        }
    24672476        case op_loop_if_true: {
    2468             emitSlowScriptCheck(i);
     2477            emitSlowScriptCheck(instruction, i);
    24692478
    24702479            m_jit.link(iter->from, m_jit.label());
    24712480            emitPutArg(X86::eax, 0);
    2472             emitCTICall(i, Machine::cti_op_jtrue);
     2481            emitCTICall(instruction + i, i, Machine::cti_op_jtrue);
    24732482            m_jit.testl_rr(X86::eax, X86::eax);
    24742483            unsigned target = instruction[i + 2].u.operand;
     
    24842493            m_jit.link(notImm, m_jit.label());
    24852494            emitPutArg(X86::eax, 0);
    2486             emitCTICall(i, Machine::cti_op_pre_dec);
     2495            emitCTICall(instruction + i, i, Machine::cti_op_pre_dec);
    24872496            emitPutResult(srcDst);
    24882497            i += 2;
     
    24962505                emitPutArg(X86::edx, 0);
    24972506                emitGetPutArg(instruction[i + 2].u.operand, 4, X86::ecx);
    2498                 emitCTICall(i, Machine::cti_op_jless);
     2507                emitCTICall(instruction + i, i, Machine::cti_op_jless);
    24992508                m_jit.testl_rr(X86::eax, X86::eax);
    25002509                m_jit.link(m_jit.emitUnlinkedJe(), m_labels[i + 3 + target]);
     
    25042513                emitPutArg(X86::eax, 0);
    25052514                emitPutArg(X86::edx, 4);
    2506                 emitCTICall(i, Machine::cti_op_jless);
     2515                emitCTICall(instruction + i, i, Machine::cti_op_jless);
    25072516                m_jit.testl_rr(X86::eax, X86::eax);
    25082517                m_jit.link(m_jit.emitUnlinkedJe(), m_labels[i + 3 + target]);
     
    25152524            m_jit.xorl_i8r(JSImmediate::FullTagTypeBool, X86::eax);
    25162525            emitPutArg(X86::eax, 0);
    2517             emitCTICall(i, Machine::cti_op_not);
     2526            emitCTICall(instruction + i, i, Machine::cti_op_not);
    25182527            emitPutResult(instruction[i + 1].u.operand);
    25192528            i += 3;
     
    25232532            m_jit.link(iter->from, m_jit.label());
    25242533            emitPutArg(X86::eax, 0);
    2525             emitCTICall(i, Machine::cti_op_jtrue);
     2534            emitCTICall(instruction + i, i, Machine::cti_op_jtrue);
    25262535            m_jit.testl_rr(X86::eax, X86::eax);
    25272536            unsigned target = instruction[i + 2].u.operand;
     
    25352544            m_jit.link((++iter)->from, m_jit.label());
    25362545            emitPutArg(X86::eax, 0);
    2537             emitCTICall(i, Machine::cti_op_post_inc);
     2546            emitCTICall(instruction + i, i, Machine::cti_op_post_inc);
    25382547            emitPutResult(instruction[i + 1].u.operand);
    25392548            emitPutResult(srcDst, X86::edx);
     
    25442553            m_jit.link(iter->from, m_jit.label());
    25452554            emitPutArg(X86::eax, 0);
    2546             emitCTICall(i, Machine::cti_op_bitnot);
     2555            emitCTICall(instruction + i, i, Machine::cti_op_bitnot);
    25472556            emitPutResult(instruction[i + 1].u.operand);
    25482557            i += 3;
     
    25572566                emitGetPutArg(src1, 0, X86::ecx);
    25582567                emitPutArg(X86::eax, 4);
    2559                 emitCTICall(i, Machine::cti_op_bitand);
     2568                emitCTICall(instruction + i, i, Machine::cti_op_bitand);
    25602569                emitPutResult(dst);
    25612570            } else if (getConstantImmediateNumericArg(src2)) {
     
    25632572                emitPutArg(X86::eax, 0);
    25642573                emitGetPutArg(src2, 4, X86::ecx);
    2565                 emitCTICall(i, Machine::cti_op_bitand);
     2574                emitCTICall(instruction + i, i, Machine::cti_op_bitand);
    25662575                emitPutResult(dst);
    25672576            } else {
     
    25692578                emitGetPutArg(src1, 0, X86::ecx);
    25702579                emitPutArg(X86::edx, 4);
    2571                 emitCTICall(i, Machine::cti_op_bitand);
     2580                emitCTICall(instruction + i, i, Machine::cti_op_bitand);
    25722581                emitPutResult(dst);
    25732582            }
     
    25782587            m_jit.link(iter->from, m_jit.label());
    25792588            emitPutArg(X86::eax, 0);
    2580             emitCTICall(i, Machine::cti_op_jtrue);
     2589            emitCTICall(instruction + i, i, Machine::cti_op_jtrue);
    25812590            m_jit.testl_rr(X86::eax, X86::eax);
    25822591            unsigned target = instruction[i + 2].u.operand;
     
    25902599            m_jit.link((++iter)->from, m_jit.label());
    25912600            emitPutArg(X86::eax, 0);
    2592             emitCTICall(i, Machine::cti_op_post_dec);
     2601            emitCTICall(instruction + i, i, Machine::cti_op_post_dec);
    25932602            emitPutResult(instruction[i + 1].u.operand);
    25942603            emitPutResult(srcDst, X86::edx);
     
    26002609            emitPutArg(X86::eax, 0);
    26012610            emitPutArg(X86::edx, 4);
    2602             emitCTICall(i, Machine::cti_op_bitxor);
     2611            emitCTICall(instruction + i, i, Machine::cti_op_bitxor);
    26032612            emitPutResult(instruction[i + 1].u.operand);
    26042613            i += 5;
     
    26092618            emitPutArg(X86::eax, 0);
    26102619            emitPutArg(X86::edx, 4);
    2611             emitCTICall(i, Machine::cti_op_bitor);
     2620            emitCTICall(instruction + i, i, Machine::cti_op_bitor);
    26122621            emitPutResult(instruction[i + 1].u.operand);
    26132622            i += 5;
     
    26182627            emitPutArg(X86::eax, 0);
    26192628            emitPutArg(X86::edx, 4);
    2620             emitCTICall(i, Machine::cti_op_eq);
     2629            emitCTICall(instruction + i, i, Machine::cti_op_eq);
    26212630            emitPutResult(instruction[i + 1].u.operand);
    26222631            i += 4;
     
    26272636            emitPutArg(X86::eax, 0);
    26282637            emitPutArg(X86::edx, 4);
    2629             emitCTICall(i, Machine::cti_op_neq);
     2638            emitCTICall(instruction + i, i, Machine::cti_op_neq);
    26302639            emitPutResult(instruction[i + 1].u.operand);
    26312640            i += 4;
     
    26392648            emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    26402649            emitGetPutArg(instruction[i + 4].u.operand, 8, X86::ecx);
    2641             emitCTICall(i, Machine::cti_op_instanceof);
     2650            emitCTICall(instruction + i, i, Machine::cti_op_instanceof);
    26422651            emitPutResult(instruction[i + 1].u.operand);
    26432652            i += 5;
     
    26542663            emitPutArg(X86::eax, 0);
    26552664            emitPutArg(X86::ecx, 4);
    2656             emitCTICall(i, Machine::cti_op_mod);
     2665            emitCTICall(instruction + i, i, Machine::cti_op_mod);
    26572666            emitPutResult(instruction[i + 1].u.operand);
    26582667            i += 4;
     
    26712680                emitGetPutArg(src1, 0, X86::ecx);
    26722681                emitGetPutArg(src2, 4, X86::ecx);
    2673                 emitCTICall(i, Machine::cti_op_mul);
     2682                emitCTICall(instruction + i, i, Machine::cti_op_mul);
    26742683                emitPutResult(dst);
    26752684            } else if (src2Value && ((value = JSImmediate::intValue(src2Value)) > 0)) {
     
    26782687                emitGetPutArg(src1, 0, X86::ecx);
    26792688                emitGetPutArg(src2, 4, X86::ecx);
    2680                 emitCTICall(i, Machine::cti_op_mul);
     2689                emitCTICall(instruction + i, i, Machine::cti_op_mul);
    26812690                emitPutResult(dst);
    26822691            } else
    2683                 compileBinaryArithOpSlowCase(op_mul, iter, dst, src1, src2, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
     2692                compileBinaryArithOpSlowCase(instruction, op_mul, iter, dst, src1, src2, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    26842693            i += 5;
    26852694            break;
     
    27062715
    27072716            // This handles JSFunctions
    2708             emitCTICall(i, (opcodeID == op_construct) ? Machine::cti_op_construct_JSConstruct : Machine::cti_op_call_JSFunction);
     2717            emitCTICall(instruction + i, i, (opcodeID == op_construct) ? Machine::cti_op_construct_JSConstruct : Machine::cti_op_call_JSFunction);
    27092718            // initialize the new call frame (pointed to by edx, after the last call), then set edi to point to it.
    27102719            compileOpCallInitializeCallFrame(callee, argCount);
     
    27152724            emitPutArgConstant(reinterpret_cast<unsigned>(info), 4);
    27162725            m_callStructureStubCompilationInfo[callLinkInfoIndex].callReturnLocation =
    2717                 emitCTICall(i, Machine::cti_vm_lazyLinkCall);
     2726                emitCTICall(instruction + i, i, Machine::cti_vm_lazyLinkCall);
    27182727            emitNakedCall(i, X86::eax);
    27192728            X86Assembler::JmpSrc storeResultForFirstRun = m_jit.emitUnlinkedJmp();
     
    27372746            m_jit.link(callLinkFailNotObject, notJSFunctionlabel);
    27382747            m_jit.link(callLinkFailNotJSFunction, notJSFunctionlabel);
    2739             emitCTICall(i, ((opcodeID == op_construct) ? Machine::cti_op_construct_NotJSConstruct : Machine::cti_op_call_NotJSFunction));
     2748            emitCTICall(instruction + i, i, ((opcodeID == op_construct) ? Machine::cti_op_construct_NotJSConstruct : Machine::cti_op_call_NotJSFunction));
    27402749            X86Assembler::JmpSrc wasNotJSFunction = m_jit.emitUnlinkedJmp();
    27412750
    27422751            // Next, handle JSFunctions...
    27432752            m_jit.link(isJSFunction, m_jit.label());
    2744             emitCTICall(i, (opcodeID == op_construct) ? Machine::cti_op_construct_JSConstruct : Machine::cti_op_call_JSFunction);
     2753            emitCTICall(instruction + i, i, (opcodeID == op_construct) ? Machine::cti_op_construct_JSConstruct : Machine::cti_op_call_JSFunction);
    27452754            // initialize the new call frame (pointed to by edx, after the last call).
    27462755            compileOpCallInitializeCallFrame(callee, argCount);
     
    27562765            m_jit.testl_rr(X86::eax, X86::eax);
    27572766            X86Assembler::JmpSrc hasCode = m_jit.emitUnlinkedJne();
    2758             emitCTICall(i, Machine::cti_vm_compile);
     2767            emitCTICall(instruction + i, i, Machine::cti_vm_compile);
    27592768            m_jit.link(hasCode, m_jit.label());
    27602769
     
    27672776            emitPutResult(dst);
    27682777
     2778#if ENABLE(CODEBLOCK_SAMPLING)
     2779            m_jit.movl_i32m(reinterpret_cast<unsigned>(m_codeBlock), m_machine->sampler()->codeBlockSlot());
     2780#endif
    27692781            ++callLinkInfoIndex;
     2782
    27702783            i += 7;
    27712784            break;
     
    27762789
    27772790            emitPutArg(X86::eax, 0);
    2778             emitCTICall(i, Machine::cti_op_to_jsnumber);
     2791            emitCTICall(instruction + i, i, Machine::cti_op_to_jsnumber);
    27792792
    27802793            emitPutResult(instruction[i + 1].u.operand);
     
    27972810void CTI::privateCompile()
    27982811{
     2812#if ENABLE(CODEBLOCK_SAMPLING)
     2813        m_jit.movl_i32m(reinterpret_cast<unsigned>(m_codeBlock), m_machine->sampler()->codeBlockSlot());
     2814#endif
     2815#if ENABLE(OPCODE_SAMPLING)
     2816        m_jit.movl_i32m(m_machine->sampler()->encodeSample(m_codeBlock->instructions.begin()), m_machine->sampler()->sampleSlot());
     2817#endif
     2818
    27992819    // Could use a popl_m, but would need to offset the following instruction if so.
    28002820    m_jit.popl_r(X86::ecx);
     
    28202840    if (m_codeBlock->codeType == FunctionCode) {
    28212841        m_jit.link(slowRegisterFileCheck, m_jit.label());
    2822         emitCTICall(0, Machine::cti_register_file_check);
     2842        emitCTICall(m_codeBlock->instructions.begin(), 0, Machine::cti_register_file_check);
    28232843        X86Assembler::JmpSrc backToBody = m_jit.emitUnlinkedJmp();
    28242844        m_jit.link(backToBody, afterRegisterFileCheck);
Note: See TracChangeset for help on using the changeset viewer.