Closed Bug 1840797 Opened 1 year ago Closed 1 year ago

Optimise String.prototype.{is,to}WellFormed

Categories

(Core :: JavaScript: Standard Library, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Perform the following optimisations:

  • Don't linearise Latin-1 strings.
  • Use InlineCharBuffer to avoid heap allocations for small strings.
  • Return the result of Utf16ValidUpTo from IsStringWellFormedUnicode so we can skip the initial characters when calling EnsureUtf16ValiditySpan.
  • Don't try to deflate non-wellformed strings, because they will always contain the replacement character and therefore can't be stored as Latin-1 strings.

Perform the following optimisations:

  • Don't linearise Latin-1 strings.
  • Use InlineCharBuffer to avoid heap allocations for small strings.
  • Return the result of Utf16ValidUpTo from IsStringWellFormedUnicode so we
    can skip the initial characters when calling EnsureUtf16ValiditySpan.
  • Don't try to deflate non-wellformed strings, because they will always contain
    the replacement character and therefore can't be stored as Latin-1 strings.

Also add some additional tests to cover string types which aren't tested in
the test262 tests.

Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/777551a9013e Optimise String.prototype.{is,to}WellFormed. r=allstarschh
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: