Bug 133103 - operationOptimize() should defer the GC for a while
Summary: operationOptimize() should defer the GC for a while
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
Keywords: InRadar
Depends on:
Reported: 2014-05-19 18:34 PDT by Mark Lam
Modified: 2014-05-19 19:04 PDT (History)
7 users (show)

See Also:

the patch. (3.10 KB, patch)
2014-05-19 18:58 PDT, Mark Lam
fpizlo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
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>