Ignore:
Timestamp:
Aug 20, 2014, 6:03:20 PM (11 years ago)
Author:
[email protected]
Message:

Rename HighFidelityTypeProfiling variables for more clarity
https://bugs.webkit.org/show_bug.cgi?id=135899

Patch by Saam Barati <[email protected]> on 2014-08-20
Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Many names that are used in the type profiling infrastructure
prefix themselves with "HighFidelity" or include the words "high"
and/or "fidelity" in some way. But the words "high" and "fidelity" don't
add anything descriptive to the names surrounding type profiling.
So this patch removes all uses of "HighFidelity" and its variants.

Most renamings change "HighFidelity*" to "TypeProfiler*" or simply
drop the prefix "HighFidelity" all together. Now, almost all names
in relation to type profiling contain in them "TypeProfiler" or
"TypeProfiling" or some combination of the words "type" and "profile".

This patch also changes how we check if type profiling is enabled:
We no longer call vm::isProfilingTypesWithHighFidelity. We now just
check that vm::typeProfiler is not null.

This patch also changes all calls to TypeProfilerLog::processLogEntries
to use ASCIILiteral to form WTFStrings instead of vanilla C string literals.

  • CMakeLists.txt:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • bytecode/BytecodeList.json:
  • bytecode/BytecodeUseDef.h:

(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):

  • bytecode/TypeLocation.h:
  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedCodeBlock::typeProfilerExpressionInfoForBytecodeOffset):
(JSC::UnlinkedCodeBlock::addTypeProfilerExpressionInfo):
(JSC::UnlinkedCodeBlock::highFidelityTypeProfileExpressionInfoForBytecodeOffset): Deleted.
(JSC::UnlinkedCodeBlock::addHighFidelityTypeProfileExpressionInfo): Deleted.

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedFunctionExecutable::typeProfilingStartOffset):
(JSC::UnlinkedFunctionExecutable::typeProfilingEndOffset):
(JSC::UnlinkedFunctionExecutable::highFidelityTypeProfilingStartOffset): Deleted.
(JSC::UnlinkedFunctionExecutable::highFidelityTypeProfilingEndOffset): Deleted.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitMove):
(JSC::BytecodeGenerator::emitTypeProfilerExpressionInfo):
(JSC::BytecodeGenerator::emitProfileType):
(JSC::BytecodeGenerator::emitHighFidelityTypeProfilingExpressionInfo): Deleted.
(JSC::BytecodeGenerator::emitProfileTypesWithHighFidelity): Deleted.

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::isProfilingTypesWithHighFidelity): Deleted.

  • bytecompiler/NodesCodegen.cpp:

(JSC::ThisNode::emitBytecode):
(JSC::ResolveNode::emitBytecode):
(JSC::BracketAccessorNode::emitBytecode):
(JSC::DotAccessorNode::emitBytecode):
(JSC::FunctionCallValueNode::emitBytecode):
(JSC::FunctionCallResolveNode::emitBytecode):
(JSC::FunctionCallBracketNode::emitBytecode):
(JSC::FunctionCallDotNode::emitBytecode):
(JSC::CallFunctionCallDotNode::emitBytecode):
(JSC::ApplyFunctionCallDotNode::emitBytecode):
(JSC::PostfixNode::emitResolve):
(JSC::PostfixNode::emitBracket):
(JSC::PostfixNode::emitDot):
(JSC::PrefixNode::emitResolve):
(JSC::PrefixNode::emitBracket):
(JSC::PrefixNode::emitDot):
(JSC::ReadModifyResolveNode::emitBytecode):
(JSC::AssignResolveNode::emitBytecode):
(JSC::AssignDotNode::emitBytecode):
(JSC::ReadModifyDotNode::emitBytecode):
(JSC::AssignBracketNode::emitBytecode):
(JSC::ReadModifyBracketNode::emitBytecode):
(JSC::ConstDeclNode::emitCodeSingle):
(JSC::EmptyVarExpression::emitBytecode):
(JSC::ReturnNode::emitBytecode):
(JSC::FunctionBodyNode::emitBytecode):

  • heap/Heap.cpp:

