Unnecessary fields in CallSetup
Categories
(Core :: DOM: Bindings (WebIDL), enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox145 | --- | fixed |
People
(Reporter: arai, Assigned: mgaudet)
References
Details
Attachments
(2 files)
CallSetup class has some maybe-rooted fields for GC things, but they're not actually used anywhere outside of the constructor, or never read.
These fields should be removed.
class CallbackObjectBase {
...
class MOZ_STACK_CLASS CallSetup {
...
Maybe<JS::Rooted<JSObject*>> mRootedCallable;
// The global of mRootedCallable.
Maybe<JS::Rooted<JSObject*>> mRootedCallableGlobal;
// Members which are used to set the async stack.
Maybe<JS::Rooted<JSObject*>> mAsyncStack;
| Assignee | ||
Comment 1•1 year ago
|
||
Thank you for opening this bug: I've been looking at these members as Chesterton's Fence but have been unable thus far to particularly make heads or tails as to why they were added -- though I've not done a historical deep dive to look into the state of CallSetup when they were added.
Comment 2•1 year ago
•
|
||
(mRootedCallableGlobal was added by bug 1477923 and it was also only being used in the constructor.)
| Assignee | ||
Comment 3•11 months ago
|
||
Updated•11 months ago
|
| Assignee | ||
Comment 4•11 months ago
|
||
- We don't need to root the stack -- fixed AutoSetAsyncStack in previous patch
- We don't need to root the callable global -- it will be kept alive by the callable being rooted.
We -do- however still need to have the callable itself be rooted
(For example /test262/built-ins/Proxy/preventExtensions/trap-is-undefined-target-is-proxy.js crashes
if it's not rooted, as we end up trying to AutoRealm into a CCW.)
Comment 5•11 months ago
|
||
I think https://searchfox.org/firefox-main/rev/16f979184458f531fce47706d2fa7f2902e75ad3/dom/bindings/CallbackObject.h#223-227 was the reason, but trying to figure out if that is needed for CallSetup too.
Updated•11 months ago
|
Comment 7•11 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/916d56392533
https://hg.mozilla.org/mozilla-central/rev/53fe2827b95a
Updated•10 months ago
|
Description
•