Bug 64388 - COLLECT_ON_EVERY_ALLOCATION no longer works
Summary: COLLECT_ON_EVERY_ALLOCATION no longer works
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-12 13:59 PDT by Filip Pizlo
Modified: 2011-07-12 15:35 PDT (History)
1 user (show)

See Also:


Attachments
the patch (5.62 KB, patch)
2011-07-12 15:00 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (fix style) (5.61 KB, patch)
2011-07-12 15:06 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2011-07-12 13:59:24 PDT
The GC allocation path breaks if COLLECT_ON_EVERY_ALLOCATION is set.  This occurs for two reasons:

1) To collect we need JSGlobalData to be initialized, but to be initialized, JSGlobalData must perform allocations.

2) Even if this is side-stepped, the Heap::allocate() handles allocation slow cases by calling itself recursively, which always results in another forced collection if COLLECT_ON_EVERY_ALLOCATION is set.  But allocating after a collection requires the slow path to be taken.  Hence, COLLECT_ON_EVERY_ALLOCATION causes every allocation to recurse ad infinitum, invoking a full heap GC every time.
Comment 1 Filip Pizlo 2011-07-12 15:00:22 PDT
Created attachment 100568 [details]
the patch
Comment 2 WebKit Review Bot 2011-07-12 15:02:34 PDT
Attachment 100568 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1

Source/JavaScriptCore/heap/Heap.h:139:  The parameter name "sizeClass" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Filip Pizlo 2011-07-12 15:06:01 PDT
Created attachment 100571 [details]
the patch (fix style)
Comment 4 WebKit Review Bot 2011-07-12 15:35:54 PDT
Comment on attachment 100571 [details]
the patch (fix style)

Clearing flags on attachment: 100571

Committed r90865: <http://trac.webkit.org/changeset/90865>
Comment 5 WebKit Review Bot 2011-07-12 15:35:58 PDT
All reviewed patches have been landed.  Closing bug.