Closed Bug 1674674 Opened 4 years ago Closed 4 years ago

Store ParserAtom HashNumber in XDR buffer

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(3 files)

In order to speed up decoding of XDR atoms data under Stencil, we can consider transcoding the HashNumber as well. With cleaned up APIs, this avoids extra lookups and hash computations.

(Note that this may be superceded by Bug 1674351..)

This is the same code as internChar16Seq if we chose the right
parameterization, so simplify the code a little.

Depends on D95296

We currently assert that XDR'd ParserAtoms are unique, but still use the
slightly slower lookupForAdd APIs. Instead, the patch uses putNew which
avoids an extra comparison on hash collisions.

Also greatly simplify the Char16LE case which is only used for XDR and can
safely assume no static strings or non-wide atoms are passed.

Depends on D95464

Include the HashNumber in XDR data so we don't need to recompute it and can
speed up interning of these known-to-be-unique ParserAtoms.

Depends on D95465

Attachment #9185064 - Attachment description: Bug 1674674 - Remove ParserAtomsTable::internLatin1Seq → Bug 1674674 - Remove ParserAtomsTable::internLatin1Seq. r?arai!
Attachment #9185065 - Attachment description: Bug 1674674 - Use HashSet::putNew when interning ParserAtom for XDR → Bug 1674674 - Use HashSet::putNew when interning ParserAtom for XDR. r?arai!
Attachment #9185066 - Attachment description: Bug 1674674 - Transcode HashNumber for ParserAtoms → Bug 1674674 - Transcode HashNumber for ParserAtoms. r?arai!
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a330801f559c Remove ParserAtomsTable::internLatin1Seq. r=arai https://hg.mozilla.org/integration/autoland/rev/d2ae6815200e Use HashSet::putNew when interning ParserAtom for XDR. r=arai https://hg.mozilla.org/integration/autoland/rev/124f21669453 Transcode HashNumber for ParserAtoms. r=arai
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3c0d21f3e344 Remove ParserAtomsTable::internLatin1Seq. r=arai https://hg.mozilla.org/integration/autoland/rev/214b47b0c334 Use HashSet::putNew when interning ParserAtom for XDR. r=arai https://hg.mozilla.org/integration/autoland/rev/c06546640185 Transcode HashNumber for ParserAtoms. r=arai

I added an ifdef guard around the static_asserts. The has_unique_object_representations method should be available in C++17, but there is something weird in the base-toolchains-clang build.

Flags: needinfo?(tcampbell)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: