Use TaggedParserAtomIndex everywhere and remove ParserAtomEntry::index_ field
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox87 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
(Blocks 1 open bug)
Details
Attachments
(37 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
ParserAtomEntry contains index_ field, to get TaggedParserAtomIndex from ParserAtom pointer.
this is used while converting frontend-internal data to stencil, and also used while stencil instantiation/XDR.
If we can replace all ParserAtom* fields/variables with TaggedParserAtomIndex, we get:
- on-memory size reduction, especially in ParseNode
- single
ParserAtomEntryinstance can be shared between multiple tables- helps bug 1687094, for XDR data size reduction
| Assignee | ||
Comment 1•4 years ago
|
||
The plan is the following:
- rewrite each
ParserAtomconsumer class to receive/returnTaggedParserAtomIndexinstead ofParserAtom/ParserName- this happens gradually and the intermediate state may be somewhat unoptimal
- at the end of this stage,
ParserAtomEntry::toIndexshould be called only after invokingParserAtomsTablemethods
- make
ParserAtomsTablereturnTaggedParserAtomIndexinstead ofParserAtom/ParserName- after this stage, there's only "
TaggedParserAtomIndex->ParserAtom" conversion, and no "ParserAtom->TaggedParserAtomIndex" conversion
- after this stage, there's only "
- remove
ParserAtomEntry::index_field andParserAtomEntry::toIndex
| Assignee | ||
Updated•4 years ago
|
| Assignee | ||
Comment 2•4 years ago
|
||
This seems to work. I'll look into bug 1687094 after this.
| Assignee | ||
Updated•4 years ago
|
| Assignee | ||
Comment 3•4 years ago
|
||
With the raptor yahoo-mail, mail_app_es6_09* JS file's XDR,
my local patch stack reduces the size of atom table part from 1,977,500 bytes to 1,776,884 bytes,
so 200,616 bytes (10%) reduction (~50000 atoms * 4 bytes per each index)
Also this enables us to dedup ParserAtomEntry inside XDR, so we can expect further reduction :)
| Assignee | ||
Comment 4•4 years ago
|
||
To gradually replace all consumers, provide both ParserAtom/ParserName accessor
and TaggedParserAtomIndex accessor.
ParserAtom/ParserName accessor will be removed later, and TaggedParserAtomIndex
accessor's Index suffix will be removed later.
| Assignee | ||
Comment 5•4 years ago
|
||
Depends on D102532
| Assignee | ||
Comment 6•4 years ago
|
||
Also add ParserAtomsTable::markUsedByStencil method to hide ParserAtom pointer.
Depends on D102533
| Assignee | ||
Comment 7•4 years ago
|
||
Given TaggedParserAtomIndex::null() isn't well-known "null",
we should split the namespace.
Also, now that there's no risk of name collision, populate all well-known
indices.
Depends on D102534
| Assignee | ||
Comment 8•4 years ago
|
||
Added TrivialTaggedParserAtomIndex to use TaggedParserAtomIndex in collection
that requires trivial type.
Also move TaggedParserAtomIndexHasher into its own header,
with TrivialTaggedParserAtomIndexHasher, to share between multiple consumers.
Depends on D102535
| Assignee | ||
Comment 9•4 years ago
|
||
Because of VectorPool requirement, the element needs to be pointer size,
so add TrivialPtrSizeTaggedParserAtomIndex, that uses uintptr_t instead of
uint32_t.
Depends on D102536
| Assignee | ||
Comment 10•4 years ago
|
||
Depends on D102537
| Assignee | ||
Comment 11•4 years ago
|
||
Depends on D102538
| Assignee | ||
Comment 12•4 years ago
|
||
Depends on D102539
| Assignee | ||
Comment 13•4 years ago
|
||
Depends on D102540
| Assignee | ||
Comment 14•4 years ago
|
||
Depends on D102541
| Assignee | ||
Comment 15•4 years ago
|
||
Depends on D102542
| Assignee | ||
Comment 16•4 years ago
|
||
IsEscapeFreeStringLiteral is split to each useStrict/useAsm case, in order to
avoid accessing ParserAtom content.
Depends on D102543
| Assignee | ||
Comment 17•4 years ago
|
||
Now NameNode and LoopControlStatement uses TaggedParserAtomIndex in its field.
ParseNode::dump is rewritten to receive ParserBase, to get ParserAtomsTable
access, in order to dump not-well-known atom content.
It also works without ParserAtomsTable (in case ParseNode::dump is directly
called from debugger), but in that case not-well-known is dumped as index.
Depends on D102544
| Assignee | ||
Comment 18•4 years ago
|
||
Depends on D102545
| Assignee | ||
Comment 19•4 years ago
|
||
Depends on D102546
| Assignee | ||
Comment 20•4 years ago
|
||
Depends on D102547
| Assignee | ||
Comment 21•4 years ago
|
||
Also renames TaggedParserAtomIndex-specific accessor to remove Index suffix.
TokenStreamAnyChars::currentName receives ParserAtomsTable to get
ParserAtom, but this change is temporary and will be reverted when removing
ParserAtom/ParserName from TokenStream.
Depends on D102548
| Assignee | ||
Comment 22•4 years ago
|
||
Depends on D102549
| Assignee | ||
Comment 23•4 years ago
|
||
Depends on D102550
| Assignee | ||
Comment 24•4 years ago
|
||
Depends on D102551
| Assignee | ||
Comment 25•4 years ago
|
||
There's inconsistency around compilationState_.getParserAtomAt vs
compilationState_.parserAtoms.getParserAtom.
This will be solved later.
Also removed unused/not-existent functions liftParserAtomToJSAtom and
newFunction.
Depends on D102552
| Assignee | ||
Comment 26•4 years ago
|
||
Depends on D102553
| Assignee | ||
Comment 27•4 years ago
|
||
Depends on D102554
| Assignee | ||
Comment 28•4 years ago
|
||
Depends on D102555
| Assignee | ||
Comment 29•4 years ago
|
||
Depends on D102556
| Assignee | ||
Comment 30•4 years ago
|
||
Depends on D102557
| Assignee | ||
Comment 31•4 years ago
|
||
As a preparation to remove index_ field from ParserAtomEntry,
ParserAtomsTable should maintain a map from ParserAtomEntry pointer to
TaggedParserAtomIndex.
Depends on D102558
| Assignee | ||
Comment 32•4 years ago
|
||
ParserAtomsTable::concatAtoms still receives ParserAtom* range, because we need
character access, and InflatedChar16Sequence needs ParserAtom* range.
Depends on D102559
| Assignee | ||
Comment 33•4 years ago
|
||
Depends on D102560
| Assignee | ||
Comment 34•4 years ago
|
||
Depends on D102561
| Assignee | ||
Comment 35•4 years ago
|
||
As a preparation to remove index_ field, rewrite its consumer to use different
way to get index.
Also, ParserAtomEntry::{toJSAtom, instantiate} receive TaggedParserAtomIndex,
to avoid using its field, but with an assertion for now.
The assertion will be removed later.
In InstantiateMarkedAtoms and XDRParserAtomTable, the atom's index matches the
item's index inside the span, and isUsedByStencil is set only for
not-well-known atoms, so we can just check isUsedByStencil and then use
the index inside the span.
Depends on D102562
| Assignee | ||
Comment 36•4 years ago
|
||
Depends on D102563
| Assignee | ||
Comment 37•4 years ago
|
||
ParserAtomEntry::index_ field is used also to distinguish well-known/static.
We need separate flag, in order to remove the field.
Depends on D102564
| Assignee | ||
Comment 38•4 years ago
|
||
Depends on D102565
| Assignee | ||
Comment 39•4 years ago
|
||
Because CompilationState.parserAtoms.getParserAtom provides the same thing,
removed CompilationState::getParserAtomAt.
Depends on D102566
| Assignee | ||
Comment 40•4 years ago
|
||
Depends on D102567
Comment 41•4 years ago
|
||
Comment 42•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/a295d374f63c
https://hg.mozilla.org/mozilla-central/rev/cf923036a361
https://hg.mozilla.org/mozilla-central/rev/21dae3d1ea01
https://hg.mozilla.org/mozilla-central/rev/f11873f0827c
https://hg.mozilla.org/mozilla-central/rev/721a764c88ea
https://hg.mozilla.org/mozilla-central/rev/48bc889e7f9b
https://hg.mozilla.org/mozilla-central/rev/178975ab315b
https://hg.mozilla.org/mozilla-central/rev/02c07b673b6a
https://hg.mozilla.org/mozilla-central/rev/2b773e770cf6
https://hg.mozilla.org/mozilla-central/rev/d581c6939b6e
https://hg.mozilla.org/mozilla-central/rev/d53977dc05a6
https://hg.mozilla.org/mozilla-central/rev/a3cbfc45580b
https://hg.mozilla.org/mozilla-central/rev/14fc717dea9a
https://hg.mozilla.org/mozilla-central/rev/b55652713ba2
https://hg.mozilla.org/mozilla-central/rev/08e996759dd9
https://hg.mozilla.org/mozilla-central/rev/e53c556bba8c
https://hg.mozilla.org/mozilla-central/rev/c2f48e868180
https://hg.mozilla.org/mozilla-central/rev/e3b13445f55a
https://hg.mozilla.org/mozilla-central/rev/b722d3036840
https://hg.mozilla.org/mozilla-central/rev/0810505263e6
https://hg.mozilla.org/mozilla-central/rev/48bf6019c703
https://hg.mozilla.org/mozilla-central/rev/73ea6560f99d
https://hg.mozilla.org/mozilla-central/rev/b8318cf13b27
https://hg.mozilla.org/mozilla-central/rev/1b8f396bdcb5
https://hg.mozilla.org/mozilla-central/rev/08b75ff379d9
https://hg.mozilla.org/mozilla-central/rev/fc49babba848
https://hg.mozilla.org/mozilla-central/rev/b89b5f731712
https://hg.mozilla.org/mozilla-central/rev/2fa38f16f81a
https://hg.mozilla.org/mozilla-central/rev/21b2349db370
https://hg.mozilla.org/mozilla-central/rev/5d9fb3328608
https://hg.mozilla.org/mozilla-central/rev/cbfc7ec206b4
https://hg.mozilla.org/mozilla-central/rev/7e28576fa2f3
https://hg.mozilla.org/mozilla-central/rev/bb45134f6099
https://hg.mozilla.org/mozilla-central/rev/ff9cadc682f7
https://hg.mozilla.org/mozilla-central/rev/c1189f833fbc
https://hg.mozilla.org/mozilla-central/rev/ba478cc96ac8
https://hg.mozilla.org/mozilla-central/rev/44155b6558c5
Description
•