Closed Bug 1589904 Opened 4 months ago Closed 4 months ago

Remove LazyScript/JSScript::functionDelazifying and friends

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

The 'ensureNonLazyCanonicalFunction', 'functionDelazifying' and 'functionNonDelazifying' methods should all be removed. When we delazify a function, we always first find the canonical function and delazify on that. As a result, live JSScript's should always have a non-lazy canonical function. The ensureNonLazyCanonicalFunction and functionDelazifying methods are always no-ops right now. We already have JSScript::function() which is a wrapper around functionNonDelazifying. We should simplify this all but just using JSScript::function() in places that need it.

When a function is delazified, we always delazify the canonical function
first. As a result, when we have the active JSScript, the JSFunction is
already non-lazy.

The canonical function is already made non-lazy when we generated this
script, so this helper doesn't do anything for us.

Depends on D49836

Replace these calls with JSScript::function() to simplify things. There
should not be a distinction between lazy/non-lazy canonical function
once we already have the JSScript created.

Depends on D49837

Depends on: 1590176
Summary: Remove JSScript::functionDelazifying and friends → Remove LazyScript/JSScript::functionDelazifying and friends
Attachment #9102774 - Attachment description: Bug 1589904 - Remove JSScript::functionNonDelazifying → Bug 1589904 - Remove JSScript::functionNonDelazifying()

Directly use JSFunction::getOrCreateScript at callers instead. This
makes it easier to track why we care about laziness.

Depends on D49838

Replace with LazyScript::function() for the same reasons as removing
JSScript::functionNonDelazifying().

Depends on D50505

The objective in this bug is to remove the various functionDelazifying() related methods from LazyScript/JSScript. In general, the JSFunction::getOrCreateScript method should be used if I script is actually needed. Functions on the stack are not relazified so if you have the JSScript, the canonical function must already point to it. Subsequent bugs will add JSFunction::baseScript() to be used when either LazyScript or JSScript will do.

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fa30ee7c72cd
Remove JSScript::ensureNonLazyCanonicalFunction() r=jandem
https://hg.mozilla.org/integration/autoland/rev/327dacef5a07
Remove JSScript::functionDelazifying() r=jandem
https://hg.mozilla.org/integration/autoland/rev/b6eb13358523
Remove JSScript::functionNonDelazifying() r=jandem
https://hg.mozilla.org/integration/autoland/rev/b415d53def5d
Remove LazyScript::functionDelazifying() r=jandem
https://hg.mozilla.org/integration/autoland/rev/77f62942e8c9
Remove LazyScript::functionNonDelazifying() r=jandem
No longer regressions: 1591921
You need to log in before you can comment on or make changes to this bug.