Bug 64388

Summary: COLLECT_ON_EVERY_ALLOCATION no longer works
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
the patch
none
the patch (fix style) none

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.