Turn nsXPCWrappedJSClass into a refcounted shell around an nsXPTInterfaceInfo
Categories
(Core :: XPConnect, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: mccr8, Assigned: mccr8)
References
Details
Attachments
(4 files)
nsXPCWrappedJSClass has a number of fields, but only the nsXPTInterfaceInfo* is really necessary. Removing the other fields will make it easier to avoid dynamic allocations in bug 1540301.
uint32_t* mDescriptors: This is used to cache the result of calling XPCConvert::IsMethodReflectable() on the nsXPTMethodInfo for this interface. However, we can just compute that ahead of time and store it in nsXPTMethodInfo. mNotXPCOM and mHidden are only used to compute this value, so we can remove those at the same time to avoid making nsXPTMethodInfo any bigger.
XPCJSRuntime* mRuntime: Fortunately, we only have a single XPCJSRuntime nowadays, so we can just grab it via a static helper method instead of storing a pointer to it in every class.
nsIID mIID: This is literally just a field on nsXPTInterfaceInfo.
Assignee | ||
Comment 1•6 years ago
|
||
There is only a single XPC JS runtime now, so there's no need to keep a
special pointer around.
Assignee | ||
Comment 2•6 years ago
|
||
This is already stored on mInfo.
Assignee | ||
Comment 3•6 years ago
|
||
PCConvert::IsMethodReflectable() is derived entirely from
nsXPTMethodInfo, so we can compute it at build time and include it in
nsXPTMethodInfo. It is the only use of mNotXPCOM and mHidden, so we
can get rid of those fields at the same time.
This paves the way for getting rid of XPCWrappedJSClass::mDescriptors
in the next patch.
Assignee | ||
Comment 4•6 years ago
|
||
This field now just caches the IsReflectable() field from the method
info, so get rid of it.
Comment 6•6 years ago
|
||
Backed out for bustages on xpcprivate.h
Backout link: https://hg.mozilla.org/integration/autoland/rev/244009cbdd779fb7b3555134f1d664a2f00be200
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=238290138&repo=autoland&lineNumber=13978
Assignee | ||
Comment 7•6 years ago
|
||
I've made the trivial fix, but I can't reland it because Lando thinks the landing yesterday never happened. I filed bug 1542247 for this.
Comment 9•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/bed1eb89f503
https://hg.mozilla.org/mozilla-central/rev/c83c13b0c0ae
https://hg.mozilla.org/mozilla-central/rev/6af7c0f7383b
https://hg.mozilla.org/mozilla-central/rev/977637ae4f70
Description
•