[jsdbg2] Debugger reflection classes' trace methods are more dynamically typed than necessary
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: jimb, Assigned: jimb)
References
(Blocks 1 open bug)
Details
(Whiteboard: [debugger-mvp])
Attachments
(1 file)
The C++ classes representing Debugger API objects, like js::DebuggerFrame
and js::DebuggerScript
, all have static trace
member functions that take a JSObject*
and downcast it, as required by ClassOps
. But with the changes in bug 1567245, there are other tracing paths in Debugger
that actually know the most derived type of the objects they're tracing, and are forced to upcast the pointer in order to pass it to trace
, which will immediately downcast it. This is not a serious problem, but it is a bit silly.
Assignee | ||
Comment 1•6 years ago
|
||
Replace the loosely-typed 'trace' static member functions with well-typed
non-static trace methods. These can be used by
DebuggerWeakMap::traceCrossCompartmentEdges, called from
Debugger::traceCrossCompartmentEdges.
Since we still need a (JSTracer*, JSObject*) function for use in ClassOps, add
new static member 'trace' functions that do the downcast to the most derived
type, and then defer to the well-typed methods.
Updated•6 years ago
|
Updated•6 years ago
|
![]() |
||
Comment 3•6 years ago
|
||
bugherder |
Description
•