Open Bug 1236748 Opened 8 years ago Updated 21 hours ago

SpiderMonkey's object metadata callback should probably just be a hard-coded function

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: jimb, Unassigned)

References

(Blocks 1 open bug)

Details

We should delete SetObjectMetadataCallback and restrict metadata to that collected for the Debugger API. Turning metadata collection on and off should be soley up to the Debugger.

We're not using the flexibility. The SetObjectMetadataCallback API allows the embedding to set any metadata callback that it likes, but in practice only one is ever used: SavedStacksMetadataCallback, the one used by the Debugger API.

Supporting multiple callbacks costs us complexity. We try to avoid stepping on conflicting callbacks: operations like enabling collection are fallible, and multi-compartment operations need rollback code.
I think :njn may have been using this in custom builds to record allocations at some point in time, but that should be superseded by Debugger.Memory's allocation site tracking and logging[0]. If not, we should add support for whatever is missing!

:njn, are you still using the object metadata callback at all? In a way that isn't supported by the Debugger.Memory API?

[0] https://developer.mozilla.org/en-US/docs/Tools/Debugger-API/Debugger.Memory#Allocation_Site_Tracking
Flags: needinfo?(n.nethercote)
> :njn, are you still using the object metadata callback at all?

Nope. Feel free to simplify it.
Flags: needinfo?(n.nethercote)
Severity: normal → S3

Rummaging around this still seems to be true; the only consumers of this is shell testing or the debugger and so we should continue to clean this up.

Blocks: sm-meta
Severity: S3 → N/A
Type: defect → enhancement
Priority: -- → P3
No longer blocks: sm-meta
You need to log in before you can comment on or make changes to this bug.