Bug 120179 - JSObject and JSArray code shouldn't have to tiptoe around garbage collection
Summary: JSObject and JSArray code shouldn't have to tiptoe around garbage collection
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on:
Blocks: 121074
  Show dependency treegraph
 
Reported: 2013-08-22 16:22 PDT by Mark Hahnenberg
Modified: 2013-09-12 10:58 PDT (History)
1 user (show)

See Also:


Attachments
Patch (10.81 KB, patch)
2013-08-22 16:25 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2013-08-22 16:22:41 PDT
There are many places in the code for JSObject and JSArray where they are manipulating their Butterfly/Structure, e.g. after expanding their out-of-line backing storage via allocating. Within these places there are certain "critical sections" where a GC would be disastrous. Gen GC looks like it will make this dance even more intricate. To make everybody's lives easier we should use the DeferGC mechanism in these functions to make these GC critical sections both obvious in the code and trivially safe. Deferring collections will usually only last marginally longer, thus we should not incur any additional overhead.
Comment 1 Mark Hahnenberg 2013-08-22 16:25:12 PDT
Created attachment 209405 [details]
Patch
Comment 2 Mark Hahnenberg 2013-08-22 16:25:30 PDT
Still running benchmarks.
Comment 3 Geoffrey Garen 2013-08-22 16:41:29 PDT
Comment on attachment 209405 [details]
Patch

If we used DeferGC when creating JS objects, we could remove the whole "finishConstruction" dance and switch back to normal C++ constructors.
Comment 4 WebKit Commit Bot 2013-08-22 17:44:34 PDT
Comment on attachment 209405 [details]
Patch

Clearing flags on attachment: 209405

Committed r154471: <http://trac.webkit.org/changeset/154471>
Comment 5 WebKit Commit Bot 2013-08-22 17:44:36 PDT
All reviewed patches have been landed.  Closing bug.