Bug 133103

Summary: operationOptimize() should defer the GC for a while
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: fpizlo, ggaren, mhahnenberg, mmirman, msaboff, oliver, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
the patch. fpizlo: review+

Description Mark Lam 2014-05-19 18:34:21 PDT
Currently, operationOptimize() only defers the GC until its end.  As a result, a GC may be triggered before we return from operationOptimize(), and it may jettison the optimize codeBlock that we're planning to OSR enter into when we return from this function.  This is because the OSR entry on-ramp code hasn't been executed yet, and hence, there is not yet a reference to this new codeBlock from the stack, and there won't be until we've had a chance to return out of operationOptimize() and run the OSR entry on-ramp code.

This issue can be fixed by using DeferGCForAWhile instead of DeferGC.  This ensures that the GC will be deferred until after the OSR entry on-ramp can be executed.
Comment 1 Mark Lam 2014-05-19 18:35:52 PDT
<rdar://problem/16738067>
Comment 2 Mark Lam 2014-05-19 18:58:18 PDT
Created attachment 231747 [details]
the patch.
Comment 3 Mark Lam 2014-05-19 19:04:45 PDT
Thanks.  Landed in r169094: <http://trac.webkit.org/r169094>