Closed Bug 1589904 Opened 1 year ago Closed 1 year ago

Remove LazyScript/JSScript::functionDelazifying and friends


(Core :: JavaScript Engine, task, P2)




Tracking Status
firefox72 --- fixed


(Reporter: tcampbell, Assigned: tcampbell)




(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

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
Remove JSScript::ensureNonLazyCanonicalFunction() r=jandem
Remove JSScript::functionDelazifying() r=jandem
Remove JSScript::functionNonDelazifying() r=jandem
Remove LazyScript::functionDelazifying() r=jandem
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.