Closed Bug 722102 Opened 14 years ago Closed 11 months ago

SpiderMonkey should provide debugging names for builtin class instances' reserved slots

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

RESOLVED INCOMPLETE
mozilla13

People

(Reporter: jimb, Assigned: jimb)

Details

Attachments

(1 file, 2 obsolete files)

It's nice when the GC can provide proper names for edges in the graph. However, at the moment, objects' reserved slots get named "**UNKNOWN SLOT 0**", which is less than helpful. Proper names also make things like findReferences more useful in tests, because the names can remain stable.
I think this covers everything. try: https://tbpl.mozilla.org/?tree=Try&rev=1845f0b22fbf
Assignee: general → jimb
Attachment #592449 - Attachment is obsolete: true
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: x86_64 → All
Target Milestone: --- → mozilla13
Version: unspecified → Trunk
Flags: in-testsuite+
If this patch lands, I'll write the docs for it as well.
Status: ASSIGNED → NEW
OS: All → Linux
Hardware: All → x86_64
Target Milestone: mozilla13 → ---
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: x86_64 → All
Target Milestone: --- → mozilla13
Fixed a test that wasn't checking that findReferences is available. New try: https://tbpl.mozilla.org/?tree=Try&rev=a412183ca6ec
Attachment #594907 - Attachment is obsolete: true
Comment on attachment 595079 [details] [diff] [review] In SpiderMonkey, provide debugging names for built-in classes' reserved slots. Review of attachment 595079 [details] [diff] [review]: ----------------------------------------------------------------- Try looks good.
Attachment #595079 - Flags: review?(jwalden+bmo)
Comment on attachment 595079 [details] [diff] [review] In SpiderMonkey, provide debugging names for built-in classes' reserved slots. Review of attachment 595079 [details] [diff] [review]: ----------------------------------------------------------------- The dynamicity of implementation here smells funny, given that reserved slots are a purely static function of object class. Can't this just be encoded in a static const array per class, indexed by slot number, bounds-checked by JSSLOT_FREE(clasp)? This would require a little trickiness if this is supposed to be part of the public API, but not much at all. Could you try something along those lines, please?
Attachment #595079 - Flags: review?(jwalden+bmo)
This is possibly interesting for magic DOM since it uses a lot of reserved slots. A static const array per class is enough for many but not all cases. It's possible to have something that's effectively a union, so the names of the slots would change based on the content of some other slot. Not having support for that isn't a big problem for most of my cases though - those kinds of slots seem rare.
Severity: normal → S3
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: