Ignore:
Timestamp:
Nov 15, 2008, 12:34:40 PM (17 years ago)
Author:
[email protected]
Message:

2008-11-15 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.


Renamed all forms of "byte code" "opcode" "op code" "code" "bitcode"
etc. to "bytecode".

  • VM/CTI.cpp: (JSC::CTI::printBytecodeOperandTypes): (JSC::CTI::emitAllocateNumber): (JSC::CTI::emitNakedCall): (JSC::CTI::emitNakedFastCall): (JSC::CTI::emitCTICall): (JSC::CTI::emitJumpSlowCaseIfNotJSCell): (JSC::CTI::emitJumpSlowCaseIfNotImmNum): (JSC::CTI::emitJumpSlowCaseIfNotImmNums): (JSC::CTI::emitFastArithIntToImmOrSlowCase): (JSC::CTI::compileOpCall): (JSC::CTI::emitSlowScriptCheck): (JSC::CTI::compileBinaryArithOp): (JSC::CTI::compileBinaryArithOpSlowCase): (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases): (JSC::CTI::privateCompile):
  • VM/CTI.h: (JSC::CallRecord::CallRecord): (JSC::SwitchRecord::SwitchRecord):
  • VM/CodeBlock.cpp: (JSC::CodeBlock::printStructureIDs): (JSC::CodeBlock::dump): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::derefStructureIDs): (JSC::CodeBlock::refStructureIDs):
  • VM/CodeBlock.h: (JSC::StructureStubInfo::StructureStubInfo):
  • VM/ExceptionHelpers.cpp: (JSC::createNotAnObjectError):
  • VM/Instruction.h: (JSC::Instruction::Instruction): (JSC::Instruction::):
  • VM/Machine.cpp: (JSC::BytecodeInterpreter::isBytecode): (JSC::BytecodeInterpreter::throwException): (JSC::BytecodeInterpreter::execute): (JSC::BytecodeInterpreter::tryCachePutByID): (JSC::BytecodeInterpreter::uncachePutByID): (JSC::BytecodeInterpreter::tryCacheGetByID): (JSC::BytecodeInterpreter::uncacheGetByID): (JSC::BytecodeInterpreter::privateExecute): (JSC::BytecodeInterpreter::tryCTICachePutByID): (JSC::BytecodeInterpreter::tryCTICacheGetByID): (JSC::BytecodeInterpreter::cti_op_call_JSFunction): (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall): (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall):
  • VM/Machine.h: (JSC::BytecodeInterpreter::getBytecode): (JSC::BytecodeInterpreter::getBytecodeID): (JSC::BytecodeInterpreter::isCallBytecode):
  • VM/Opcode.cpp: (JSC::): (JSC::BytecodeStats::BytecodeStats): (JSC::compareBytecodeIndices): (JSC::compareBytecodePairIndices): (JSC::BytecodeStats::~BytecodeStats): (JSC::BytecodeStats::recordInstruction): (JSC::BytecodeStats::resetLastInstruction):
  • VM/Opcode.h: (JSC::): (JSC::padBytecodeName):
  • VM/SamplingTool.cpp: (JSC::ScopeSampleRecord::sample): (JSC::SamplingTool::run): (JSC::compareBytecodeIndicesSampling): (JSC::SamplingTool::dump):
  • VM/SamplingTool.h: (JSC::ScopeSampleRecord::ScopeSampleRecord): (JSC::SamplingTool::SamplingTool):
  • bytecompiler/CodeGenerator.cpp: (JSC::CodeGenerator::generate): (JSC::CodeGenerator::CodeGenerator): (JSC::CodeGenerator::emitLabel): (JSC::CodeGenerator::emitBytecode): (JSC::CodeGenerator::emitJump): (JSC::CodeGenerator::emitJumpIfTrue): (JSC::CodeGenerator::emitJumpIfFalse): (JSC::CodeGenerator::emitMove): (JSC::CodeGenerator::emitUnaryOp): (JSC::CodeGenerator::emitPreInc): (JSC::CodeGenerator::emitPreDec): (JSC::CodeGenerator::emitPostInc): (JSC::CodeGenerator::emitPostDec): (JSC::CodeGenerator::emitBinaryOp): (JSC::CodeGenerator::emitEqualityOp): (JSC::CodeGenerator::emitUnexpectedLoad): (JSC::CodeGenerator::emitInstanceOf): (JSC::CodeGenerator::emitResolve): (JSC::CodeGenerator::emitGetScopedVar): (JSC::CodeGenerator::emitPutScopedVar): (JSC::CodeGenerator::emitResolveBase): (JSC::CodeGenerator::emitResolveWithBase): (JSC::CodeGenerator::emitResolveFunction): (JSC::CodeGenerator::emitGetById): (JSC::CodeGenerator::emitPutById): (JSC::CodeGenerator::emitPutGetter): (JSC::CodeGenerator::emitPutSetter): (JSC::CodeGenerator::emitDeleteById): (JSC::CodeGenerator::emitGetByVal): (JSC::CodeGenerator::emitPutByVal): (JSC::CodeGenerator::emitDeleteByVal): (JSC::CodeGenerator::emitPutByIndex): (JSC::CodeGenerator::emitNewObject): (JSC::CodeGenerator::emitNewArray): (JSC::CodeGenerator::emitNewFunction): (JSC::CodeGenerator::emitNewRegExp): (JSC::CodeGenerator::emitNewFunctionExpression): (JSC::CodeGenerator::emitCall): (JSC::CodeGenerator::emitReturn): (JSC::CodeGenerator::emitUnaryNoDstOp): (JSC::CodeGenerator::emitConstruct): (JSC::CodeGenerator::emitPopScope): (JSC::CodeGenerator::emitDebugHook): (JSC::CodeGenerator::emitComplexJumpScopes): (JSC::CodeGenerator::emitJumpScopes): (JSC::CodeGenerator::emitNextPropertyName): (JSC::CodeGenerator::emitCatch): (JSC::CodeGenerator::emitNewError): (JSC::CodeGenerator::emitJumpSubroutine): (JSC::CodeGenerator::emitSubroutineReturn): (JSC::CodeGenerator::emitPushNewScope): (JSC::CodeGenerator::beginSwitch): (JSC::CodeGenerator::endSwitch):
  • bytecompiler/CodeGenerator.h: (JSC::CodeGenerator::emitNode):
  • jsc.cpp: (runWithScripts):
  • masm/X86Assembler.h: (JSC::X86Assembler::): (JSC::X86Assembler::emitModRm_opr): (JSC::X86Assembler::emitModRm_opr_Unchecked): (JSC::X86Assembler::emitModRm_opm): (JSC::X86Assembler::emitModRm_opm_Unchecked): (JSC::X86Assembler::emitModRm_opmsib):
  • parser/Nodes.cpp: (JSC::NullNode::emitBytecode): (JSC::BooleanNode::emitBytecode): (JSC::NumberNode::emitBytecode): (JSC::StringNode::emitBytecode): (JSC::RegExpNode::emitBytecode): (JSC::ThisNode::emitBytecode): (JSC::ResolveNode::emitBytecode): (JSC::ArrayNode::emitBytecode): (JSC::ObjectLiteralNode::emitBytecode): (JSC::PropertyListNode::emitBytecode): (JSC::BracketAccessorNode::emitBytecode): (JSC::DotAccessorNode::emitBytecode): (JSC::ArgumentListNode::emitBytecode): (JSC::NewExprNode::emitBytecode): (JSC::EvalFunctionCallNode::emitBytecode): (JSC::FunctionCallValueNode::emitBytecode): (JSC::FunctionCallResolveNode::emitBytecode): (JSC::FunctionCallBracketNode::emitBytecode): (JSC::FunctionCallDotNode::emitBytecode): (JSC::PostfixResolveNode::emitBytecode): (JSC::PostfixBracketNode::emitBytecode): (JSC::PostfixDotNode::emitBytecode): (JSC::PostfixErrorNode::emitBytecode): (JSC::DeleteResolveNode::emitBytecode): (JSC::DeleteBracketNode::emitBytecode): (JSC::DeleteDotNode::emitBytecode): (JSC::DeleteValueNode::emitBytecode): (JSC::VoidNode::emitBytecode): (JSC::TypeOfResolveNode::emitBytecode): (JSC::TypeOfValueNode::emitBytecode): (JSC::PrefixResolveNode::emitBytecode): (JSC::PrefixBracketNode::emitBytecode): (JSC::PrefixDotNode::emitBytecode): (JSC::PrefixErrorNode::emitBytecode): (JSC::UnaryOpNode::emitBytecode): (JSC::BinaryOpNode::emitBytecode): (JSC::EqualNode::emitBytecode): (JSC::StrictEqualNode::emitBytecode): (JSC::ReverseBinaryOpNode::emitBytecode): (JSC::ThrowableBinaryOpNode::emitBytecode): (JSC::InstanceOfNode::emitBytecode): (JSC::LogicalOpNode::emitBytecode): (JSC::ConditionalNode::emitBytecode): (JSC::emitReadModifyAssignment): (JSC::ReadModifyResolveNode::emitBytecode): (JSC::AssignResolveNode::emitBytecode): (JSC::AssignDotNode::emitBytecode): (JSC::ReadModifyDotNode::emitBytecode): (JSC::AssignErrorNode::emitBytecode): (JSC::AssignBracketNode::emitBytecode): (JSC::ReadModifyBracketNode::emitBytecode): (JSC::CommaNode::emitBytecode): (JSC::ConstDeclNode::emitBytecode): (JSC::ConstStatementNode::emitBytecode): (JSC::BlockNode::emitBytecode): (JSC::EmptyStatementNode::emitBytecode): (JSC::DebuggerStatementNode::emitBytecode): (JSC::ExprStatementNode::emitBytecode): (JSC::VarStatementNode::emitBytecode): (JSC::IfNode::emitBytecode): (JSC::IfElseNode::emitBytecode): (JSC::DoWhileNode::emitBytecode): (JSC::WhileNode::emitBytecode): (JSC::ForNode::emitBytecode): (JSC::ForInNode::emitBytecode): (JSC::ContinueNode::emitBytecode): (JSC::BreakNode::emitBytecode): (JSC::ReturnNode::emitBytecode): (JSC::WithNode::emitBytecode): (JSC::SwitchNode::emitBytecode): (JSC::LabelNode::emitBytecode): (JSC::ThrowNode::emitBytecode): (JSC::TryNode::emitBytecode): (JSC::ScopeNode::ScopeNode): (JSC::EvalNode::emitBytecode): (JSC::FunctionBodyNode::emitBytecode): (JSC::ProgramNode::emitBytecode): (JSC::FuncDeclNode::emitBytecode): (JSC::FuncExprNode::emitBytecode):
  • parser/Nodes.h: (JSC::UnaryPlusNode::): (JSC::NegateNode::): (JSC::BitwiseNotNode::): (JSC::LogicalNotNode::): (JSC::MultNode::): (JSC::DivNode::): (JSC::ModNode::): (JSC::AddNode::): (JSC::SubNode::): (JSC::LeftShiftNode::): (JSC::RightShiftNode::): (JSC::UnsignedRightShiftNode::): (JSC::LessNode::): (JSC::GreaterNode::): (JSC::LessEqNode::): (JSC::GreaterEqNode::): (JSC::InstanceOfNode::): (JSC::InNode::): (JSC::EqualNode::): (JSC::NotEqualNode::): (JSC::StrictEqualNode::): (JSC::NotStrictEqualNode::): (JSC::BitAndNode::): (JSC::BitOrNode::): (JSC::BitXOrNode::): (JSC::ProgramNode::): (JSC::EvalNode::): (JSC::FunctionBodyNode::):
  • runtime/JSNotAnObject.h:
  • runtime/StructureID.cpp: (JSC::StructureID::fromDictionaryTransition):
  • wtf/Platform.h:
File:
1 edited

Legend:

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

    r38423 r38425  
    5555    if (offest < m_size) {
    5656        m_samples[offest]++;
    57         m_opcodeSampleCount++;
     57        m_bytecodeSampleCount++;
    5858    }
    5959}
     
    9595
    9696        if (!sample.inHostFunction()) {
    97             unsigned opcodeID = m_interpreter->getOpcodeID(sample.vPC()[0].u.opcode);
    98 
    99             ++m_opcodeSampleCount;
    100             ++m_opcodeSamples[opcodeID];
     97            unsigned bytecodeID = m_interpreter->getBytecodeID(sample.vPC()[0].u.bytecode);
     98
     99            ++m_bytecodeSampleCount;
     100            ++m_bytecodeSamples[bytecodeID];
    101101
    102102            if (sample.inCTIFunction())
    103                 m_opcodeSamplesInCTIFunctions[opcodeID]++;
     103                m_bytecodeSamplesInCTIFunctions[bytecodeID]++;
    104104        }
    105105
     
    141141}
    142142
    143 #if ENABLE(OPCODE_SAMPLING)
    144 
    145 struct OpcodeSampleInfo {
    146     OpcodeID opcode;
     143#if ENABLE(BYTECODE_SAMPLING)
     144
     145struct BytecodeSampleInfo {
     146    BytecodeID bytecode;
    147147    long long count;
    148148    long long countInCTIFunctions;
     
    162162}
    163163
    164 static int compareOpcodeIndicesSampling(const void* left, const void* right)
    165 {
    166     const OpcodeSampleInfo* leftSampleInfo = reinterpret_cast<const OpcodeSampleInfo*>(left);
    167     const OpcodeSampleInfo* rightSampleInfo = reinterpret_cast<const OpcodeSampleInfo*>(right);
     164static int compareBytecodeIndicesSampling(const void* left, const void* right)
     165{
     166    const BytecodeSampleInfo* leftSampleInfo = reinterpret_cast<const BytecodeSampleInfo*>(left);
     167    const BytecodeSampleInfo* rightSampleInfo = reinterpret_cast<const BytecodeSampleInfo*>(right);
    168168
    169169    return (leftSampleInfo->count < rightSampleInfo->count) ? 1 : (leftSampleInfo->count > rightSampleInfo->count) ? -1 : 0;
     
    184184        return;
    185185   
    186     // (1) Build and sort 'opcodeSampleInfo' array.
    187 
    188     OpcodeSampleInfo opcodeSampleInfo[numOpcodeIDs];
    189     for (int i = 0; i < numOpcodeIDs; ++i) {
    190         opcodeSampleInfo[i].opcode = static_cast<OpcodeID>(i);
    191         opcodeSampleInfo[i].count = m_opcodeSamples[i];
    192         opcodeSampleInfo[i].countInCTIFunctions = m_opcodeSamplesInCTIFunctions[i];
    193     }
    194 
    195     qsort(opcodeSampleInfo, numOpcodeIDs, sizeof(OpcodeSampleInfo), compareOpcodeIndicesSampling);
    196 
    197     // (2) Print Opcode sampling results.
    198 
    199     printf("\nOpcode samples [*]\n");
     186    // (1) Build and sort 'bytecodeSampleInfo' array.
     187
     188    BytecodeSampleInfo bytecodeSampleInfo[numBytecodeIDs];
     189    for (int i = 0; i < numBytecodeIDs; ++i) {
     190        bytecodeSampleInfo[i].bytecode = static_cast<BytecodeID>(i);
     191        bytecodeSampleInfo[i].count = m_bytecodeSamples[i];
     192        bytecodeSampleInfo[i].countInCTIFunctions = m_bytecodeSamplesInCTIFunctions[i];
     193    }
     194
     195    qsort(bytecodeSampleInfo, numBytecodeIDs, sizeof(BytecodeSampleInfo), compareBytecodeIndicesSampling);
     196
     197    // (2) Print Bytecode sampling results.
     198
     199    printf("\nBytecode samples [*]\n");
    200200    printf("                             sample   %% of       %% of     |   cti     cti %%\n");
    201     printf("opcode                       count     VM        total    |  count   of self\n");
     201    printf("bytecode                       count     VM        total    |  count   of self\n");
    202202    printf("-------------------------------------------------------   |  ----------------\n");
    203203
    204     for (int i = 0; i < numOpcodeIDs; ++i) {
    205         long long count = opcodeSampleInfo[i].count;
     204    for (int i = 0; i < numBytecodeIDs; ++i) {
     205        long long count = bytecodeSampleInfo[i].count;
    206206        if (!count)
    207207            continue;
    208208
    209         OpcodeID opcode = opcodeSampleInfo[i].opcode;
     209        BytecodeID bytecode = bytecodeSampleInfo[i].bytecode;
    210210       
    211         const char* opcodeName = opcodeNames[opcode];
    212         const char* opcodePadding = padOpcodeName(opcode, 28);
    213         double percentOfVM = (static_cast<double>(count) * 100) / m_opcodeSampleCount;
     211        const char* bytecodeName = bytecodeNames[bytecode];
     212        const char* bytecodePadding = padBytecodeName(bytecode, 28);
     213        double percentOfVM = (static_cast<double>(count) * 100) / m_bytecodeSampleCount;
    214214        double percentOfTotal = (static_cast<double>(count) * 100) / m_sampleCount;
    215         long long countInCTIFunctions = opcodeSampleInfo[i].countInCTIFunctions;
     215        long long countInCTIFunctions = bytecodeSampleInfo[i].countInCTIFunctions;
    216216        double percentInCTIFunctions = (static_cast<double>(countInCTIFunctions) * 100) / count;
    217         fprintf(stdout, "%s:%s%-6lld %.3f%%\t%.3f%%\t  |   %-6lld %.3f%%\n", opcodeName, opcodePadding, count, percentOfVM, percentOfTotal, countInCTIFunctions, percentInCTIFunctions);
     217        fprintf(stdout, "%s:%s%-6lld %.3f%%\t%.3f%%\t  |   %-6lld %.3f%%\n", bytecodeName, bytecodePadding, count, percentOfVM, percentOfTotal, countInCTIFunctions, percentInCTIFunctions);
    218218    }
    219219   
    220     printf("\n[*] Samples inside host code are not charged to any Opcode.\n\n");
    221     printf("\tSamples inside VM:\t\t%lld / %lld (%.3f%%)\n", m_opcodeSampleCount, m_sampleCount, (static_cast<double>(m_opcodeSampleCount) * 100) / m_sampleCount);
    222     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);
    223     printf("\tsample count:\tsamples inside this opcode\n");
    224     printf("\t%% of VM:\tsample count / all opcode samples\n");
     220    printf("\n[*] Samples inside host code are not charged to any Bytecode.\n\n");
     221    printf("\tSamples inside VM:\t\t%lld / %lld (%.3f%%)\n", m_bytecodeSampleCount, m_sampleCount, (static_cast<double>(m_bytecodeSampleCount) * 100) / m_sampleCount);
     222    printf("\tSamples inside host code:\t%lld / %lld (%.3f%%)\n\n", m_sampleCount - m_bytecodeSampleCount, m_sampleCount, (static_cast<double>(m_sampleCount - m_bytecodeSampleCount) * 100) / m_sampleCount);
     223    printf("\tsample count:\tsamples inside this bytecode\n");
     224    printf("\t%% of VM:\tsample count / all bytecode samples\n");
    225225    printf("\t%% of total:\tsample count / all samples\n");
    226226    printf("\t--------------\n");
    227     printf("\tcti count:\tsamples inside a CTI function called by this opcode\n");
     227    printf("\tcti count:\tsamples inside a CTI function called by this bytecode\n");
    228228    printf("\tcti %% of self:\tcti count / sample count\n");
    229229   
     
    255255                codeBlock->dump(exec);
    256256
    257                 printf("    Opcode and line number samples [*]\n\n");
     257                printf("    Bytecode and line number samples [*]\n\n");
    258258                for (unsigned op = 0; op < record->m_size; ++op) {
    259259                    int count = record->m_samples[op];
     
    280280                }
    281281                printf("\n");
    282                 printf("    [*] Samples inside host code are charged to the calling Opcode.\n");
    283                 printf("        Samples on a call / return boundary are not charged to a specific opcode or line.\n\n");
    284                 printf("            Samples on a call / return boundary: %d / %d (%.3f%%)\n\n", record->m_sampleCount - record->m_opcodeSampleCount, record->m_sampleCount, (static_cast<double>(record->m_sampleCount - record->m_opcodeSampleCount) * 100) / record->m_sampleCount);
     282                printf("    [*] Samples inside host code are charged to the calling Bytecode.\n");
     283                printf("        Samples on a call / return boundary are not charged to a specific bytecode or line.\n\n");
     284                printf("            Samples on a call / return boundary: %d / %d (%.3f%%)\n\n", record->m_sampleCount - record->m_bytecodeSampleCount, record->m_sampleCount, (static_cast<double>(record->m_sampleCount - record->m_bytecodeSampleCount) * 100) / record->m_sampleCount);
    285285            }
    286286        }
Note: See TracChangeset for help on using the changeset viewer.