Ignore:
Timestamp:
Dec 10, 2012, 10:38:15 AM (12 years ago)
Author:
[email protected]
Message:

JSC profiling and debug dump code should use inferred names when possible
https://bugs.webkit.org/show_bug.cgi?id=104519

Reviewed by Oliver Hunt.

Source/JavaScriptCore:

This does as advertised: the profiler now knows the inferred name of all code blocks,
and all uses of CodeBlock::dump() dump it along with the hash.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::inferredName):
(JSC::CodeBlock::dumpAssumingJITType):

  • bytecode/CodeBlock.h:
  • profiler/ProfilerBytecodes.cpp:

(JSC::Profiler::Bytecodes::Bytecodes):
(JSC::Profiler::Bytecodes::toJS):

  • profiler/ProfilerBytecodes.h:

(JSC::Profiler::Bytecodes::inferredName):

  • profiler/ProfilerDatabase.cpp:

(JSC::Profiler::Database::addBytecodes):
(JSC::Profiler::Database::ensureBytecodesFor):

  • profiler/ProfilerDatabase.h:
  • runtime/CommonIdentifiers.h:

Tools:

The format I'm using for referring to a code block is now name#hash. For example,
v8-crypto has something called bnpSquareTo#B5QFbU. The profiler allows you to use
either the hash, the inferred name, or the combined hash and full name when referring
to blocks.

  • Scripts/display-profiler-output:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp

    r136606 r137179  
    3232namespace JSC { namespace Profiler {
    3333
    34 Bytecodes::Bytecodes(size_t id, const String& sourceCode, CodeBlockHash hash)
     34Bytecodes::Bytecodes(
     35    size_t id, const String& inferredName, const String& sourceCode, CodeBlockHash hash)
    3536    : m_id(id)
     37    , m_inferredName(inferredName)
    3638    , m_sourceCode(sourceCode)
    3739    , m_hash(hash)
     
    6163   
    6264    result->putDirect(exec->globalData(), exec->propertyNames().bytecodesID, jsNumber(m_id));
     65    result->putDirect(exec->globalData(), exec->propertyNames().inferredName, jsString(exec, m_inferredName));
    6366    result->putDirect(exec->globalData(), exec->propertyNames().sourceCode, jsString(exec, m_sourceCode));
    6467    result->putDirect(exec->globalData(), exec->propertyNames().hash, jsString(exec, String::fromUTF8(toCString(m_hash))));
Note: See TracChangeset for help on using the changeset viewer.