Changeset 277110 in webkit


Ignore:
Timestamp:
May 6, 2021 12:41:15 PM (3 years ago)
Author:
fpizlo@apple.com
Message:

It should be possible to --logJIT=true
https://bugs.webkit.org/show_bug.cgi?id=225464

Reviewed by Mark Lam.

This makes it easy to just log when JITing happens. It's like --dumpDisassembly=true but
without the disassembly.

  • assembler/LinkBuffer.cpp:

(JSC::LinkBuffer::finalizeCodeWithDisassemblyImpl):

  • assembler/LinkBuffer.h:
  • runtime/Options.cpp:

(JSC::Options::recomputeDependentOptions):

  • runtime/OptionsList.h:
Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r277094 r277110  
     12021-05-06  Filip Pizlo  <fpizlo@apple.com>
     2
     3        It should be possible to --logJIT=true
     4        https://bugs.webkit.org/show_bug.cgi?id=225464
     5
     6        Reviewed by Mark Lam.
     7
     8        This makes it easy to just log when JITing happens. It's like --dumpDisassembly=true but
     9        without the disassembly.
     10
     11        * assembler/LinkBuffer.cpp:
     12        (JSC::LinkBuffer::finalizeCodeWithDisassemblyImpl):
     13        * assembler/LinkBuffer.h:
     14        * runtime/Options.cpp:
     15        (JSC::Options::recomputeDependentOptions):
     16        * runtime/OptionsList.h:
     17
    1182021-05-06  Mark Lam  <mark.lam@apple.com>
    219
  • trunk/Source/JavaScriptCore/assembler/LinkBuffer.cpp

    r276292 r277110  
    9191#endif
    9292
    93     if (!dumpDisassembly || m_alreadyDisassembled)
    94         return result;
    95    
     93    bool justDumpingHeader = !dumpDisassembly || m_alreadyDisassembled;
     94
    9695    StringPrintStream out;
    9796    out.printf("Generated JIT code for ");
     
    103102
    104103    uint8_t* executableAddress = result.code().untaggedExecutableAddress<uint8_t*>();
    105     out.printf("    Code at [%p, %p):\n", executableAddress, executableAddress + result.size());
     104    out.printf("    Code at [%p, %p)%s\n", executableAddress, executableAddress + result.size(), justDumpingHeader ? "." : ":");
    106105   
    107106    CString header = out.toCString();
     107   
     108    if (justDumpingHeader) {
     109        if (Options::logJIT())
     110            dataLog(header);
     111        return result;
     112    }
    108113   
    109114    if (Options::asyncDisassembly()) {
  • trunk/Source/JavaScriptCore/assembler/LinkBuffer.h

    r272191 r277110  
    379379
    380380#if OS(LINUX)
    381 #define FINALIZE_CODE_IF(condition, linkBufferReference, resultPtrTag, ...)  \
    382     (UNLIKELY((condition))                                              \
    383         ? (linkBufferReference).finalizeCodeWithDisassembly<resultPtrTag>(true, __VA_ARGS__) \
     381#define FINALIZE_CODE_IF(condition, linkBufferReference, resultPtrTag, ...) \
     382    (UNLIKELY((condition) || JSC::Options::logJIT()) \
     383        ? (linkBufferReference).finalizeCodeWithDisassembly<resultPtrTag>((condition), __VA_ARGS__) \
    384384        : (UNLIKELY(JSC::Options::logJITCodeForPerf()) \
    385385            ? (linkBufferReference).finalizeCodeWithDisassembly<resultPtrTag>(false, __VA_ARGS__) \
    386386            : (linkBufferReference).finalizeCodeWithoutDisassembly<resultPtrTag>()))
    387387#else
    388 #define FINALIZE_CODE_IF(condition, linkBufferReference, resultPtrTag, ...)  \
    389     (UNLIKELY((condition))                                              \
    390         ? (linkBufferReference).finalizeCodeWithDisassembly<resultPtrTag>(true, __VA_ARGS__) \
     388#define FINALIZE_CODE_IF(condition, linkBufferReference, resultPtrTag, ...) \
     389    (UNLIKELY((condition) || JSC::Options::logJIT()) \
     390        ? (linkBufferReference).finalizeCodeWithDisassembly<resultPtrTag>((condition), __VA_ARGS__) \
    391391        : (linkBufferReference).finalizeCodeWithoutDisassembly<resultPtrTag>())
    392392#endif
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r273138 r277110  
    452452        Options::useFastTLSForWasmContext() = false;
    453453   
    454     if (Options::dumpDisassembly()
     454    if (Options::logJIT()
     455        || Options::dumpDisassembly()
    455456        || Options::dumpDFGDisassembly()
    456457        || Options::dumpFTLDisassembly()
  • trunk/Source/JavaScriptCore/runtime/OptionsList.h

    r276858 r277110  
    123123    v(Bool, dumpDisassembly, false, Normal, "dumps disassembly of all JIT compiled code upon compilation") \
    124124    v(Bool, asyncDisassembly, false, Normal, nullptr) \
     125    v(Bool, logJIT, false, Normal, nullptr) \
    125126    v(Bool, dumpDFGDisassembly, false, Normal, "dumps disassembly of DFG function upon compilation") \
    126127    v(Bool, dumpFTLDisassembly, false, Normal, "dumps disassembly of FTL function upon compilation") \
Note: See TracChangeset for help on using the changeset viewer.