Code generation for field decorators
Categories
(Core :: JavaScript Engine, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox112 | --- | fixed |
People
(Reporter: dminor, Assigned: dminor)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files, 4 obsolete files)
Code generation for decorators is likely to be complicated, so we'll split it into multiple bugs. This bug covers code generation for field decorators.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
Depends on D164093
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D164094
Assignee | ||
Comment 4•2 years ago
|
||
This was added to the test when it looked like we needed to add a new
bytecode for decorators, but we didn't end up adding a bytecode,
and so this is not necessary.
Assignee | ||
Comment 5•2 years ago
|
||
This breaks up the large emitApplyDecoratorsToElementDefinition method in
to smaller pieces to improve readability and avoid duplicated code when
we add emitApplyDecoratorsToFieldDefinition in the next patch in the
series.
Depends on D170520
Assignee | ||
Comment 6•2 years ago
|
||
This adds support for calling field decorators. Field decorators can potentially
add additional initializers that will be called when initializing a field. We
can't know the number of initializers that will be added until runtime, so it's
necessary to append these new initializers to the .initializers array when the
decorators are called.
This patch doesn't attempt to unify the existing initializer code with the new
code for calling initializers added by decorators. Instead, the existing
initializers are called, and then any new initializers that have been added
are passed the existing initialized value, and are called in series. We should
unify this code, Bug 1817993 tracks this. I think this is best handled in a
follow up, this patch set is already relatively large, and we'll need to be
careful to not regress the performance of initialization when decorators are
not being used.
Depends on D170521
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
This adds a new opcode that allows pushing elements to a newly constructed
array. This is useful for decorators, because we don't know in advance
how many new initializers will be added by running decorator code.
Depends on D170521
Updated•2 years ago
|
Comment 9•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d1adebb389bb
https://hg.mozilla.org/mozilla-central/rev/663e81f5db5c
https://hg.mozilla.org/mozilla-central/rev/86b58aa0124b
Description
•