• fpizlo@apple.com's avatar
    OSR exit profiling should be robust against all code being cleared · 501e606b
    fpizlo@apple.com authored
    Reviewed by Michael Saboff.
    The problem here is two-fold:
    1) A watchpoint (i.e. ProfiledCodeBlockJettisoningWatchpoint) may be fired after we
    have cleared the CodeBlock for all or some Executables.  This means that doing
    codeBlock->baselineVersion() would either crash or return a bogus CodeBlock, since
    there wasn't a baseline code block reachable from the Executable anymore.  The
    solution is that we shouldn't be asking for the baseline code block reachable from
    the owning executable (what baselineVersion did), but instead we should be asking
    for the baseline version reachable from the code block being watchpointed (basically
    what CodeBlock::alternative() did).
    2) If dealing with inlined code, baselienCodeBlockForOriginAndBaselineCodeBlock()
    may return null, for the same reason as above - we might have cleared the baseline
    codeblock for the executable that was inlined.  The solution is to just not do
    profiling if there isn't a baseline code block anymore.
    * bytecode/CodeBlock.cpp:
    * bytecode/CodeBlock.h:
    * bytecode/CodeBlockJettisoningWatchpoint.cpp:
    * bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp:
    * dfg/DFGOSRExitBase.cpp:
    * jit/AssemblyHelpers.h:
    * runtime/Executable.cpp:
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CodeBlock.h 47.1 KB