Set a bit in the UsedNameTracker to determine if there are any private names
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: mgaudet, Assigned: yozaam, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [lang=c++])
Attachments
(1 file)
For private fields we need to check if there are unbound private names. Right now we do this by iterating over the names, aggregating those that are private + unbound, then figuring out of they have a binding accessible.
This can be optimized by adding a bit to UsedNameTracker to track if we even have seen a private name. If we haven't, then we can bypass these checks. This will be a win avoiding work where it's not necessary.
Comment 1•4 years ago
|
||
I want to work on resolving this bug, but this is my first time on Bugzilla and I found this bug using CodeTribute. Could you please initialize me into the system so that I can learn how to contribute?
Reporter | ||
Comment 2•4 years ago
|
||
Hi aggarwaluddhav: Apologies for not including this info when I opened the bug. The code I'm asking you to change was added as part of this patch.
Prerequisites
Before getting started, you'll want to
- You Have a checkout of the Firefox source code
- Make sure you can build SpiderMonkey
- Understand the basics of using Mercurial
- Understand how to submit a patch
- Read this walkthrough about how development works in Firefox
Success Criteria
- The UsedNameTracker has a new boolean which is set to false at initialization, and true if and only if a private declaration is discovered.
- That boolean is used to return early from methods that are looking to summarize the private names (ie, one place would be
UsedNameTracker::getUnboundPrivateNames
- After this work, the engine compiles, and passes the tests (run
./mach jit-test
)
Questions
If you have questions, feel free to visit us on in the Spidermonkey room on Matrix, or post questions here.
Tips and Tricks:
- SearchFox indexes the Firefox codebase, and allows you to easily find functions, definitions, and more. It's a powerful tool! Note: at the point I'm submitting the comment, the relevant code has not yet been indexed on searchfox; however that will happen sometime today.
I would like to work on this bug. I am a new contributor. I have cloned the repo and learning about the contribution guidelines. Please assign this bug to me. Please let me know about the basic norms about contribution.
Reporter | ||
Comment 4•4 years ago
|
||
So, as you can see there's multiple people vyying for this work. The norm here is that we tend not to assign bugs until we have a patch developed (it avoids the case where someone isn't able to complete the work, and so it gets lost).
I would wait a little bit before tackling this, to give aggarwaluddhav a chance, but if you're partially done no worries, feel free to submit a patch.
Comment 5•4 years ago
|
||
Thanks Matthew! Let me look into this, and will get back after some time.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
I have tried to add this -> UsedNameTracker class and in the getUnboundPrivateNames hasUnboundPrivateNames
I am sure I have missed a few spots where we need to add it -> I have set it to true when there is visibility private in sed NameTracker::noteUse but I need to still understand this -> where can i set it as true... ? inserting into map_ is what i thought happens there
Also when we delete from the map, i need to remove the private bool to false? so should we change this into a counter?
Counting how many private Names in the usedNameTracker / does delete not take place when going out of scope?
Updated•4 years ago
|
Comment 9•4 years ago
|
||
bugherder |
Description
•