Ignore:
Timestamp:
May 19, 2021, 3:30:16 PM (4 years ago)
Author:
[email protected]
Message:

Ripping out broken Baseline JIT rare case profiling.
https://bugs.webkit.org/show_bug.cgi?id=225983

Reviewed by Saam Barati and Robin Morisset.

The profiling has been broken in recent times. Fixing it to work does not appear
to improve performance. Ripping out the profiling appears to not hurt performance.
However, ripping out the profiling appears to save on code size generated for the
Baseline JIT.

Base New Diff

BaselineJIT: 73299112 (69.903481 MB) 65910128 (62.856796 MB) 0.90x (reduction)

DFG: 36850540 (35.143414 MB) 36374400 (34.689331 MB) 0.99x

Thunk: 23128652 (22.057201 MB) 22892292 (21.831791 MB) 0.99x

InlineCache: 22210972 (21.182034 MB) 22083508 (21.060474 MB) 0.99x

FTL: 6065064 (5.784096 MB) 6128080 (5.844193 MB) 1.01x

Wasm: 2305124 (2.198338 MB) 2309732 (2.202732 MB) 1.00x

YarrJIT: 1522712 (1.452171 MB) 1536104 (1.464943 MB) 1.01x

CSSJIT: 0 0

Uncategorized: 0 0

Cumulative diff since the start of this effort to put more code in JIT thunks:

Base New Diff

BaselineJIT: 89089964 (84.962811 MB) 65910128 (62.856796 MB) 0.74x (reduction)

DFG: 39117360 (37.305222 MB) 36374400 (34.689331 MB) 0.93x (reduction)

Thunk: 23230968 (22.154778 MB) 22892292 (21.831791 MB) 0.99x

InlineCache: 22027416 (21.006981 MB) 22083508 (21.060474 MB) 1.00x

FTL: 6575772 (6.271145 MB) 6128080 (5.844193 MB) 0.93x (reduction)

Wasm: 2302724 (2.196049 MB) 2309732 (2.202732 MB) 1.00x

YarrJIT: 1538956 (1.467663 MB) 1536104 (1.464943 MB) 1.00x

CSSJIT: 0 0

Uncategorized: 0 0

Benchmarking was done with Speedometer2 and JetSteam2 on an M1 Mac.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::JITData::size const):
(JSC::CodeBlock::dumpValueProfiles):
(JSC::CodeBlock::setRareCaseProfiles): Deleted.
(JSC::CodeBlock::rareCaseProfileForBytecodeIndex): Deleted.
(JSC::CodeBlock::rareCaseProfileCountForBytecodeIndex): Deleted.

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::likelyToTakeSlowCase): Deleted.
(JSC::CodeBlock::couldTakeSlowCase): Deleted.

  • bytecode/ValueProfile.h:

(JSC::RareCaseProfile::RareCaseProfile): Deleted.
(JSC::getRareCaseProfileBytecodeIndex): Deleted.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::makeSafe):
(JSC::DFG::ByteCodeParser::parseBlock):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileSlowCases):

File:
1 edited

Legend:

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

    r277757 r277758  
    516516    m_callLinkInfoIndex = 0;
    517517
    518     FixedVector<RareCaseProfile> rareCaseProfiles;
    519     if (shouldEmitProfiling())
    520         rareCaseProfiles = FixedVector<RareCaseProfile>(m_bytecodeCountHavingSlowCase);
    521    
    522518    unsigned bytecodeCountHavingSlowCase = 0;
    523519    for (Vector<SlowCaseEntry>::iterator iter = m_slowCases.begin(); iter != m_slowCases.end();) {
     
    530526        const Instruction* currentInstruction = m_codeBlock->instructions().at(m_bytecodeIndex).ptr();
    531527       
    532         RareCaseProfile* rareCaseProfile = nullptr;
    533         if (shouldEmitProfiling())
    534             rareCaseProfile = &rareCaseProfiles.at(bytecodeCountHavingSlowCase);
    535 
    536528        if (JITInternal::verbose)
    537529            dataLogLn("Baseline JIT emitting slow code for ", m_bytecodeIndex, " at offset ", (long)debugOffset());
     
    648640        RELEASE_ASSERT_WITH_MESSAGE(firstTo.offset() == (iter - 1)->to.offset(), "Too many jumps linked in slow case codegen.");
    649641       
    650         if (shouldEmitProfiling())
    651             add32(TrustedImm32(1), AbsoluteAddress(&rareCaseProfile->m_counter));
    652 
    653642        emitJumpSlowToHot(jump(), 0);
    654643        ++bytecodeCountHavingSlowCase;
     
    663652    RELEASE_ASSERT(m_privateBrandAccessIndex == m_privateBrandAccesses.size());
    664653    RELEASE_ASSERT(m_callLinkInfoIndex == m_callCompilationInfo.size());
    665 
    666     if (shouldEmitProfiling())
    667         m_codeBlock->setRareCaseProfiles(WTFMove(rareCaseProfiles));
    668654
    669655#ifndef NDEBUG
Note: See TracChangeset for help on using the changeset viewer.