Last Comment Bug 711095 - make GC scanning compatible with the incremental GC
: make GC scanning compatible with the incremental GC
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla11
Assigned To: Igor Bukanov
: Jason Orendorff [:jorendorff]
Depends on: 708382
  Show dependency treegraph
Reported: 2011-12-15 08:38 PST by Igor Bukanov
Modified: 2013-09-21 11:41 PDT (History)
11 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

v1 (12.29 KB, patch)
2011-12-15 08:40 PST, Igor Bukanov
wmccloskey: review+
Details | Diff | Splinter Review

Description User image Igor Bukanov 2011-12-15 08:38:36 PST
This is a follow up for the bug 641025 comment 24.

The GC marking optimizations for the bug 708382 are not compatible with the incremental GC. As code pushes pointers into the slot array and, between incremental GC slices, the array can be relocated, it is not possible to restart marking for the object that owns the slot array.

This patch fixes that through pushing (obj, start, end) triples, not just (start, end) pairs. This way the incremental GC, when restarting the marking, can replaces all such triples on the stack with just obj restarting the scanning for the object.

This arrangement also allow to simplify the code. Currently, when pushing the array into the stack fails, the code has to delay scanning for all objects in the array. But with the owner object for the array available the delayed scanning can be triggered on the object itself. 

As this this simplification and related cleanup (like tail recursion elimination for dense array elements) make the marking code to run about 2-3% faster, I factor that into separated bug independent from incremental GC work.
Comment 1 User image Igor Bukanov 2011-12-15 08:40:27 PST
Created attachment 581985 [details] [diff] [review]
Comment 2 User image Bill McCloskey (:billm) 2011-12-15 09:56:07 PST
Comment on attachment 581985 [details] [diff] [review]

Thanks. This looks nice.
Comment 4 User image Ed Morley [:emorley] 2011-12-16 05:58:55 PST
Comment 5 User image :Ms2ger (⌚ UTC+1/+2) 2011-12-16 05:58:55 PST

Note You need to log in before you can comment on or make changes to this bug.