[meta] Add shape information for CacheIR Health Report
Categories
(Core :: JavaScript Engine: JIT, task, P3)
Tracking
()
People
(Reporter: caroline, Unassigned, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, meta)
Background
This bug is based off of bug 1640284, the existing CacheIR health report tooling. We would like to expand the information spewed by the tool and the existing UI for visualizing the spew. An explanation of how to spew the report, use the visualizer, and what the various pieces of information mean can be seen here.
This Bug
The goal of this bug is to add more information to the spew output for the health report about the shape. Every JSObject has a pointer to a shape, which describes its layout in memory. This spew will include information about the shape fields and the shape itself.
This bug can be separated into two parts:
Part 1 - Add the information about the shapes whenever we see a shape in CacheIR. The CacheIR health report has code that loops through the stub fields in an IC. A check would need to be added for fields of the type StubField::Type::Shape
and then upon seeing a shape, spew more information about it, such as the names for the properties for that shape. After the additional information is spewed, the UI will also need to be updated so that the shape information can be viewed. Beginning with property names is a great place to start and make sure the properties spew and the UI both work. An example of a place where we dump properties and other information about shapes exists here.
Part 2 - The goal of the second part of this bug is very cool and will allow us to see where a shape is being allocated in a particular JS script (for some shapes). Since there is information about the shape's prototype being stored on base shape, we can get a shape's prototype. From that the prototype can then be used maybeGetConstructor to get the constructor from cx->global(). From the constructor, check is<JSFunction> and then cast the constructor as a function. Then, from JSFunction we can get the baseScript() and finally from with the base script we can get the exact filename and line number where a shape is created. Information such as the filename and line number should be spewed and displayed for certain shapes where we this chain of information exists. The UI should also be updated to display this shape information.
When these parts are done, you should see information about the shape's properties in the health report spew as well as information about where in the script the shape was allocated. The UI should also reflect these changes and when an IC is selected for further inspection, in the cases where a shape is seen in the IC there should also be an option to select the shape for further inspection and the information about its properties and potentially about its allocation should be visible.
Prerequisites
Before getting started, you'll want to ensure:
* you have a checkout of the Firefox source code
* you can build SpiderMonkey
* you have read this walkthrough about how development works in Firefox
* after the above steps, you are able to produce a CacheIR health report spew
* you are able to use the UI from the spew in the above step
Getting Help
Leave comments on this bug for questions, or ask in #spidermonkey on chat.mozilla.org or message @caroline personally on matrix.
note: this is a more difficult bug, please feel free to ask for as much help as you need!
Comment 1•4 years ago
|
||
Is anybody working on this, or is this something I can start on? It's got the "good first bug" tag so I figured it would be a great place for me to start.
Reporter | ||
Comment 2•4 years ago
|
||
This has actually been completed!
Description
•