Move is-lazy state from JSFunction to BaseScript
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(4 files)
To advance Bug 1529456, we can try to replace the JSFunction::isInterpretedLazy() logic with a IsLazyScript flag on BaseScript. This will remove the eventual-consistency issue of script clones and allow more simplifications in the JITs (since all clones of a function will be non-lazy if we observed the canonical function to be non lazy).
One issue is that LazySelfHosted functions still use the JSFunction::INTERPRETED_LAZY flag. We should consider if expanding the definition of LazySelfHostedScript to include flags is worthwhile to remove branching in the JITs.
Assignee | ||
Comment 1•5 years ago
|
||
These checks are reliant on the details of current lazy-script handling and
interfere with removing the INTERPRETED_LAZY flag so remove them for now.
Assignee | ||
Comment 2•5 years ago
|
||
JSFunction::hasScript is generally replaced by a new JSFunction::hasBytecode
helper. The hasScript case previously also matched incomplete functions so
extra checks are sometimes needed.
Depends on D65030
Assignee | ||
Comment 3•5 years ago
|
||
Replace the INTERPRETED/INTERPRETED_LAZY flag with BASESCRIPT/SELFHOSTLAZY
flags. This delegates more of the responsibility onto the BaseScript itself
and will allow us to combine the lazy and non-lazy script instances in a
single BaseScript.
Depends on D65031
Assignee | ||
Comment 4•5 years ago
|
||
With these patches, the function no longer directly stores the is-lazy state bit. The eventual-consistency of function clones is still an issue though as functions each have a pointer to one of the lazy or non-lazy BaseScript. Once those instances are shared, this all becomes much simpler though.
Assignee | ||
Comment 6•5 years ago
|
||
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/887c5a9b2bd0
https://hg.mozilla.org/mozilla-central/rev/1d5e317c2f05
https://hg.mozilla.org/mozilla-central/rev/a7f70eb61210
https://hg.mozilla.org/mozilla-central/rev/122b34044596
Description
•