(JSC::Heap::collect):

  • inspector/agents/InspectorRuntimeAgent.cpp:

(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
(Inspector::recompileAllJSFunctionsForTypeProfiling):
(Inspector::InspectorRuntimeAgent::willDestroyFrontendAndBackend):
(Inspector::InspectorRuntimeAgent::enableTypeProfiler):
(Inspector::InspectorRuntimeAgent::disableTypeProfiler):
(Inspector::InspectorRuntimeAgent::setTypeProfilerEnabledState):
(Inspector::InspectorRuntimeAgent::enableHighFidelityTypeProfiling): Deleted.
(Inspector::InspectorRuntimeAgent::disableHighFidelityTypeProfiling): Deleted.
(Inspector::InspectorRuntimeAgent::setHighFidelityTypeProfilingEnabledState): Deleted.

  • inspector/agents/InspectorRuntimeAgent.h:
  • inspector/protocol/Runtime.json:
  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompile):

  • jit/JIT.h:
  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_profile_type):
(JSC::JIT::emit_op_profile_types_with_high_fidelity): Deleted.

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_profile_type):
(JSC::JIT::emit_op_profile_types_with_high_fidelity): Deleted.

  • jit/JITOperations.cpp:
  • jsc.cpp:

(functionDumpTypesForAllVariables):

  • llint/LLIntSlowPaths.cpp:
  • llint/LowLevelInterpreter.asm:
  • runtime/CodeCache.cpp:

(JSC::CodeCache::getGlobalCodeBlock):

  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/CommonSlowPaths.h:
  • runtime/Executable.cpp:

(JSC::ScriptExecutable::ScriptExecutable):
(JSC::ProgramExecutable::ProgramExecutable):
(JSC::FunctionExecutable::FunctionExecutable):
(JSC::ProgramExecutable::initializeGlobalProperties):

  • runtime/Executable.h:

(JSC::ScriptExecutable::typeProfilingStartOffset):
(JSC::ScriptExecutable::typeProfilingEndOffset):
(JSC::ScriptExecutable::highFidelityTypeProfilingStartOffset): Deleted.
(JSC::ScriptExecutable::highFidelityTypeProfilingEndOffset): Deleted.

  • runtime/HighFidelityLog.cpp: Removed.
  • runtime/HighFidelityLog.h: Removed.
  • runtime/HighFidelityTypeProfiler.cpp: Removed.
  • runtime/HighFidelityTypeProfiler.h: Removed.
  • runtime/Options.h:
  • runtime/SymbolTable.cpp:

(JSC::SymbolTable::prepareForTypeProfiling):
(JSC::SymbolTable::uniqueIDForVariable):
(JSC::SymbolTable::uniqueIDForRegister):
(JSC::SymbolTable::prepareForHighFidelityTypeProfiling): Deleted.

  • runtime/SymbolTable.h:
  • runtime/TypeProfiler.cpp: Added.

(JSC::TypeProfiler::logTypesForTypeLocation):
(JSC::TypeProfiler::insertNewLocation):
(JSC::TypeProfiler::getTypesForVariableAtOffsetForInspector):
(JSC::descriptorMatchesTypeLocation):
(JSC::TypeProfiler::findLocation):

  • runtime/TypeProfiler.h: Added.

(JSC::QueryKey::QueryKey):
(JSC::QueryKey::isHashTableDeletedValue):
(JSC::QueryKey::operator==):
(JSC::QueryKey::hash):
(JSC::QueryKeyHash::hash):
(JSC::QueryKeyHash::equal):
(JSC::TypeProfiler::functionHasExecutedCache):
(JSC::TypeProfiler::typeLocationCache):

  • runtime/TypeProfilerLog.cpp: Added.

(JSC::TypeProfilerLog::initializeLog):
(JSC::TypeProfilerLog::~TypeProfilerLog):
(JSC::TypeProfilerLog::processLogEntries):

  • runtime/TypeProfilerLog.h: Added.

