Move immutable bytecode-related fields from JSScript to SharedScriptData
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox68 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(3 files)
We currently keep scalar fields associated with bytecode compilation results on the JSScript itself, but since SharedScriptData always exists we should move the non-pointer /immutable fields off JSScript.
The primary motivation is memory reduction, especially when we are able to use SharedScriptData across processes. It also is useful if LazyScript and JSScript types get unified.
| Assignee | ||
Comment 1•7 years ago
|
||
As more fields get added to SharedScriptData it becomes more problematic
to check them in hashing function so this changes code to hash raw bytes
of the immutable portion of SharedScriptData itself as well as its
trailing arrays (which currently hash as bytes already).
This redefines those data ranges in terms of mozilla::Span to make it
simpler to work with.
The ScriptBytecodeHasher is renamed to SharedScriptDataHasher to be
clearer about its scope.
The ScriptBytecodeHasher::Lookup struct is removed. The self-hash of a
lookup is only computed once during lookup so it is not necessary for
use to cache the result ourselves.
| Assignee | ||
Comment 2•7 years ago
|
||
The SharedScriptData allocation always exists so moving these immutable
integer fields allows more sharing for memory savings. This adds an
extra dereference in a few paths in the JITs but they are negligable.
| Assignee | ||
Comment 3•7 years ago
|
||
When describing multiple packed arrays that make up a SharedScriptData
we previously saved the length of each array and computed the start of
an array from the other of the others. Instead, this patch records the
offset from |this| to the end of each array. This makes seeking to the
start of an array simpler while still allowing computing the length of
an array as the difference of its start and end offsets.
This patch replaces the SharedScriptData::natoms/noteLength fields with
offsets instead.
Comment 5•7 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/3240bfce551d
https://hg.mozilla.org/mozilla-central/rev/0930e8c0f382
https://hg.mozilla.org/mozilla-central/rev/495c41f92744
Description
•