Change rope flattening to not overwrite cell header data
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
Details
Attachments
(4 files)
Currently rope flattening traverses the DAG of ropes without using extra storage by storing the parent pointer of an internal node (plus flags) over the cell header field. This is complicated and surprising, and it is also a problem for incremental marking because off-thread marking can't trust the string flag bits to be correct.
I investigated using another approach which does use external storage but this caused a performance regression on the octane PdfJS benchmark which flattens rope DAGs that are thousands of nodes in size.
Instead it should be possible to use a different field to hold the temporary parent pointer, and doing so would be much less troublesome.
Assignee | ||
Comment 1•4 years ago
|
||
This moves the part that sets the charater data pointer to finish_node as this
also shares this field. We pass the parent pointer (and flags) into
first_visit_node and set these after we've extracted the left child pointer.
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D113316
Comment 4•4 years ago
|
||
Backed out for causing failures in PreWriteBarrierDuringFlattening
Backout link: https://hg.mozilla.org/integration/autoland/rev/e3136f372f53893814058f92df0c80311cba2460
Assignee | ||
Comment 5•4 years ago
|
||
This is unnecessary and was causing problems. We can leave the leftmost rope to
be handled in the same way as all the other ropes, and move the special case to
just avoid copying the chars when reusing the leftmost buffer.
The problem was that now we always barrier ropes, before overwriting the left
child pointer with the parent pointer. If this happens during incremental GC we
must ensure we haven't already overwritten this pointer we the buffer pointer.
This patch also moves changing the leftmost string into a dependent string
until the end.
Depends on D113316
Assignee | ||
Comment 6•4 years ago
|
||
These already check whether the associated cell is tenured so we can remove the extra checks.
Depends on D113317
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a47a2921119c
https://hg.mozilla.org/mozilla-central/rev/1d6f87631df7
https://hg.mozilla.org/mozilla-central/rev/abfa26f32f96
https://hg.mozilla.org/mozilla-central/rev/d9c03de42812
Assignee | ||
Updated•4 years ago
|
Description
•