Use flags instead of JSScript::lazyScript to compute relazification conditions
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox76 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(2 files)
The JSScript::lazyScript
field will be removed soon, but it often served an indirect purpose of preventing relazification in complex edge cases.
This patch changes the NoNotRelazify flag into AllowRelazify and moves to more of a whitelist model.
Assignee | ||
Comment 1•5 years ago
|
||
When using the relazifyFunctions
testing method, we mark live scripts on
stack as DoNotRelazify. Previously we would clear this flag after the
operation was done, but this may conflict with other uses of the flag, such
as the debugger. Only rare test-only code is affected.
Assignee | ||
Comment 2•5 years ago
|
||
Replace the DoNotRelazify flag with AllowRelazify. This flag is set during
delazification (self-hosted-cloning or normal) of a script if
isRelazifiable(). This avoids relying on if JSScript::lazyScript is non-null,
which is important because that field will be removed soon. We also inline
JSScript::canRelazify() into its caller.
Note that previous uses of the DoNotRelazify flag simply clear the new flag
and things work as expected, even if an associated LazyScript exists.
The XDR code is updated to rely on this AllowRelazify flag to decide if the
LazyScript should be transcoded. This gives more predictable behaviour
between the debugger and XDR.
Depends on D65904
Comment 4•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/94cb6a1d0fe1
https://hg.mozilla.org/mozilla-central/rev/5ad850ffdb3f
Assignee | ||
Comment 5•5 years ago
|
||
There is a 1kB js-content-base regression due to named self-hosted functions that are only used internally. Previously they would be relazified but after this patch they are not. See [1] for where the call to setAllowRelazify()
is potentially missing. This probably can be fixed as well as allowing inner-functions from self-hosted to be cloned (a new feature).
Description
•