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.
Created attachment 581985 [details] [diff] [review]
Comment on attachment 581985 [details] [diff] [review]
Thanks. This looks nice.