Closed
Bug 1473492
Opened 6 years ago
Closed 6 years ago
Possibly dead code in Codegen.py
Categories
(Core :: DOM: Bindings (WebIDL), enhancement)
Core
DOM: Bindings (WebIDL)
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: jandem, Assigned: bzbarsky)
References
Details
Attachments
(3 files)
10.72 KB,
patch
|
mccr8
:
review+
|
Details | Diff | Splinter Review |
15.00 KB,
patch
|
mccr8
:
review+
|
Details | Diff | Splinter Review |
3.52 KB,
patch
|
mccr8
:
review+
|
Details | Diff | Splinter Review |
The code snippets in this branch are not emitted for any bindings, according to searchfox:
https://searchfox.org/mozilla-central/rev/6ef785903fee6c0b16a1eab79d722373d940fd78/dom/bindings/Codegen.py#8515-8517
Is this expected? Should we remove/keep?
Reporter | ||
Comment 1•6 years ago
|
||
I'm interested in this because there's a js::GetGlobalForObjectCrossCompartment call there. Easy to convert but if we can remove it that's even better :)
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 2•6 years ago
|
||
Looks like this code became dead in bug 1451516.
Specifically, the only way to reach this code is for someone to call CGAbstractBindingMethod.__init__ without passing in a value for getThisObj, or passing an explicit None. We have calls to CGAbstractBindingMethod.__init__ from the following places: CGLegacyCallHook, CGEnumerateHook, CGResolveOwnPropertyViaResolve, CGEnumerateOwnPropertiesViaGetOwnPropertyNames, CGJSImplClearCachedValueMethod.
All of these except CGJSImplClearCachedValueMethod pass a value for getThisObj. And CGJSImplClearCachedValueMethod never appears on a global's proto chain, because we never have globals inheriting from JS-implemented interfaces.
That said, CGJSImplClearCachedValueMethod is dead code outside of tests anyway; it was initially added for JS-implemented APIs with cached attributes, but all of those were b2g-specific and have since been removed.
Given that JS-implemented webidl is deprecated, I'm going to just go ahead and remove the complexity.
Assignee: nobody → bzbarsky
Assignee | ||
Comment 3•6 years ago
|
||
This more or less backs out bug 963382.
Attachment #8990093 -
Flags: review?(continuation)
Assignee | ||
Comment 4•6 years ago
|
||
Attachment #8990094 -
Flags: review?(continuation)
Assignee | ||
Comment 5•6 years ago
|
||
Attachment #8990095 -
Flags: review?(continuation)
Assignee | ||
Updated•6 years ago
|
Flags: needinfo?(bzbarsky)
Updated•6 years ago
|
Attachment #8990093 -
Flags: review?(continuation) → review+
Comment 6•6 years ago
|
||
Comment on attachment 8990094 [details] [diff] [review]
part 2. Disallow [Cached] on JS-implemented interfaces
Review of attachment 8990094 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/bindings/test/TestJSImplGen.webidl
@@ +40,5 @@
> void passOptionalByteWithDefaultBeforeRequired(optional byte arg1 = 0, byte arg2);
> void passNullableByte(byte? arg);
> void passOptionalNullableByte(optional byte? arg);
> void passVariadicByte(byte... arg);
> + // [Cached] not supported in JS-implemented WebIDL.
Should these comments be "is not" instead of "not"?
Attachment #8990094 -
Flags: review?(continuation) → review+
Assignee | ||
Comment 7•6 years ago
|
||
> Should these comments be "is not" instead of "not"?
Sure. Fixed.
Updated•6 years ago
|
Attachment #8990095 -
Flags: review?(continuation) → review+
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1ebaffb961ac
part 1. Remove support for clearing cached attributes on JS-implemented webidl object. r=mccr8
https://hg.mozilla.org/integration/mozilla-inbound/rev/6231278eb5bd
part 2. Disallow [Cached] on JS-implemented interfaces. r=mccr8
https://hg.mozilla.org/integration/mozilla-inbound/rev/02d78ee0198c
part 3. Make the getThisObj argument of CGAbstractBindingMethod required. r=mccr8
Comment 9•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1ebaffb961ac
https://hg.mozilla.org/mozilla-central/rev/6231278eb5bd
https://hg.mozilla.org/mozilla-central/rev/02d78ee0198c
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•