Refactor GC data traversal loops

Previusly, to redce stack usage GC traversed object properties and array
elements in both directions. At first, it seeked backward from the last
element, to find the last refcounted zval. Then, it traversed elements
forward. As result, we had 2 non-spatial memory accesses for each
object/array and usuall 2 expensive CPU cache misses.

Now all the traversal algorithms are refactored to scan elements only in
forward direction. The number of checks and GC stack usage should be the
same. The order of element processing may be differenr, but this
should not be a problem.
This commit is contained in:
Dmitry Stogov 2021-11-24 20:38:00 +03:00
parent 885f935090
commit 4b4b9edcc0

File diff suppressed because it is too large Load diff