Ignore:
Timestamp:
Jun 19, 2012, 6:33:30 PM (13 years ago)
Author:
[email protected]
Message:

JSC should be able to show disassembly for all generated JIT code
https://bugs.webkit.org/show_bug.cgi?id=89536

Reviewed by Gavin Barraclough.

Now instead of doing linkBuffer.finalizeCode(), you do
FINALIZE_CODE(linkBuffer, (... explanation ...)). FINALIZE_CODE() then
prints your explanation and the disassembled code, if
Options::showDisassembly is set to true.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
  • assembler/LinkBuffer.cpp: Added.

(JSC):
(JSC::LinkBuffer::finalizeCodeWithoutDisassembly):
(JSC::LinkBuffer::finalizeCodeWithDisassembly):
(JSC::LinkBuffer::linkCode):
(JSC::LinkBuffer::performFinalization):
(JSC::LinkBuffer::dumpLinkStatistics):
(JSC::LinkBuffer::dumpCode):

  • assembler/LinkBuffer.h:

(LinkBuffer):
(JSC):

  • assembler/MacroAssemblerCodeRef.h:

(JSC::MacroAssemblerCodeRef::tryToDisassemble):
(MacroAssemblerCodeRef):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):

  • dfg/DFGOSRExitCompiler.cpp:
  • dfg/DFGRepatch.cpp:

(JSC::DFG::generateProtoChainAccessStub):
(JSC::DFG::tryCacheGetByID):
(JSC::DFG::tryBuildGetByIDList):
(JSC::DFG::emitPutReplaceStub):
(JSC::DFG::emitPutTransitionStub):

  • dfg/DFGThunks.cpp:

(JSC::DFG::osrExitGenerationThunkGenerator):

  • disassembler/Disassembler.h:

(JSC):
(JSC::tryToDisassemble):

  • disassembler/UDis86Disassembler.cpp:

(JSC::tryToDisassemble):

  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

  • jit/JITCode.h:

(JSC::JITCode::tryToDisassemble):

  • jit/JITOpcodes.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):
(JSC::JIT::privateCompileCTINativeCall):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::privateCompilePatchGetArrayLength):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdSelfList):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::privateCompilePatchGetArrayLength):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdSelfList):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):

  • jit/SpecializedThunkJIT.h:

(JSC::SpecializedThunkJIT::finalize):

  • jit/ThunkGenerators.cpp:

(JSC::charCodeAtThunkGenerator):
(JSC::charAtThunkGenerator):
(JSC::fromCharCodeThunkGenerator):
(JSC::sqrtThunkGenerator):
(JSC::floorThunkGenerator):
(JSC::ceilThunkGenerator):
(JSC::roundThunkGenerator):
(JSC::expThunkGenerator):
(JSC::logThunkGenerator):
(JSC::absThunkGenerator):
(JSC::powThunkGenerator):

  • llint/LLIntThunks.cpp:

(JSC::LLInt::generateThunkWithJumpTo):
(JSC::LLInt::functionForCallEntryThunkGenerator):
(JSC::LLInt::functionForConstructEntryThunkGenerator):
(JSC::LLInt::functionForCallArityCheckThunkGenerator):
(JSC::LLInt::functionForConstructArityCheckThunkGenerator):
(JSC::LLInt::evalEntryThunkGenerator):
(JSC::LLInt::programEntryThunkGenerator):

  • runtime/Options.cpp:

(Options):
(JSC::Options::initializeOptions):

  • runtime/Options.h:

(Options):

  • yarr/YarrJIT.cpp:

