Get rid of DefineDOMInterface methods

RESOLVED FIXED in Firefox 61

Status

()

enhancement
P2
normal
RESOLVED FIXED
Last year
5 months ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

unspecified
mozilla61
Points:
---

Firefox Tracking Flags

(firefox61 fixed)

Details

Attachments

(1 attachment)

We have a bunch of out-of-line DefineDOMInterface methods that just call GetConstructorObjectHandle, which itself just calls a shared GetPerInterfaceObjectHandle method.  But DefineDOMInterface is only used in one place, so we should be able to just call GetPerInterfaceObjectHandle there directly and save some codesize.  About 50KB when I just measured.
In particular, a Linux opt --enable-release build libxul.so goes from 99671483 to 99617371 bytes, according to "size -B".
Priority: -- → P2
Comment on attachment 8958939 [details] [diff] [review]
Reduce codesize a bit by removing DOM DefineInterfaceObject methods

Review of attachment 8958939 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bindings/WebIDLGlobalNameHash.cpp
@@ +212,5 @@
> +        return constructor;
> +      }
> +    }
> +  }
> +  

Stray whitespace.

@@ +323,5 @@
>      return true;
>    }
>  
>    JS::Rooted<JSObject*> interfaceObject(aCx,
> +    FindNamedConstructor(aCx, aId, entry, true));

Wouldn't it make more sense to just call GetPerInterfaceObjectHandle directly here, and remove aDefineOnGlobal from FindNamedConstructor?
Attachment #8958939 - Flags: review?(peterv) → review+
> Stray whitespace.

Fixed.

> Wouldn't it make more sense to just call GetPerInterfaceObjectHandle directly here

Hmm.  That seems reasonable, yes.  I'll do that.
I also renamed it to FindNamedConstructorForXray.
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7c26bbdac00f
Reduce codesize a bit by removing DOM DefineInterfaceObject methods.  r=peterv
https://hg.mozilla.org/mozilla-central/rev/7c26bbdac00f
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.