Closed Bug 1659140 Opened 4 years ago Closed 4 years ago

Move string optimisations for MCharCodeAt and MCompare to GVN and handle non-Latin1 characters in LoadStringCharResult

Categories

(Core :: JavaScript Engine: JIT, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

  • Move IonBuilder::inlineConstantCharCodeAt to MCharCodeAt::foldsTo
  • Move IonBuilder::compareTryCharacter into MCompare::foldsTo
  • LoadStringCharResult only handles Latin-1 characters, which prevents any kind of optimisations in Warp.

This optimisation was added in bug 1041781 and still seems useful to have.

Implement MCompare::tryFoldCharCompare to port the improvements from
bug 813836 and bug 1538690. This wasn't previously handled through foldsTo,
because relational comparison support for strings (bug 1538692) wasn't present
at that point of time.

Depends on D87098

Part 4 will add compiler specific changes to these methods.

Depends on D87099

Restricting LoadStringCharResult to Latin-1 characters means Warp won't be
able to optimise accesses when Two-Byte characters are present. Instead slow
generic VM calls were used for string accesses.

Depends on D87100

Severity: -- → N/A
Priority: -- → P2
Pushed by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/baa5e9e7693a
Part 1: Implement constant charCodeAt optimisation through MCharCodeAt::foldsTo. r=jandem
https://hg.mozilla.org/integration/autoland/rev/5652de79848b
Part 2: Optimise string comparisons in Warp. r=jandem
https://hg.mozilla.org/integration/autoland/rev/602ac0c1f5f1
Part 3: Change LoadStringCharResult to an unshared CacheIR op. r=jandem
https://hg.mozilla.org/integration/autoland/rev/a82a8610a2f9
Part 4: Use VM calls for non-Latin1 characters in LoadStringCharResult. r=jandem

Random question, is there any GC concerns on the fact that we are potentially manipulating the memory from an Helper thread, when running with foldsTo, while it could be manipulated on the main thread? (such as ensureLinear for example?)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: