Consider handling BaseScript FieldInitializers the same way as enclosing script
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(5 files)
Right now the computation of FieldInitializers is complex because fields may appear after functions and lazy scripts are created. In this bug I'd like to explore handling them the same way we handle the enclosingScope where we using FunctionBox::finish
to do the updates of parent info into lazy children.
This would result in lazy scripts with lazy parents having no field initializer info yet. We would wait until we actually generate bytecode for the script containing the class definition.
Assignee | ||
Comment 1•5 years ago
|
||
It turns out the existing code already had this behaviour indirectly, although without using FunctionBox::finish
. Standardizing this in the finish()
method is still probably the right call. By moving Maybe<FieldInitializers>
to FunctionBox
we can also remove the args from BCE constructor and standardize behaviour.
Assignee | ||
Comment 2•5 years ago
|
||
FieldInitializers for a lazy function are setup when the parent script is
bytecode compiled rather than when a lazy script is allocated.
Assignee | ||
Comment 3•5 years ago
|
||
This new field is then used to update any existing lazy inner function during
FunctionBox::finish. This avoids mutating inactive functions while
delazifying their parents until we get to FunctionBox::finish.
Depends on D70722
Assignee | ||
Comment 4•5 years ago
|
||
This extends the lifetime from BCE to SharedContext which fits in a lot
better with our deferred allocation story. Due to previous patch, we init the
FunctionBox copy of FieldInitializers before the BCE instance runs which
simplifies things here.
Depends on D70723
Assignee | ||
Comment 5•5 years ago
|
||
Depends on D70724
Assignee | ||
Comment 6•5 years ago
|
||
Depends on D70725
Comment 9•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/627464289bcf
https://hg.mozilla.org/mozilla-central/rev/423826a12ca2
https://hg.mozilla.org/mozilla-central/rev/954dd7ba99a3
https://hg.mozilla.org/mozilla-central/rev/0ec9abd4944f
https://hg.mozilla.org/mozilla-central/rev/c289ac40b546
Description
•