(JSC::TypeProfilerLog::LogEntry::structureIDOffset):
(JSC::TypeProfilerLog::LogEntry::valueOffset):
(JSC::TypeProfilerLog::LogEntry::locationOffset):
(JSC::TypeProfilerLog::TypeProfilerLog):
(JSC::TypeProfilerLog::recordTypeInformationForLocation):
(JSC::TypeProfilerLog::logEndPtr):
(JSC::TypeProfilerLog::logStartOffset):
(JSC::TypeProfilerLog::currentLogEntryOffset):

  • runtime/VM.cpp:

(JSC::VM::VM):
(JSC::VM::enableTypeProfiler):
(JSC::VM::disableTypeProfiler):
(JSC::VM::dumpTypeProfilerData):
(JSC::VM::enableHighFidelityTypeProfiling): Deleted.
(JSC::VM::disableHighFidelityTypeProfiling): Deleted.
(JSC::VM::dumpHighFidelityProfilingTypes): Deleted.

  • runtime/VM.h:

(JSC::VM::typeProfilerLog):
(JSC::VM::typeProfiler):
(JSC::VM::isProfilingTypesWithHighFidelity): Deleted.
(JSC::VM::highFidelityLog): Deleted.
(JSC::VM::highFidelityTypeProfiler): Deleted.

Source/WebInspectorUI:

Change a reference in a comment to a JavaScriptCore file to its
newly renamed variant.

  • UserInterface/Models/ScriptSyntaxTree.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r172808 r172820  
    4141#include "Debugger.h"
    4242#include "FunctionExecutableDump.h"
    43 #include "HighFidelityTypeProfiler.h"
    4443#include "Interpreter.h"
    4544#include "JIT.h"
     
    5049#include "JSNameScope.h"
    5150#include "LLIntEntrypoint.h"
    52 #include "TypeLocationCache.h"
    5351#include "LowLevelInterpreter.h"
    5452#include "JSCInlines.h"
     
    6159#include "SlotVisitorInlines.h"
    6260#include "StackVisitor.h"
     61#include "TypeLocationCache.h"
     62#include "TypeProfiler.h"
    6363#include "UnlinkedInstructionStream.h"
    6464#include <wtf/BagToHashMap.h>
     
    840840            break;
    841841        }
    842         case op_profile_types_with_high_fidelity: {
     842        case op_profile_type: {
    843843            int r0 = (++it)->u.operand;
    844844            ++it;
    845845            ++it;
    846             printLocationAndOp(out, exec, location, it, "op_profile_types_with_high_fidelity");
     846            printLocationAndOp(out, exec, location, it, "op_profile_type");
    847847            out.printf("%s", registerName(r0).data());
    848848            break;
     
    17151715   
    17161716    if (SymbolTable* symbolTable = unlinkedCodeBlock->symbolTable()) {
    1717         if (m_vm->isProfilingTypesWithHighFidelity()) {
     1717        if (m_vm->typeProfiler()) {
    17181718            ConcurrentJITLocker locker(symbolTable->m_lock);
    1719             symbolTable->prepareForHighFidelityTypeProfiling(locker);
     1719            symbolTable->prepareForTypeProfiling(locker);
    17201720        }
    17211721
     
    17301730    setNumParameters(unlinkedCodeBlock->numParameters());
    17311731
    1732     if (vm()->isProfilingTypesWithHighFidelity())
    1733         vm()->highFidelityTypeProfiler()->functionHasExecutedCache()->removeUnexecutedRange(m_ownerExecutable->sourceID(), m_ownerExecutable->highFidelityTypeProfilingStartOffset(), m_ownerExecutable->highFidelityTypeProfilingEndOffset());
     1732    if (vm()->typeProfiler())
     1733        vm()->typeProfiler()->functionHasExecutedCache()->removeUnexecutedRange(m_ownerExecutable->sourceID(), m_ownerExecutable->typeProfilingStartOffset(), m_ownerExecutable->typeProfilingEndOffset());
    17341734
    17351735    setConstantRegisters(unlinkedCodeBlock->constantRegisters());
     
    17391739    for (size_t count = unlinkedCodeBlock->numberOfFunctionDecls(), i = 0; i < count; ++i) {
    17401740        UnlinkedFunctionExecutable* unlinkedExecutable = unlinkedCodeBlock->functionDecl(i);
    1741         if (vm()->isProfilingTypesWithHighFidelity())
    1742             vm()->highFidelityTypeProfiler()->functionHasExecutedCache()->insertUnexecutedRange(m_ownerExecutable->sourceID(), unlinkedExecutable->highFidelityTypeProfilingStartOffset(), unlinkedExecutable->highFidelityTypeProfilingEndOffset());
     1741        if (vm()->typeProfiler())
     1742            vm()->typeProfiler()->functionHasExecutedCache()->insertUnexecutedRange(m_ownerExecutable->sourceID(), unlinkedExecutable->typeProfilingStartOffset(), unlinkedExecutable->typeProfilingEndOffset());
    17431743        unsigned lineCount = unlinkedExecutable->lineCount();
    17441744        unsigned firstLine = ownerExecutable->lineNo() + unlinkedExecutable->firstLineOffset();
     
    17571757    for (size_t count = unlinkedCodeBlock->numberOfFunctionExprs(), i = 0; i < count; ++i) {
    17581758        UnlinkedFunctionExecutable* unlinkedExecutable = unlinkedCodeBlock->functionExpr(i);
    1759         if (vm()->isProfilingTypesWithHighFidelity())
    1760             vm()->highFidelityTypeProfiler()->functionHasExecutedCache()->insertUnexecutedRange(m_ownerExecutable->sourceID(), unlinkedExecutable->highFidelityTypeProfilingStartOffset(), unlinkedExecutable->highFidelityTypeProfilingEndOffset());
     1759        if (vm()->typeProfiler())
     1760            vm()->typeProfiler()->functionHasExecutedCache()->insertUnexecutedRange(m_ownerExecutable->sourceID(), unlinkedExecutable->typeProfilingStartOffset(), unlinkedExecutable->typeProfilingEndOffset());
    17611761        unsigned lineCount = unlinkedExecutable->lineCount();
    17621762        unsigned firstLine = ownerExecutable->lineNo() + unlinkedExecutable->firstLineOffset();
     
    19931993        }
    19941994
    1995         case op_profile_types_with_high_fidelity: {
    1996             // The format of this instruction is: op_profile_types_with_high_fidelity regToProfile, TypeLocation*, flag, identifier?, resolveType?
     1995        case op_profile_type: {
     1996            // The format of this instruction is: op_profile_type regToProfile, TypeLocation*, flag, identifier?, resolveType?
    19971997            size_t instructionOffset = i + opLength - 1;
    19981998            unsigned divotStart, divotEnd;
    19991999            GlobalVariableID globalVariableID;
    20002000            RefPtr<TypeSet> globalTypeSet;
    2001             bool shouldAnalyze = m_unlinkedCode->highFidelityTypeProfileExpressionInfoForBytecodeOffset(instructionOffset, divotStart, divotEnd);
     2001            bool shouldAnalyze = m_unlinkedCode->typeProfilerExpressionInfoForBytecodeOffset(instructionOffset, divotStart, divotEnd);
    20022002            VirtualRegister profileRegister(pc[1].u.operand);
    2003             ProfileTypesWithHighFidelityBytecodeFlag flag = static_cast<ProfileTypesWithHighFidelityBytecodeFlag>(pc[3].u.operand);
     2003            ProfileTypeBytecodeFlag flag = static_cast<ProfileTypeBytecodeFlag>(pc[3].u.operand);
    20042004            SymbolTable* symbolTable = nullptr;
    20052005
    20062006            switch (flag) {
    2007             case ProfileTypesBytecodePutToScope:
    2008             case ProfileTypesBytecodeGetFromScope: {
     2007            case ProfileTypeBytecodePutToScope:
     2008            case ProfileTypeBytecodeGetFromScope: {
    20092009                const Identifier& ident = identifier(pc[4].u.operand);
    20102010                ResolveType type = static_cast<ResolveType>(pc[5].u.operand);
    2011                 ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), needsActivation(), scope, ident, (flag == ProfileTypesBytecodeGetFromScope ? Get : Put), type);
     2011                ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), needsActivation(), scope, ident, (flag == ProfileTypeBytecodeGetFromScope ? Get : Put), type);
    20122012
    20132013                // FIXME: handle other values for op.type here, and also consider what to do when we can't statically determine the globalID
     
    20212021                    ConcurrentJITLocker locker(symbolTable->m_lock);
    20222022                    // If our parent scope was created while profiling was disabled, it will not have prepared for profiling yet.
    2023                     symbolTable->prepareForHighFidelityTypeProfiling(locker);
     2023                    symbolTable->prepareForTypeProfiling(locker);
    20242024                    globalVariableID = symbolTable->uniqueIDForVariable(locker, ident.impl(), *vm());
    20252025                    globalTypeSet = symbolTable->globalTypeSetForVariable(locker, ident.impl(), *vm());
    20262026                } else
    2027                     globalVariableID = HighFidelityNoGlobalIDExists;
     2027                    globalVariableID = TypeProfilerNoGlobalIDExists;
    20282028
    20292029                break;
    20302030            }
    2031             case ProfileTypesBytecodeHasGlobalID: {
     2031            case ProfileTypeBytecodeHasGlobalID: {
    20322032                symbolTable = m_symbolTable.get();
    20332033                ConcurrentJITLocker locker(symbolTable->m_lock);
     
    20362036                break;
    20372037            }
    2038             case ProfileTypesBytecodeDoesNotHaveGlobalID:
    2039             case ProfileTypesBytecodeFunctionArgument: {
    2040                 globalVariableID = HighFidelityNoGlobalIDExists;
     2038            case ProfileTypeBytecodeDoesNotHaveGlobalID:
     2039            case ProfileTypeBytecodeFunctionArgument: {
     2040                globalVariableID = TypeProfilerNoGlobalIDExists;
    20412041                break;
    20422042            }
    2043             case ProfileTypesBytecodeFunctionReturnStatement: {
     2043            case ProfileTypeBytecodeFunctionReturnStatement: {
    20442044                globalTypeSet = returnStatementTypeSet();
    2045                 globalVariableID = HighFidelityReturnStatement;
     2045                globalVariableID = TypeProfilerReturnStatement;
    20462046                if (!shouldAnalyze) {
    20472047                    // Because some return statements are added implicitly (to return undefined at the end of a function), and these nodes don't emit expression ranges, give them some range.
     
    20542054            }
    20552055
    2056             std::pair<TypeLocation*, bool> locationPair = vm()->highFidelityTypeProfiler()->typeLocationCache()->getTypeLocation(globalVariableID,
     2056            std::pair<TypeLocation*, bool> locationPair = vm()->typeProfiler()->typeLocationCache()->getTypeLocation(globalVariableID,
    20572057                m_ownerExecutable->sourceID(), divotStart, divotEnd, globalTypeSet, vm());
    20582058            TypeLocation* location = locationPair.first;
    20592059            bool isNewLocation = locationPair.second;
    20602060
    2061             if (ProfileTypesBytecodeFunctionReturnStatement)
     2061            if (ProfileTypeBytecodeFunctionReturnStatement)
    20622062                location->m_divotForFunctionOffsetIfReturnStatement = m_sourceOffset;
    20632063
    20642064            if (shouldAnalyze && isNewLocation)
    2065                 vm()->highFidelityTypeProfiler()->insertNewLocation(location);
     2065                vm()->typeProfiler()->insertNewLocation(location);
    20662066
    20672067            instructions[i + 2].u.location = location;
Note: See TracChangeset for help on using the changeset viewer.