Open Bug 1817993 Opened 2 years ago Updated 1 years ago

Unify field initialization code for decorators

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

People

(Reporter: dminor, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

In Bug 1793962 we're adding code to handle new initializers added by decorators while keeping the current field initialization logic the same. This means that the default initializer runs, that value is stored, we retrieve it, and then apply the initializers from the decorators. We should unify this code.

Summary: Code generation for field decorators → Unify field initialization code for decorators
Severity: -- → N/A
Priority: -- → P2

Hello! hope you are doing well! I want to give this issue an attempt, I am presently going through the previously linked revision the new code starts here i believe https://searchfox.org/mozilla-central/source/js/src/frontend/BytecodeEmitter.cpp#9989 ? I have difficulty finding the old code to be unified with? Also could you point to wards and documentation or references on the notations used to denote state of the stack i believe in the comments? I am guessing understanding that would be relevant here?

Thank you! :-)

Flags: needinfo?(dminor)

Hi Debradree!

My thoughts on this bug have changed a little bit since it was first filed, and I think what we actually want to do is fix Bug 1827197 first. At the moment, we run a separate initialization function for each field, but in chromium, they have merged all of the field initializers into a single function, which is a good performance optimization. Once that is fixed, there might still be some things we can improve with how the decorator added initializers are run, so I'll leave this bug open for now, but I don't think it makes sense to try to unify the initializers like I had originally thought.

Bug 1827197 could be a challenging project, I haven't thought about it too much in detail yet, although there are some good comments over there that might help you get started. If you're looking for a smaller decorators related project, you could try Bug 1784519, I can add some more details there. If you'd like to look at a Firefox bug, Bug 1763123 might be of interest.

Depends on: 1827197
Flags: needinfo?(dminor)

I will give all of them a little explore and reach out for info if i need!

thank you for your time and guidance!

You need to log in before you can comment on or make changes to this bug.