Closed Bug 1899160 Opened 4 months ago Closed 3 months ago

Make it possible to allocate JSStrings with a refcounted StringBuffer in the shell

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

Attachments

(2 files, 1 obsolete file)

Add support for allocating JS strings with refcounted buffers to the newString testing function.

Attached file WIP: Bug 1899160 - WIP (obsolete) —
Severity: -- → N/A
Priority: -- → P1

This adds initial support for JS strings that have a refcounted mozilla::StringBuffer
instead of a raw malloc buffer.

The newString testing function has two new options. This lets us allocate a new JS string
with a new buffer or a new JS string that reuses the underlying string buffer.

After this we can start using this to replace external strings. We can also allocate more JS
strings with StringBuffers instead of raw malloc buffers.

Whiteboard: [sp3]
Attachment #9404132 - Attachment is obsolete: true
Attachment #9404771 - Attachment description: Bug 1899160 - Add support for allocating JS strings with a refcounted StringBuffer. r?sfink! → Bug 1899160 part 1 - Add support for allocating JS strings with a refcounted StringBuffer. r?sfink!

We already avoid calling AssertJSStringBufferInCorrectArena when creating a JS string with
a StringBuffer, but we weren't handling this case when moving dependent strings.

This patch changes relocateNonInlineChars to relocateBaseAndChars so we can check
for this case there.

Blocks: 1903037
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/04287c05c925
part 1 - Add support for allocating JS strings with a refcounted StringBuffer. r=sfink
https://hg.mozilla.org/integration/autoland/rev/bac40907d2f0
part 2 - Fix string arena assertion for dependent strings backed by a StringBuffer. r=sfink
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: