nonmoving: A few fixes (9.2)
This fixes several issues identified while looking at #22264.
- Previously the write barrier of
resizeSmallArray#
would incorrectly push empty arrays to the update remembered set. This resulted in invalid pointers on the remembered set. This was the cause of #22931 (closed) . - Previously the nonmoving collector's treatment of weak pointer prevented some weak objects from being finalized, as described in #22327 (closed).
- Previously
setNumCapabilities
could race with the nonmoving mark thread, resulting in unsound behavior (#22926 (closed)) - Previously
setNumCapabililies
could drop the update remembered sets of existing capabilities, resulting in unsound behavior (#22927 (closed)) - Previously the non-moving collector's treatment of the selector optimisation lacked a few necessary write barriers (#22930 (closed))
- Previously the non-moving collector was liable to exhibit unusually high sync pause times in some workloads. We address this with a cheap and cheerful fuel approach to limit serial-marking effort in the sync pause (#22929 (closed))
The weak pointer work was especially involved since it required tightening up quite a few invariants regarding weak object handling. This was a rather involved surgery but I think the result is a significant improvement over the status quo.
Edited by Ben Gamari