Bug 206401

Summary: [JSC] Eagerly purging JIT code when VM::deleteAllCode is executed
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: NEW ---    
Severity: Normal CC: saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Yusuke Suzuki 2020-01-17 00:02:43 PST
Is it worth trying?
Comment 1 Saam Barati 2020-01-17 00:08:49 PST
What do you mean by purging?
Comment 2 Yusuke Suzuki 2020-01-17 00:09:36 PST
(In reply to Saam Barati from comment #1)
> What do you mean by purging?

Destroying JITData / Baseline JIT code eagerly before collection and incremental sweeping happens.
Comment 3 Saam Barati 2020-01-17 00:11:35 PST
(In reply to Yusuke Suzuki from comment #2)
> (In reply to Saam Barati from comment #1)
> > What do you mean by purging?
> 
> Destroying JITData / Baseline JIT code eagerly before collection and
> incremental sweeping happens.

Sounds reasonable
Comment 4 Saam Barati 2020-01-17 00:12:17 PST
Why do we need to do it before collection? Maybe we can make it hook into the baseline throw away code I’m going to write?
Comment 5 Yusuke Suzuki 2020-01-17 00:37:40 PST
(In reply to Saam Barati from comment #4)
> Why do we need to do it before collection? Maybe we can make it hook into
> the baseline throw away code I’m going to write?

To quickly shrink the heap if memory-warning is emitted (memory-warning is emitted, then we should shrink size quickly. We are destroying code a bit indirectly, which means, clearing reference, and scheduling a GC. But we can gain memory more directly without waiting later GC & incremental sweeping.)