Closed Bug 1591600 Opened 5 years ago Closed 5 years ago

Move is-lazy state from JSFunction to BaseScript

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla75
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.

Depends on: 1618606

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.

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

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

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.

Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/887c5a9b2bd0 Remove AutoAssertFunctionDelazificationCompletion r=mgaudet https://hg.mozilla.org/integration/autoland/rev/1d5e317c2f05 Remove uses of JSFunction::hasScript/hasLazyScript r=mgaudet https://hg.mozilla.org/integration/autoland/rev/a7f70eb61210 Replace JSFunction INTERPRETED_LAZY flag r=mgaudet
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/122b34044596 Follow-up clang-format fix in JSFunction.cpp. r=mgaudet
Regressions: 1621956
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: