Cleanup the IonScript data structure
Categories
(Core :: JavaScript Engine: JIT, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(6 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
This is a complex data structure with ten different trailing arrays. We can clean it up similar to what we did for ImmutableScriptData.
- Introduce a
js::TrailingArray
mixin class to share theoffsetToPointer
related helpers. - Cleanup
IonScript
using this. - Add
CodegenSafepointIndex
to avoid wasted space inSafepointIndex
that is stored in the IonScript. This also simplifies the code.
Assignee | ||
Comment 1•4 years ago
|
||
This saves 8-bytes per SafepointIndex
and 32-bytes per IonScript
.
Assignee | ||
Comment 2•4 years ago
|
||
This is used during codegen only so we can simplify the SafepointIndex that
is stored in the IonScript. The resolve method is replaced by a constructor
from CodegenSafepointIndex to SafepointIndex.
Assignee | ||
Comment 3•4 years ago
|
||
This type is a mixin with helper methods for casting and initializing arrays
that follow a struct in the same allocation. Use this for existing JitScript,
PrivateScriptData, RuntimeScriptData, ImmutableScriptData types.
Depends on D72671
Assignee | ||
Comment 4•4 years ago
|
||
Also initialize more of the required fields in the constructor directly
instead of the New method.
Depends on D72672
Assignee | ||
Comment 5•4 years ago
|
||
Order the trailing arrays by descending alignment requirements and use a
similar approach to JitScript for computing sizes and initializing.
Depends on D72673
Assignee | ||
Comment 6•4 years ago
|
||
Use helper methods to access the size and length of each trailing array.
We shave 40 bytes off each IonScript by using the difference between two
arrays to compute size rather than storing a dedicated size field.
Depends on D72674
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D72675
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cfb27a4b9c64 Add js::jit::CodegenSafepointIndex type. r=jandem https://hg.mozilla.org/integration/autoland/rev/e09970404687 Add js::TrailingArray type for script data structures. r=jandem https://hg.mozilla.org/integration/autoland/rev/b73154f817cd Use field initializers for js::jit::IonScript. r=jandem https://hg.mozilla.org/integration/autoland/rev/6158f69d21c7 Reorder IonScript arrays to avoid padding. r=jandem https://hg.mozilla.org/integration/autoland/rev/5d3704bf89d5 Use offsets to delimit arrays in IonScript. r=jandem https://hg.mozilla.org/integration/autoland/rev/338977019069 Cleanup IonScript parameter name mismatches. r=jandem
Comment 9•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cfb27a4b9c64
https://hg.mozilla.org/mozilla-central/rev/e09970404687
https://hg.mozilla.org/mozilla-central/rev/b73154f817cd
https://hg.mozilla.org/mozilla-central/rev/6158f69d21c7
https://hg.mozilla.org/mozilla-central/rev/5d3704bf89d5
https://hg.mozilla.org/mozilla-central/rev/338977019069
Description
•