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/runtime/VM.cpp

    r172665 r172820  
    4949#include "Heap.h"
    5050#include "HeapIterationScope.h"
    51 #include "HighFidelityTypeProfiler.h"
    52 #include "HighFidelityLog.h"
    5351#include "HostCallReturnValue.h"
    5452#include "Identifier.h"
     
    8583#include "StrongInlines.h"
    8684#include "StructureInlines.h"
     85#include "TypeProfiler.h"
     86#include "TypeProfilerLog.h"
    8787#include "UnlinkedCodeBlock.h"
    8888#include "WeakMapData.h"
     
    194194    , m_builtinExecutables(BuiltinExecutables::create(*this))
    195195    , m_nextUniqueVariableID(1)
    196     , m_highFidelityTypeProfilingEnabledCount(0)
     196    , m_typeProfilerEnabledCount(0)
    197197{
    198198    interpreter = new Interpreter(*this);
     
    287287    m_typedArrayController = adoptRef(new SimpleTypedArrayController());
    288288
    289     if (Options::profileTypesWithHighFidelity())
    290         enableHighFidelityTypeProfiling();
     289    if (Options::enableTypeProfiler())
     290        enableTypeProfiler();
    291291}
    292292
     
    900900}
    901901
    902 bool VM::enableHighFidelityTypeProfiling()
     902bool VM::enableTypeProfiler()
    903903{
    904904    bool needsToRecompile = false;
    905     if (!m_highFidelityTypeProfilingEnabledCount) {
    906         m_highFidelityTypeProfiler = std::make_unique<HighFidelityTypeProfiler>();
    907         m_highFidelityLog = std::make_unique<HighFidelityLog>();
     905    if (!m_typeProfilerEnabledCount) {
     906        m_typeProfiler = std::make_unique<TypeProfiler>();
     907        m_typeProfilerLog = std::make_unique<TypeProfilerLog>();
    908908        m_typeLocationInfo = std::make_unique<Bag<TypeLocation>>();
    909909        needsToRecompile = true;
    910910    }
    911     m_highFidelityTypeProfilingEnabledCount++;
     911    m_typeProfilerEnabledCount++;
    912912
    913913    return needsToRecompile;
    914914}
    915915
    916 bool VM::disableHighFidelityTypeProfiling()
    917 {
    918     RELEASE_ASSERT(m_highFidelityTypeProfilingEnabledCount > 0);
     916bool VM::disableTypeProfiler()
     917{
     918    RELEASE_ASSERT(m_typeProfilerEnabledCount > 0);
    919919
    920920    bool needsToRecompile = false;
    921     m_highFidelityTypeProfilingEnabledCount--;
    922     if (!m_highFidelityTypeProfilingEnabledCount) {
    923         m_highFidelityTypeProfiler.reset(nullptr);
    924         m_highFidelityLog.reset(nullptr);
     921    m_typeProfilerEnabledCount--;
     922    if (!m_typeProfilerEnabledCount) {
     923        m_typeProfiler.reset(nullptr);
     924        m_typeProfilerLog.reset(nullptr);
    925925        m_typeLocationInfo.reset(nullptr);
    926926        needsToRecompile = true;
     
    930930}
    931931
    932 void VM::dumpHighFidelityProfilingTypes()
    933 {
    934     if (!isProfilingTypesWithHighFidelity())
     932void VM::dumpTypeProfilerData()
     933{
     934    if (!typeProfiler())
    935935        return;
    936936
    937     highFidelityLog()->processHighFidelityLog("VM Dump Types");
    938     HighFidelityTypeProfiler* profiler = m_highFidelityTypeProfiler.get();
     937    typeProfilerLog()->processLogEntries(ASCIILiteral("VM Dump Types"));
     938    TypeProfiler* profiler = m_typeProfiler.get();
    939939    for (Bag<TypeLocation>::iterator iter = m_typeLocationInfo->begin(); !!iter; ++iter) {
    940940        TypeLocation* location = *iter;
Note: See TracChangeset for help on using the changeset viewer.