Changeset 37891 in webkit for trunk/JavaScriptCore/VM


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.
Location:
trunk/JavaScriptCore/VM
Files:
10 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);
  • trunk/JavaScriptCore/VM/CTI.h

    r37845 r37891  
    267267        static const int repatchOffsetGetByIdBranchToSlowCase = 25;
    268268        static const int repatchOffsetGetByIdPropertyMapOffset = 34;
    269 #if ENABLE(SAMPLING_TOOL)
     269#if ENABLE(OPCODE_SAMPLING)
    270270        static const int repatchOffsetGetByIdSlowCaseCall = 27 + 4 + ctiArgumentInitSize;
    271271#else
     
    366366        void privateCompilePatchGetArrayLength(void* returnAddress);
    367367
    368         enum CompileOpCallType { OpCallNormal, OpCallEval, OpConstruct };
    369         void compileOpCall(Instruction* instruction, unsigned i, unsigned structureIDInstructionIndex, CompileOpCallType type = OpCallNormal);
     368        void compileOpCall(OpcodeID, Instruction* instruction, unsigned i, unsigned callLinkInfoIndex);
    370369        void compileOpCallInitializeCallFrame(unsigned callee, unsigned argCount);
    371370        void compileOpCallSetupArgs(Instruction* instruction, bool isConstruct, bool isEval);
     
    374373        void putDoubleResultToJSNumberCellOrJSImmediate(X86::XMMRegisterID xmmSource, X86::RegisterID jsNumberCell, unsigned dst, X86Assembler::JmpSrc* wroteJSNumberCell,  X86::XMMRegisterID tempXmm, X86::RegisterID tempReg1, X86::RegisterID tempReg2);
    375374        void compileBinaryArithOp(OpcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi, unsigned i);
    376         void compileBinaryArithOpSlowCase(OpcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi, unsigned i);
     375        void compileBinaryArithOpSlowCase(Instruction*, OpcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi, unsigned i);
    377376
    378377        void emitGetArg(int src, X86Assembler::RegisterID dst);
     
    412411        X86Assembler::JmpSrc emitNakedCall(unsigned opcodeIndex, X86::RegisterID);
    413412        X86Assembler::JmpSrc emitNakedCall(unsigned opcodeIndex, void(*function)());
    414         X86Assembler::JmpSrc emitCTICall(unsigned opcodeIndex, CTIHelper_j);
    415         X86Assembler::JmpSrc emitCTICall(unsigned opcodeIndex, CTIHelper_o);
    416         X86Assembler::JmpSrc emitCTICall(unsigned opcodeIndex, CTIHelper_p);
    417         X86Assembler::JmpSrc emitCTICall(unsigned opcodeIndex, CTIHelper_v);
    418         X86Assembler::JmpSrc emitCTICall(unsigned opcodeIndex, CTIHelper_s);
    419         X86Assembler::JmpSrc emitCTICall(unsigned opcodeIndex, CTIHelper_b);
    420         X86Assembler::JmpSrc emitCTICall(unsigned opcodeIndex, CTIHelper_2);
     413        X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned opcodeIndex, CTIHelper_j);
     414        X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned opcodeIndex, CTIHelper_o);
     415        X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned opcodeIndex, CTIHelper_p);
     416        X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned opcodeIndex, CTIHelper_v);
     417        X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned opcodeIndex, CTIHelper_s);
     418        X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned opcodeIndex, CTIHelper_b);
     419        X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned opcodeIndex, CTIHelper_2);
    421420
    422421        void emitGetVariableObjectRegister(X86Assembler::RegisterID variableObject, int index, X86Assembler::RegisterID dst);
    423422        void emitPutVariableObjectRegister(X86Assembler::RegisterID src, X86Assembler::RegisterID variableObject, int index);
    424423       
    425         void emitSlowScriptCheck(unsigned opcodeIndex);
     424        void emitSlowScriptCheck(Instruction*, unsigned opcodeIndex);
    426425#ifndef NDEBUG
    427426        void printOpcodeOperandTypes(unsigned src1, unsigned src2);
  • trunk/JavaScriptCore/VM/CodeBlock.cpp

    r37845 r37891  
    4040namespace JSC {
    4141
    42 #if !defined(NDEBUG) || ENABLE(SAMPLING_TOOL)
     42#if !defined(NDEBUG) || ENABLE(OPCODE_SAMPLING)
    4343
    4444static UString escapeQuotes(const UString& str)
     
    947947}
    948948
    949 #endif // !defined(NDEBUG) || ENABLE(SAMPLING_TOOL)
     949#endif // !defined(NDEBUG) || ENABLE(OPCODE_SAMPLING)
    950950
    951951CodeBlock::~CodeBlock()
     
    11111111int CodeBlock::lineNumberForVPC(const Instruction* vPC)
    11121112{
    1113     ASSERT(lineInfo.size());   
    11141113    unsigned instructionOffset = vPC - instructions.begin();
    11151114    ASSERT(instructionOffset < instructions.size());
    11161115
    11171116    if (!lineInfo.size())
    1118         return 1; // Empty function
     1117        return ownerNode->source().firstLine(); // Empty function
    11191118
    11201119    int low = 0;
     
    11271126            high = mid;
    11281127    }
     1128   
     1129    if (!low)
     1130        return ownerNode->source().firstLine();
    11291131    return lineInfo[low - 1].lineNumber;
    11301132}
  • trunk/JavaScriptCore/VM/CodeBlock.h

    r37845 r37891  
    290290        }
    291291
    292 #if !defined(NDEBUG) || ENABLE_SAMPLING_TOOL
     292#if !defined(NDEBUG) || ENABLE_OPCODE_SAMPLING
    293293        void dump(ExecState*) const;
    294294        void printStructureIDs(const Instruction*) const;
     
    362362
    363363    private:
    364 #if !defined(NDEBUG) || ENABLE(SAMPLING_TOOL)
     364#if !defined(NDEBUG) || ENABLE(OPCODE_SAMPLING)
    365365        void dump(ExecState*, const Vector<Instruction>::const_iterator& begin, Vector<Instruction>::const_iterator&) const;
    366366#endif
  • trunk/JavaScriptCore/VM/Machine.cpp

    r37845 r37891  
    924924        (*profiler)->willExecute(newCallFrame, programNode->sourceURL(), programNode->lineNo());
    925925
    926     m_reentryDepth++;
     926    JSValue* result;
     927    {
     928        SamplingTool::CallRecord callRecord(m_sampler);
     929
     930        m_reentryDepth++;
    927931#if ENABLE(CTI)
    928     if (!codeBlock->ctiCode)
    929         CTI::compile(this, newCallFrame, codeBlock);
    930     JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
     932        if (!codeBlock->ctiCode)
     933            CTI::compile(this, newCallFrame, codeBlock);
     934        result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
    931935#else
    932     JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
     936        result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
    933937#endif
    934     m_reentryDepth--;
    935 
    936     MACHINE_SAMPLING_privateExecuteReturned();
     938        m_reentryDepth--;
     939    }
    937940
    938941    if (*profiler)
     
    987990        (*profiler)->willExecute(newCallFrame, function);
    988991
    989     m_reentryDepth++;
     992    JSValue* result;
     993    {
     994        SamplingTool::CallRecord callRecord(m_sampler);
     995
     996        m_reentryDepth++;
    990997#if ENABLE(CTI)
    991     if (!codeBlock->ctiCode)
    992         CTI::compile(this, newCallFrame, codeBlock);
    993     JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
     998        if (!codeBlock->ctiCode)
     999            CTI::compile(this, newCallFrame, codeBlock);
     1000        result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
    9941001#else
    995     JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
     1002        result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
    9961003#endif
    997     m_reentryDepth--;
     1004        m_reentryDepth--;
     1005    }
    9981006
    9991007    if (*profiler)
    10001008        (*profiler)->didExecute(newCallFrame, function);
    1001 
    1002     MACHINE_SAMPLING_privateExecuteReturned();
    10031009
    10041010    m_registerFile.shrink(oldEnd);
     
    10761082        (*profiler)->willExecute(newCallFrame, evalNode->sourceURL(), evalNode->lineNo());
    10771083
    1078     m_reentryDepth++;
     1084    JSValue* result;
     1085    {
     1086        SamplingTool::CallRecord callRecord(m_sampler);
     1087
     1088        m_reentryDepth++;
    10791089#if ENABLE(CTI)
    1080     if (!codeBlock->ctiCode)
    1081         CTI::compile(this, newCallFrame, codeBlock);
    1082     JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
     1090        if (!codeBlock->ctiCode)
     1091            CTI::compile(this, newCallFrame, codeBlock);
     1092        result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
    10831093#else
    1084     JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
     1094        result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
    10851095#endif
    1086     m_reentryDepth--;
    1087 
    1088     MACHINE_SAMPLING_privateExecuteReturned();
     1096        m_reentryDepth--;
     1097    }
    10891098
    10901099    if (*profiler)
     
    14731482    } while (0)
    14741483
    1475 #if DUMP_OPCODE_STATS
     1484#if ENABLE(OPCODE_STATS)
    14761485    OpcodeStats::resetLastInstruction();
    14771486#endif
     
    14831492        tickCount = m_ticksUntilNextTimeoutCheck; \
    14841493    }
     1494   
     1495#if ENABLE(OPCODE_SAMPLING)
     1496    #define SAMPLE(codeBlock, vPC) m_sampler->sample(codeBlock, vPC)
     1497    #define CTI_SAMPLER ARG_globalData->machine->sampler()
     1498#else
     1499    #define SAMPLE(codeBlock, vPC)
     1500    #define CTI_SAMPLER
     1501#endif
    14851502
    14861503#if HAVE(COMPUTED_GOTO)
    1487     #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto *vPC->u.opcode
    1488 #if DUMP_OPCODE_STATS
     1504    #define NEXT_OPCODE SAMPLE(callFrame->codeBlock(), vPC); goto *vPC->u.opcode
     1505#if ENABLE(OPCODE_STATS)
    14891506    #define BEGIN_OPCODE(opcode) opcode: OpcodeStats::recordInstruction(opcode);
    14901507#else
     
    14931510    NEXT_OPCODE;
    14941511#else
    1495     #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto interpreterLoopStart
    1496 #if DUMP_OPCODE_STATS
     1512    #define NEXT_OPCODE SAMPLE(callFrame->codeBlock(), vPC); goto interpreterLoopStart
     1513#if ENABLE(OPCODE_STATS)
    14971514    #define BEGIN_OPCODE(opcode) case opcode: OpcodeStats::recordInstruction(opcode);
    14981515#else
     
    29592976           the JS timeout is reached.
    29602977         */
    2961 #if DUMP_OPCODE_STATS
     2978#if ENABLE(OPCODE_STATS)
    29622979        OpcodeStats::resetLastInstruction();
    29632980#endif
     
    29732990           instruction.
    29742991        */
    2975 #if DUMP_OPCODE_STATS
     2992#if ENABLE(OPCODE_STATS)
    29762993        OpcodeStats::resetLastInstruction();
    29772994#endif
     
    33543371            vPC = newCodeBlock->instructions.begin();
    33553372
    3356 #if DUMP_OPCODE_STATS
     3373#if ENABLE(OPCODE_STATS)
    33573374            OpcodeStats::resetLastInstruction();
    33583375#endif
     
    33693386            newCallFrame->init(0, vPC + 7, scopeChain, callFrame, dst, argCount, 0);
    33703387
    3371             MACHINE_SAMPLING_callingHostFunction();
    3372 
    3373             JSValue* returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args);
     3388            JSValue* returnValue;
     3389            {
     3390                SamplingTool::HostCallRecord callRecord(m_sampler);
     3391                returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args);
     3392            }
    33743393            VM_CHECK_EXCEPTION();
    33753394
     
    35993618            vPC = newCodeBlock->instructions.begin();
    36003619
    3601 #if DUMP_OPCODE_STATS
     3620#if ENABLE(OPCODE_STATS)
    36023621            OpcodeStats::resetLastInstruction();
    36033622#endif
     
    36133632            newCallFrame->init(0, vPC + 7, scopeChain, callFrame, dst, argCount, 0);
    36143633
    3615             MACHINE_SAMPLING_callingHostFunction();
    3616 
    3617             JSValue* returnValue = constructData.native.function(newCallFrame, asObject(v), args);
    3618 
     3634            JSValue* returnValue;
     3635            {
     3636                SamplingTool::HostCallRecord callRecord(m_sampler);
     3637                returnValue = constructData.native.function(newCallFrame, asObject(v), args);
     3638            }
    36193639            VM_CHECK_EXCEPTION();
    36203640            callFrame[dst] = returnValue;
     
    47954815        ArgList argList(argv + 1, argCount - 1);
    47964816
    4797         CTI_MACHINE_SAMPLING_callingHostFunction();
    4798 
    4799         JSValue* returnValue = callData.native.function(callFrame, asObject(funcVal), argv[0].jsValue(callFrame), argList);
     4817        JSValue* returnValue;
     4818        {
     4819            SamplingTool::HostCallRecord callRecord(CTI_SAMPLER);
     4820            returnValue = callData.native.function(callFrame, asObject(funcVal), argv[0].jsValue(callFrame), argList);
     4821        }
    48004822        ARG_setCallFrame(previousCallFrame);
    48014823        VM_CHECK_EXCEPTION();
     
    50005022        ArgList argList(callFrame->registers() + firstArg + 1, argCount - 1);
    50015023
    5002         CTI_MACHINE_SAMPLING_callingHostFunction();
    5003 
    5004         JSValue* returnValue = constructData.native.function(callFrame, asObject(constrVal), argList);
     5024        JSValue* returnValue;
     5025        {
     5026            SamplingTool::HostCallRecord callRecord(CTI_SAMPLER);
     5027            returnValue = constructData.native.function(callFrame, asObject(constrVal), argList);
     5028        }
    50055029        VM_CHECK_EXCEPTION();
    50065030
  • trunk/JavaScriptCore/VM/Machine.h

    r37845 r37891  
    158158        }
    159159
    160         SamplingTool* m_sampler;
     160        void setSampler(SamplingTool* sampler) { m_sampler = sampler; }
     161        SamplingTool* sampler() { return m_sampler; }
    161162
    162163#if ENABLE(CTI)
     
    319320        void* getCTIStringLengthTrampoline(CallFrame*, CodeBlock*);
    320321
     322        JITCodeBuffer* jitCodeBuffer() const { return m_jitCodeBuffer.get(); }
     323#endif
     324
     325        SamplingTool* m_sampler;
     326
     327#if ENABLE(CTI)
    321328        void* m_ctiArrayLengthTrampoline;
    322329        void* m_ctiStringLengthTrampoline;
    323330
    324331        OwnPtr<JITCodeBuffer> m_jitCodeBuffer;
    325         JITCodeBuffer* jitCodeBuffer() const { return m_jitCodeBuffer.get(); }
    326332#endif
    327333
  • trunk/JavaScriptCore/VM/Opcode.cpp

    r36263 r37891  
    3535namespace JSC {
    3636
    37 #if ENABLE(SAMPLING_TOOL) || DUMP_OPCODE_STATS
     37#if ENABLE(OPCODE_SAMPLING) || ENABLE(CODEBLOCK_SAMPLING) || ENABLE(OPCODE_STATS)
    3838
    3939const char* const opcodeNames[] = {
     
    4545#endif
    4646
    47 #if DUMP_OPCODE_STATS
     47#if ENABLE(OPCODE_STATS)
    4848
    4949long long OpcodeStats::opcodeCounts[numOpcodeIDs];
     
    122122    for (int i = 0; i < numOpcodeIDs; ++i) {
    123123        int index = sortedIndices[i];
    124         printf("%s:%s %lld - %.2f%%\n", opcodeNames[index], padOpcodeName((OpcodeID)index, 24), opcodeCounts[index], ((double) opcodeCounts[index]) / ((double) totalInstructions) * 100.0);   
     124        printf("%s:%s %lld - %.2f%%\n", opcodeNames[index], padOpcodeName((OpcodeID)index, 28), opcodeCounts[index], ((double) opcodeCounts[index]) / ((double) totalInstructions) * 100.0);   
    125125    }
    126126   
     
    135135            break;
    136136       
    137         printf("%s%s %s:%s %lld %.2f%%\n", opcodeNames[indexPair.first], padOpcodeName((OpcodeID)indexPair.first, 24), opcodeNames[indexPair.second], padOpcodeName((OpcodeID)indexPair.second, 24), count, ((double) count) / ((double) totalInstructionPairs) * 100.0);
     137        printf("%s%s %s:%s %lld %.2f%%\n", opcodeNames[indexPair.first], padOpcodeName((OpcodeID)indexPair.first, 28), opcodeNames[indexPair.second], padOpcodeName((OpcodeID)indexPair.second, 28), count, ((double) count) / ((double) totalInstructionPairs) * 100.0);
    138138    }
    139139   
     
    147147        if (opcodeProportion < 0.0001)
    148148            break;
    149         printf("\n%s:%s %lld - %.2f%%\n", opcodeNames[index], padOpcodeName((OpcodeID)index, 24), opcodeCount, opcodeProportion * 100.0);
     149        printf("\n%s:%s %lld - %.2f%%\n", opcodeNames[index], padOpcodeName((OpcodeID)index, 28), opcodeCount, opcodeProportion * 100.0);
    150150
    151151        for (int j = 0; j < numOpcodeIDs * numOpcodeIDs; ++j) {
     
    160160                continue;
    161161
    162             printf("    %s%s %s:%s %lld - %.2f%%\n", opcodeNames[indexPair.first], padOpcodeName((OpcodeID)indexPair.first, 24), opcodeNames[indexPair.second], padOpcodeName((OpcodeID)indexPair.second, 24), pairCount, pairProportion * 100.0);
     162            printf("    %s%s %s:%s %lld - %.2f%%\n", opcodeNames[indexPair.first], padOpcodeName((OpcodeID)indexPair.first, 28), opcodeNames[indexPair.second], padOpcodeName((OpcodeID)indexPair.second, 28), pairCount, pairProportion * 100.0);
    163163        }
    164164       
  • trunk/JavaScriptCore/VM/Opcode.h

    r37789 r37891  
    3838namespace JSC {
    3939
    40 #define DUMP_OPCODE_STATS 0
    41 
    4240    #define FOR_EACH_OPCODE_ID(macro) \
    4341        macro(op_enter) \
     
    183181#endif
    184182
    185 #if ENABLE(SAMPLING_TOOL) || DUMP_OPCODE_STATS
     183#if ENABLE(OPCODE_SAMPLING) || ENABLE(CODEBLOCK_SAMPLING) || ENABLE(OPCODE_STATS)
    186184
    187185#define PADDING_STRING "                                "
     
    202200#endif
    203201
    204 #if DUMP_OPCODE_STATS
     202#if ENABLE(OPCODE_STATS)
    205203
    206204    struct OpcodeStats {
  • trunk/JavaScriptCore/VM/SamplingTool.cpp

    r36402 r37891  
    4242void ScopeSampleRecord::sample(CodeBlock* codeBlock, Instruction* vPC)
    4343{
    44     m_totalCount++;
    45 
    4644    if (!m_vpcCounts) {
    4745        m_size = codeBlock->instructions.size();
     
    5048    }
    5149
    52     unsigned codeOffset = static_cast<unsigned>(reinterpret_cast<ptrdiff_t>(vPC) - reinterpret_cast<ptrdiff_t>(codeBlock->instructions.begin())) / sizeof(Instruction*);
    53     // This could occur if codeBlock & vPC are not consistent - e.g. sample mid op_call/op_ret.
    54     if (codeOffset < m_size)
     50    unsigned codeOffset = vPC - codeBlock->instructions.begin();
     51    // Since we don't read and write codeBlock and vPC atomically, this check
     52    // can fail if we sample mid op_call / op_ret.
     53    if (codeOffset < m_size) {
    5554        m_vpcCounts[codeOffset]++;
     55        m_totalCount++;
     56    }
    5657}
    5758
     
    8081}
    8182
    82 #if ENABLE(SAMPLING_TOOL)
    83 unsigned totalOpcodeIDCount = 0;
    84 unsigned opcodeIDCountInCalledCode[numOpcodeIDs] = {0};
    85 unsigned opcodeIDCountInJITCode[numOpcodeIDs] = {0};
    86 #endif
    87 
    8883void SamplingTool::run()
    8984{
     
    9186        sleepForMicroseconds(hertz2us(m_hertz));
    9287
    93         m_totalSamples++;
    94 #if ENABLE(SAMPLING_TOOL)
    95         if (currentOpcodeID != static_cast<OpcodeID>(-1)) {
    96             ++totalOpcodeIDCount;
    97             if (inCalledCode)
    98                 opcodeIDCountInCalledCode[currentOpcodeID]++;
    99             else
    100                 opcodeIDCountInJITCode[currentOpcodeID]++;
     88        Sample sample(m_sample, m_codeBlock);
     89        ++m_sampleCount;
     90
     91        if (sample.isNull())
     92            continue;
     93
     94        if (!sample.inHostFunction()) {
     95            unsigned opcodeID = m_machine->getOpcodeID(sample.vPC()[0].u.opcode);
     96
     97            ++m_opcodeSampleCount;
     98            ++m_opcodeSamples[opcodeID];
     99
     100            if (sample.inCTIFunction())
     101                m_opcodeSamplesInCTIFunctions[opcodeID]++;
    101102        }
    102 #endif       
    103         CodeBlock* codeBlock = m_recordedCodeBlock;
    104         Instruction* vPC = m_recordedVPC;
    105 
    106         if (codeBlock && vPC) {
    107             if (ScopeSampleRecord* record = m_scopeSampleMap->get(codeBlock->ownerNode))
    108                 record->sample(codeBlock, vPC);
    109         }
     103
     104#if ENABLE(CODEBLOCK_SAMPLING)
     105        ScopeSampleRecord* record = m_scopeSampleMap->get(sample.codeBlock()->ownerNode);
     106        ASSERT(record);
     107        record->sample(sample.codeBlock(), sample.vPC());
     108#endif
    110109    }
    111110}
     
    138137}
    139138
    140 #if ENABLE(SAMPLING_TOOL)
     139#if ENABLE(OPCODE_SAMPLING)
    141140
    142141struct OpcodeSampleInfo {
    143142    OpcodeID opcode;
    144143    long long count;
    145     long long countInCalledCode;
     144    long long countInCTIFunctions;
    146145};
    147146
     
    178177{
    179178    // Tidies up SunSpider output by removing short scripts - such a small number of samples would likely not be useful anyhow.
    180     if (m_totalSamples < 10)
     179    if (m_sampleCount < 10)
    181180        return;
    182181   
    183     // (1) Calculate 'totalCodeBlockSamples', build and sort 'codeBlockSamples' array.
     182    // (1) Build and sort 'opcodeSampleInfo' array.
     183
     184    OpcodeSampleInfo opcodeSampleInfo[numOpcodeIDs];
     185    for (int i = 0; i < numOpcodeIDs; ++i) {
     186        opcodeSampleInfo[i].opcode = static_cast<OpcodeID>(i);
     187        opcodeSampleInfo[i].count = m_opcodeSamples[i];
     188        opcodeSampleInfo[i].countInCTIFunctions = m_opcodeSamplesInCTIFunctions[i];
     189    }
     190
     191    qsort(opcodeSampleInfo, numOpcodeIDs, sizeof(OpcodeSampleInfo), compareOpcodeIndicesSampling);
     192
     193    // (2) Print Opcode sampling results.
     194
     195    printf("\nOpcode samples [*]\n");
     196    printf("                             sample   %% of       %% of     |   cti     cti %%\n");
     197    printf("opcode                       count     VM        total    |  count   of self\n");
     198    printf("-------------------------------------------------------   |  ----------------\n");
     199
     200    for (int i = 0; i < numOpcodeIDs; ++i) {
     201        long long count = opcodeSampleInfo[i].count;
     202        if (!count)
     203            continue;
     204
     205        OpcodeID opcode = opcodeSampleInfo[i].opcode;
     206       
     207        const char* opcodeName = opcodeNames[opcode];
     208        const char* opcodePadding = padOpcodeName(opcode, 28);
     209        double percentOfVM = (static_cast<double>(count) * 100) / m_opcodeSampleCount;
     210        double percentOfTotal = (static_cast<double>(count) * 100) / m_sampleCount;
     211        long long countInCTIFunctions = opcodeSampleInfo[i].countInCTIFunctions;
     212        double percentInCTIFunctions = (static_cast<double>(countInCTIFunctions) * 100) / count;
     213        fprintf(stdout, "%s:%s%-6lld %.3f%%\t%.3f%%\t  |   %-6lld %.3f%%\n", opcodeName, opcodePadding, count, percentOfVM, percentOfTotal, countInCTIFunctions, percentInCTIFunctions);
     214    }
     215   
     216    printf("\n[*] Samples inside host code are not charged to any Opcode.\n\n");
     217    printf("\tSamples inside VM:\t\t%lld / %lld (%.3f%%)\n", m_opcodeSampleCount, m_sampleCount, (static_cast<double>(m_opcodeSampleCount) * 100) / m_sampleCount);
     218    printf("\tSamples inside host code:\t%lld / %lld (%.3f%%)\n\n", m_sampleCount - m_opcodeSampleCount, m_sampleCount, (static_cast<double>(m_sampleCount - m_opcodeSampleCount) * 100) / m_sampleCount);
     219    printf("\tsample count:\tsamples inside this opcode\n");
     220    printf("\t%% of VM:\tsample count / all opcode samples\n");
     221    printf("\t%% of total:\tsample count / all samples\n");
     222    printf("\t--------------\n");
     223    printf("\tcti count:\tsamples inside a CTI function called by this opcode\n");
     224    printf("\tcti %% of self:\tcti count / sample count\n");
     225   
     226    // (3) Calculate 'codeBlockSampleCount', build and sort 'codeBlockSamples' array.
    184227
    185228    int scopeCount = m_scopeSampleMap->size();
    186     long long totalCodeBlockSamples = 0;
     229    long long codeBlockSampleCount = 0;
    187230    Vector<ScopeSampleRecord*> codeBlockSamples(scopeCount);
    188231    ScopeSampleRecordMap::iterator iter = m_scopeSampleMap->begin();
    189232    for (int i = 0; i < scopeCount; ++i, ++iter) {
    190233        codeBlockSamples[i] = iter->second;
    191         totalCodeBlockSamples += codeBlockSamples[i]->m_totalCount;
     234        codeBlockSampleCount += codeBlockSamples[i]->m_totalCount;
    192235    }
    193236
    194237    qsort(codeBlockSamples.begin(), scopeCount, sizeof(ScopeSampleRecord*), compareScopeSampleRecords);
    195238
    196     // (2) Print data from 'codeBlockSamples' array, calculate 'totalOpcodeSamples', populate 'opcodeSampleCounts' array.
    197 
    198     long long totalOpcodeSamples = 0;
    199     long long opcodeSampleCounts[numOpcodeIDs] = { 0 };
    200 
    201     printf("\nBlock sampling results\n\n");
    202     printf("Total blocks sampled (total samples): %lld (%lld)\n\n", totalCodeBlockSamples, m_totalSamples);
     239    // (4) Print data from 'codeBlockSamples' array.
     240
     241    printf("\nCodeBlock samples [*]\n\n");
    203242
    204243    for (int i = 0; i < scopeCount; ++i) {
     
    206245        CodeBlock* codeBlock = record->m_codeBlock;
    207246
    208         double totalPercent = (record->m_totalCount * 100.0)/m_totalSamples;
    209         double blockPercent = (record->m_totalCount * 100.0)/totalCodeBlockSamples;
    210 
    211         if ((blockPercent >= 1) && codeBlock) {
     247        double blockPercent = (record->m_totalCount * 100.0) / codeBlockSampleCount;
     248
     249        if (blockPercent >= 1) {
    212250            Instruction* code = codeBlock->instructions.begin();
    213             printf("#%d: %s:%d: sampled %d times - %.3f%% (%.3f%%)\n", i + 1, record->m_scope->sourceURL().UTF8String().c_str(), codeBlock->lineNumberForVPC(code), record->m_totalCount, blockPercent, totalPercent);
     251            printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_scope->sourceURL().UTF8String().c_str(), codeBlock->lineNumberForVPC(code), record->m_totalCount, codeBlockSampleCount, blockPercent);
    214252            if (i < 10) {
    215253                HashMap<unsigned,unsigned> lineCounts;
     
    240278            }
    241279        }
    242        
    243         if (record->m_vpcCounts && codeBlock) {
    244             Instruction* instructions = codeBlock->instructions.begin();
    245             for (unsigned op = 0; op < record->m_size; ++op) {
    246                 Opcode opcode = instructions[op].u.opcode;
    247                 if (exec->machine()->isOpcode(opcode)) {
    248                     totalOpcodeSamples += record->m_vpcCounts[op];
    249                     opcodeSampleCounts[exec->machine()->getOpcodeID(opcode)] += record->m_vpcCounts[op];
    250                 }
    251             }
    252         }
    253     }
    254     printf("\n");
    255 
    256     // (3) Build and sort 'opcodeSampleInfo' array.
    257 
    258     OpcodeSampleInfo opcodeSampleInfo[numOpcodeIDs];
    259     for (int i = 0; i < numOpcodeIDs; ++i) {
    260         opcodeSampleInfo[i].opcode = static_cast<OpcodeID>(i);
    261         opcodeSampleInfo[i].count = opcodeIDCountInJITCode[i] + opcodeIDCountInCalledCode[i];
    262         opcodeSampleInfo[i].countInCalledCode = opcodeIDCountInCalledCode[i];
    263     }
    264 
    265     qsort(opcodeSampleInfo, numOpcodeIDs, sizeof(OpcodeSampleInfo), compareOpcodeIndicesSampling);
    266 
    267     // (4) Print Opcode sampling results.
    268 
    269     printf("\nOpcode sampling results\n\n");
    270 
    271     for (int i = 0; i < numOpcodeIDs; ++i) {
    272         OpcodeID opcode = opcodeSampleInfo[i].opcode;
    273         long long count = opcodeSampleInfo[i].count;
    274         long long countInCalledCode = opcodeSampleInfo[i].countInCalledCode;
    275         fprintf(stdout, "%s:%s%6lld\t%6lld\t%.3f%%\t%.3f%%\t(%.3f%%)\n", opcodeNames[opcode], padOpcodeName(opcode, 20), count, countInCalledCode, (static_cast<double>(count) * 100) / totalOpcodeIDCount, (static_cast<double>(count) * 100) / m_totalSamples, (static_cast<double>(countInCalledCode) * 100) / m_totalSamples);   
    276     }
    277     printf("\n");
     280    }
     281
     282    printf("\n[*] Samples inside host code are charged to the calling Opcode.\n");
     283    printf("    Samples that fall on a call / return boundary are discarded.\n\n");
     284    printf("\tSamples discarded:\t\t%lld / %lld (%.3f%%)\n\n", m_sampleCount - codeBlockSampleCount, m_sampleCount, (static_cast<double>(m_sampleCount - codeBlockSampleCount) * 100) / m_sampleCount);
    278285}
    279286
  • trunk/JavaScriptCore/VM/SamplingTool.h

    r37316 r37891  
    3434#include <wtf/Threading.h>
    3535
    36 #include <nodes.h>
    37 #include <Opcode.h>
     36#include "nodes.h"
     37#include "Opcode.h"
    3838
    3939namespace JSC {
    4040
     41    class CodeBlock;
    4142    class ExecState;
     43    class Machine;
    4244    class ScopeNode;
    43     class CodeBlock;
    4445    struct Instruction;
    45 
    46 #if ENABLE(SAMPLING_TOOL)
    47     extern OpcodeID currentOpcodeID;
    48     extern unsigned inCalledCode;
    49 #endif
    5046
    5147    struct ScopeSampleRecord {
     
    7167        }
    7268       
    73         void sample(CodeBlock* codeBlock, Instruction* vPC);
     69        void sample(CodeBlock*, Instruction*);
    7470    };
    7571
     
    7874    class SamplingTool {
    7975    public:
    80         SamplingTool()
    81             : m_running(false)
    82             , m_recordedCodeBlock(0)
    83             , m_recordedVPC(0)
    84             , m_totalSamples(0)
     76        friend class CallRecord;
     77        friend class HostCallRecord;
     78       
     79#if ENABLE(OPCODE_SAMPLING)
     80        class CallRecord : Noncopyable {
     81        public:
     82            CallRecord(SamplingTool* samplingTool)
     83                : m_samplingTool(samplingTool)
     84                , m_savedSample(samplingTool->m_sample)
     85                , m_savedCodeBlock(samplingTool->m_codeBlock)
     86            {
     87            }
     88
     89            ~CallRecord()
     90            {
     91                m_samplingTool->m_sample = m_savedSample;
     92                m_samplingTool->m_codeBlock = m_savedCodeBlock;
     93            }
     94
     95        private:
     96            SamplingTool* m_samplingTool;
     97            intptr_t m_savedSample;
     98            CodeBlock* m_savedCodeBlock;
     99        };
     100       
     101        class HostCallRecord : public CallRecord {
     102        public:
     103            HostCallRecord(SamplingTool* samplingTool)
     104                : CallRecord(samplingTool)
     105            {
     106                samplingTool->m_sample |= 0x1;
     107            }
     108        };
     109#else
     110        class CallRecord : Noncopyable {
     111        public:
     112            CallRecord(SamplingTool*)
     113            {
     114            }
     115        };
     116
     117        class HostCallRecord : public CallRecord {
     118        public:
     119            HostCallRecord(SamplingTool* samplingTool)
     120                : CallRecord(samplingTool)
     121            {
     122            }
     123        };
     124#endif       
     125
     126        SamplingTool(Machine* machine)
     127            : m_machine(machine)
     128            , m_running(false)
     129            , m_codeBlock(0)
     130            , m_sample(0)
     131            , m_sampleCount(0)
     132            , m_opcodeSampleCount(0)
    85133            , m_scopeSampleMap(new ScopeSampleRecordMap())
    86134        {
     135            memset(m_opcodeSamples, 0, sizeof(m_opcodeSamples));
     136            memset(m_opcodeSamplesInCTIFunctions, 0, sizeof(m_opcodeSamplesInCTIFunctions));
    87137        }
    88138
     
    98148        void notifyOfScope(ScopeNode* scope);
    99149
    100         void sample(CodeBlock* recordedCodeBlock, Instruction* recordedVPC)
    101         {
    102             m_recordedCodeBlock = recordedCodeBlock;
    103             m_recordedVPC = recordedVPC;
    104         }
    105 
    106         void privateExecuteReturned()
    107         {
    108             m_recordedCodeBlock = 0;
    109             m_recordedVPC = 0;
    110 #if ENABLE(SAMPLING_TOOL)
    111             currentOpcodeID = static_cast<OpcodeID>(-1);
    112 #endif
    113         }
    114        
    115         void callingHostFunction()
    116         {
    117             m_recordedCodeBlock = 0;
    118             m_recordedVPC = 0;
    119 #if ENABLE(SAMPLING_TOOL)
    120             currentOpcodeID = static_cast<OpcodeID>(-1);
    121 #endif
     150        void sample(CodeBlock* codeBlock, Instruction* vPC)
     151        {
     152            ASSERT(!(reinterpret_cast<intptr_t>(vPC) & 0x3));
     153            m_codeBlock = codeBlock;
     154            m_sample = reinterpret_cast<intptr_t>(vPC);
     155        }
     156
     157        CodeBlock** codeBlockSlot() { return &m_codeBlock; }
     158        intptr_t* sampleSlot() { return &m_sample; }
     159
     160        unsigned encodeSample(Instruction* vPC, bool inCTIFunction = false, bool inHostFunction = false)
     161        {
     162            ASSERT(!(reinterpret_cast<intptr_t>(vPC) & 0x3));
     163            return reinterpret_cast<intptr_t>(vPC) | (inCTIFunction << 1) | inHostFunction;
    122164        }
    123165
    124166    private:
     167        class Sample {
     168        public:
     169            Sample(volatile intptr_t sample, CodeBlock* volatile codeBlock)
     170                : m_sample(sample)
     171                , m_codeBlock(codeBlock)
     172            {
     173            }
     174           
     175            bool isNull() { return !m_sample || !m_codeBlock; }
     176            CodeBlock* codeBlock() { return m_codeBlock; }
     177            Instruction* vPC() { return reinterpret_cast<Instruction*>(m_sample & ~0x3); }
     178            bool inHostFunction() { return m_sample & 0x1; }
     179            bool inCTIFunction() { return m_sample & 0x2; }
     180
     181        private:
     182            intptr_t m_sample;
     183            CodeBlock* m_codeBlock;
     184        };
     185       
    125186        static void* threadStartFunc(void*);
    126187        void run();
     188       
     189        Machine* m_machine;
    127190       
    128191        // Sampling thread state.
     
    132195
    133196        // State tracked by the main thread, used by the sampling thread.
    134         CodeBlock* m_recordedCodeBlock;
    135         Instruction* m_recordedVPC;
     197        CodeBlock* m_codeBlock;
     198        intptr_t m_sample;
    136199
    137200        // Gathered sample data.
    138         long long m_totalSamples;
     201        long long m_sampleCount;
     202        long long m_opcodeSampleCount;
     203        unsigned m_opcodeSamples[numOpcodeIDs];
     204        unsigned m_opcodeSamplesInCTIFunctions[numOpcodeIDs];
    139205        OwnPtr<ScopeSampleRecordMap> m_scopeSampleMap;
    140206    };
    141207
    142 // SCOPENODE_ / MACHINE_ macros for use from within member methods on ScopeNode / Machine respectively.
    143 #if ENABLE(SAMPLING_TOOL)
    144 #define SCOPENODE_SAMPLING_notifyOfScope(sampler) sampler->notifyOfScope(this)
    145 #define MACHINE_SAMPLING_sample(codeBlock, vPC) m_sampler->sample(codeBlock, vPC)
    146 #define MACHINE_SAMPLING_privateExecuteReturned() m_sampler->privateExecuteReturned()
    147 #define MACHINE_SAMPLING_callingHostFunction() m_sampler->callingHostFunction()
    148 #define CTI_MACHINE_SAMPLING_callingHostFunction() ARG_globalData->machine->m_sampler->callingHostFunction()
    149 #else
    150 #define SCOPENODE_SAMPLING_notifyOfScope(sampler)
    151 #define MACHINE_SAMPLING_sample(codeBlock, vPC)
    152 #define MACHINE_SAMPLING_privateExecuteReturned()
    153 #define MACHINE_SAMPLING_callingHostFunction()
    154 #define CTI_MACHINE_SAMPLING_callingHostFunction()
    155 #endif
    156 
    157208} // namespace JSC
    158209
Note: See TracChangeset for help on using the changeset viewer.