Files
Emilio Cobos Álvarez fe182cca64 Bug 2025271 - Simplify DOMString. r=smaug,nika,extension-reviewers,core-sessionstore-reviewers,dom-worker-reviewers,robwu,asuth
Make DOMString a regular nsAutoTString with some special methods for
performance in some hot getters. For that, we need to change a bit
nsTString:

 * Support for unowned buffers: Owned buffers now are represented by
   STRINGBUFFER|OWNED flags, rather than REFCOUNTED.

 * Inlining of the destructor: It showed up in profiles, it's also just
   a few instructions, so probably worth it. We could OOL the owned path
   I guess, if we wanted to.

 * Inlinling and reordering of NonVoidStringToJsval. Old code had
   special DOMString path inline with [buffer, literal, copy] paths,
   then out of line code with [literal, buffer, copy]. Instead,
   consolidate everything in a [buffer, literal, copy] inline path.
   Do the same for UTF8/Latin1 strings too for consistency.

Differential Revision: https://phabricator.services.mozilla.com/D288148
2026-04-13 09:33:54 +00:00
..
…