Skip to content
  • oliver@apple.com's avatar
    fourthTier: Fix some minor issues in the DFG's profiling of heap accesses · 1622cae4
    oliver@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=113010
    
    Reviewed by Goeffrey Garen.
    
    Carefully merge r146669 from trunk. This required some fiddling since it
    wasn't a clean apply.
    
    Original changelog:
    
        1) If a CodeBlock gets jettisoned by GC, we should count the exit sites.
    
        2) If a CodeBlock clears a structure stub during GC, it should record this, and
        the DFG should prefer to not inline that access (i.e. treat it as if it had an
        exit site).
    
        3) If a PutById was seen by the baseline JIT, and the JIT attempted to cache it,
        but it chose not to, then assume that it will take slow path.
    
        4) If we frequently exited because of a structure check on a weak constant,
        don't try to inline that access in the future.
    
        5) Treat all exits that were counted as being frequent.
    
        81% speed-up on Octane/gbemu. Small speed-ups elsewhere, and no regressions.
    
    * bytecode/CodeBlock.cpp:
    (JSC::CodeBlock::finalizeUnconditionally):
    (JSC):
    (JSC::CodeBlock::resetStubDuringGCInternal):
    (JSC::CodeBlock::reoptimize):
    (JSC::CodeBlock::jettison):
    (JSC::ProgramCodeBlock::jettisonImpl):
    (JSC::EvalCodeBlock::jettisonImpl):
    (JSC::FunctionCodeBlock::jettisonImpl):
    (JSC::CodeBlock::tallyFrequentExitSites):
    * bytecode/CodeBlock.h:
    (CodeBlock):
    (JSC::CodeBlock::tallyFrequentExitSites):
    (ProgramCodeBlock):
    (EvalCodeBlock):
    (FunctionCodeBlock):
    * bytecode/GetByIdStatus.cpp:
    (JSC::GetByIdStatus::computeFor):
    * bytecode/PutByIdStatus.cpp:
    (JSC::PutByIdStatus::computeFor):
    * bytecode/StructureStubInfo.h:
    (JSC::StructureStubInfo::StructureStubInfo):
    (StructureStubInfo):
    * dfg/DFGByteCodeParser.cpp:
    (JSC::DFG::ByteCodeParser::handleGetById):
    (JSC::DFG::ByteCodeParser::parseBlock):
    * dfg/DFGOSRExitBase.cpp:
    (JSC::DFG::OSRExitBase::considerAddingAsFrequentExitSiteSlow):
    * dfg/DFGOSRExitBase.h:
    (JSC::DFG::OSRExitBase::considerAddingAsFrequentExitSite):
    (OSRExitBase):
    * jit/JITStubs.cpp:
    (JSC::DEFINE_STUB_FUNCTION):
    * runtime/Options.h:
    (JSC):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    1622cae4