Closed Bug 1889509 Opened 2 years ago Closed 2 years ago

Allow rope flattening to convert a tenured extensible string into dependent string with a nursery base as long as the extensible string is not being used

Categories

(Core :: JavaScript Engine, enhancement)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: sfink, Unassigned)

References

Details

That's a long title. If/when bug 1879918 lands, it will prevent the rope flattening optimization where we use a leftmost leaf's extensible chars buffer for the root node and transform it into a dependent string of the root, but only when the leftmost leaf is tenured and the rope root is in the nursery. This is because there might be other strings depending on the extensible string, and the optimization would produce a tenured -> tenured -> nursery dependency chain where if the nursery string's chars are moved or freed, the two tenured strings' chars pointers will be invalidated. The patch will fix up the case where the edge crosses the tenured -> nursery boundary, but the tenured -> tenured edge is not tracked and so cannot be handled during a minor GC.

Anyway, the bug here is to allow this optimization if the extensible string is known to have no dependents. A bit tracking this information is being added in bug 1881995.

I fixed some bugs in bug 1879918, and I've changed my mind: now it keeps using the non-deduplicatable bit to handle the T -> T -> N case, so the rope flattening optimization is no longer conditional on the heaps involved. As a result, the change in this patch is no longer needed.

This does mean that I will not be able to stop using up a string bit for the NON_DEDUP_BIT, but at least I've moved it off to bit 15. Previously I had talked about eliminating its use altogether, but that would require disabling the flattening optimization plus some additional work, and this seems less error-prone. If we really need another string bit, we could recapture one from here.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.