Bug 148047

Summary: Allow the garbage collector to clear code while compilation is in flight
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: New BugsAssignee: Geoffrey Garen <ggaren>
Status: NEW ---    
Severity: Normal CC: fpizlo, kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ggaren: review-

Description Geoffrey Garen 2015-08-14 16:57:29 PDT
Allow the garbage collector to clear code while compilation is in flight
Comment 1 Geoffrey Garen 2015-08-14 17:00:16 PDT
Created attachment 259058 [details]
Patch
Comment 2 Geoffrey Garen 2015-08-14 17:03:46 PDT
Updated ChangeLog:

2015-08-14  Geoffrey Garen  <ggaren@apple.com>

        Allow the garbage collector to clear code while compilation is in flight
        https://bugs.webkit.org/show_bug.cgi?id=148047

        Reviewed by NOBODY (OOPS!).

        Anecdotal evidence shows that a burst of activity can run the GC before
        all compilation completes. So, our rule that GC can't clear code
        during compilation means that GC almost never gets an opportunity to
        clear code.

        Refine this rule to be per-executable rather than global.

        * dfg/DFGWorklist.cpp:
        (JSC::DFG::Worklist::gatherActiveCompilations):
        * dfg/DFGWorklist.h: Added a helper for identifying active compilations.

        * heap/Heap.cpp:
        (JSC::Heap::deleteAllCompiledCode): We can honor the rule that we don't
        clear while compiling by checking each executable individually.
Comment 3 Saam Barati 2015-08-18 13:53:51 PDT
Comment on attachment 259058 [details]
Patch

r=me
Comment 4 Geoffrey Garen 2015-08-19 18:12:16 PDT
Comment on attachment 259058 [details]
Patch

This patch is wrong because it is not safe in our current design to throw away one CodeBlock if you do not throw away all CodeBlocks. Residual links through OSR exit will become stale.