(JSC::Yarr::YarrGenerator::compile):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r120244 r120786  
    8989   
    9090    LinkBuffer patchBuffer(*globalData, &jit, GLOBAL_THUNK_ID);
    91     return patchBuffer.finalizeCode();
     91    return FINALIZE_CODE(patchBuffer, ("String get_by_val stub"));
    9292}
    9393
     
    565565    }
    566566   
    567     stubInfo->stubRoutine = patchBuffer.finalizeCode();
     567    stubInfo->stubRoutine = FINALIZE_CODE(
     568        patchBuffer,
     569        ("Baseline put_by_id transition for CodeBlock %p, return point %p",
     570         m_codeBlock, returnAddress.value()));
    568571    RepatchBuffer repatchBuffer(m_codeBlock);
    569572    repatchBuffer.relinkCallerToTrampoline(returnAddress, CodeLocationLabel(stubInfo->stubRoutine.code()));
     
    626629
    627630    // Track the stub we have created so that it will be deleted later.
    628     stubInfo->stubRoutine = patchBuffer.finalizeCode();
     631    stubInfo->stubRoutine = FINALIZE_CODE(
     632        patchBuffer,
     633        ("Basline JIT get_by_id array length stub for CodeBlock %p, return point %p",
     634         m_codeBlock, stubInfo->hotPathBegin.labelAtOffset(
     635             stubInfo->patch.baseline.u.get.putResult).executableAddress()));
    629636
    630637    // Finally patch the jump to slow case back in the hot path to jump here instead.
     
    689696    }
    690697    // Track the stub we have created so that it will be deleted later.
    691     stubInfo->stubRoutine = patchBuffer.finalizeCode();
     698    stubInfo->stubRoutine = FINALIZE_CODE(
     699        patchBuffer,
     700        ("Baseline JIT get_by_id proto stub for CodeBlock %p, return point %p",
     701         m_codeBlock, stubInfo->hotPathBegin.labelAtOffset(
     702             stubInfo->patch.baseline.u.get.putResult).executableAddress()));
    692703
    693704    // Finally patch the jump to slow case back in the hot path to jump here instead.
     
    746757    patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(stubInfo->patch.baseline.u.get.putResult));
    747758
    748     MacroAssemblerCodeRef stubCode = patchBuffer.finalizeCode();
     759    MacroAssemblerCodeRef stubCode = FINALIZE_CODE(
     760        patchBuffer,
     761        ("Baseline JIT get_by_id list stub for CodeBlock %p, return point %p",
     762         m_codeBlock, stubInfo->hotPathBegin.labelAtOffset(
     763             stubInfo->patch.baseline.u.get.putResult).executableAddress()));
    749764
    750765    polymorphicStructures->list[currentIndex].set(*m_globalData, m_codeBlock->ownerExecutable(), stubCode, structure, isDirect);
     
    812827    patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(stubInfo->patch.baseline.u.get.putResult));
    813828
    814     MacroAssemblerCodeRef stubCode = patchBuffer.finalizeCode();
     829    MacroAssemblerCodeRef stubCode = FINALIZE_CODE(
     830        patchBuffer,
     831        ("Baseline JIT get_by_id proto list stub for CodeBlock %p, return point %p",
     832         m_codeBlock, stubInfo->hotPathBegin.labelAtOffset(
     833             stubInfo->patch.baseline.u.get.putResult).executableAddress()));
    815834    prototypeStructures->list[currentIndex].set(*m_globalData, m_codeBlock->ownerExecutable(), stubCode, structure, prototypeStructure, isDirect);
    816835
     
    881900    patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(stubInfo->patch.baseline.u.get.putResult));
    882901
    883     CodeRef stubRoutine = patchBuffer.finalizeCode();
     902    CodeRef stubRoutine = FINALIZE_CODE(
     903        patchBuffer,
     904        ("Baseline JIT get_by_id chain list stub for CodeBlock %p, return point %p",
     905         m_codeBlock, stubInfo->hotPathBegin.labelAtOffset(
     906             stubInfo->patch.baseline.u.get.putResult).executableAddress()));
    884907
    885908    // Track the stub we have created so that it will be deleted later.
     
    948971
    949972    // Track the stub we have created so that it will be deleted later.
    950     CodeRef stubRoutine = patchBuffer.finalizeCode();
     973    CodeRef stubRoutine = FINALIZE_CODE(
     974        patchBuffer,
     975        ("Baseline JIT get_by_id chain stub for CodeBlock %p, return point %p",
     976         m_codeBlock, stubInfo->hotPathBegin.labelAtOffset(
     977             stubInfo->patch.baseline.u.get.putResult).executableAddress()));
    951978    stubInfo->stubRoutine = stubRoutine;
    952979
Note: See TracChangeset for help on using the changeset viewer.