Open Bug 1864086 Opened 2 years ago Updated 2 years ago

Move a string's chars to the malloced heap when copying them for AutoStableStringChars

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

People

(Reporter: sfink, Unassigned)

References

(Blocks 1 open bug)

Details

When AutoStableStringChars is used to access the character data within a string whose buffer is allocated in the nursery, ASSC will malloc a separate buffer and copy the data there. This will happen again every time ASSC is used on that string.

It would speed up later ASSCs as well as the eventual minor GC if the string were re-pointed at the malloced data.

However, this could result in a dependent strings pointing into the nursery data, while their base now points to malloced data. There's nothing fundamentally wrong with this, but both tenuring and deduplication should be audited to make sure this won't break anything.

(And it's kind of a weird state, so it could be stumbled across in other ways too. It might not be worth the complexity.)

(In reply to Steve Fink [:sfink] [:s:] from comment #0)

However, this could result in a dependent strings pointing into the nursery data, while their base now points to malloced data.

Yes, that is pretty surprising.

I'm not sure how often we use ASSCs and whether it's enough to warrant this.

Priority: -- → P3
Blocks: GC.size
Severity: -- → N/A
You need to log in before you can comment on or make changes to this bug.