Closed
Bug 1248534
Opened 8 years ago
Closed 8 years ago
Remove unused XPT features
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(9 files, 1 obsolete file)
75.25 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
4.32 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
10.25 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
4.47 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
4.39 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
1.90 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
17.58 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
11.00 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
1.83 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
We can remove some XPT code.
Assignee | ||
Comment 1•8 years ago
|
||
Currently XPT can both encode and decode, but encoding has been handled by Python code since bug 643817, so the encoding support can be removed. This results in many simplifications. Some notable changes: - All the XPTHashTable code (including XPTDatapool::offset_map) is no longer necessary. - PrimitiveTest.cpp and SimpleTypeLib.cpp both don't make much sense without encoding support, so I removed them. - A lot of the version code was already unused, e.g. XPT_VERSION_*, XPT_TYPELIB_VERSIONS_STRUCT, XPT_TYPELIB_VERSIONS. XPT_MAJOR_INCOMPATIBLE_VERSION is the only thing actually used in version checks. - The patch also removes some code that was dead even before encoding removal, such as XPT_ParseVersionString().
Attachment #8719682 -
Flags: review?(khuey)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•8 years ago
|
||
For part 1 we have: 9 files changed, 107 insertions(+), 1423 deletions(-)
Assignee | ||
Comment 3•8 years ago
|
||
Attachment #8719683 -
Flags: review?(khuey)
FWIW, while I will do these reviews, they are quite low priority to me.
Assignee | ||
Comment 5•8 years ago
|
||
The XPT_ENCODE removal was inspired by part 1 of bug 1249174 -- removing the argnum2 field is easier when we don't have to worry about encoding.
Assignee | ||
Comment 6•8 years ago
|
||
PT supports annotations but xpt.py doesn't generate them except for a single empty annotation (to indicate there are no real annotations). So we can remove almost all support for them. This also allows XPTString to be removed.
Attachment #8720646 -
Flags: review?(khuey)
Assignee | ||
Comment 7•8 years ago
|
||
Attachment #8720647 -
Flags: review?(khuey)
Assignee | ||
Comment 8•8 years ago
|
||
It can just be inlined into XPTState, which simplifies things.
Attachment #8721161 -
Flags: review?(khuey)
Assignee | ||
Comment 9•8 years ago
|
||
RegisterBuffer() is the only place that creates an XPTState, and it also destroys it. So the XPTState can be allocated on the stack, which voids the need for the creation of an XPTArena.
Attachment #8721162 -
Flags: review?(khuey)
Assignee | ||
Comment 10•8 years ago
|
||
Attachment #8721813 -
Flags: review?(khuey)
Assignee | ||
Comment 11•8 years ago
|
||
PT has some functions and macros for freeing memory. However, they (a) are only used on error paths, and (b) don't actually free memory -- they just optionally log the "freeing" -- because piecewise freeing doesn't make sense with arena allocation. This patch removes all that unnecessary machinery.
Attachment #8721814 -
Flags: review?(khuey)
Assignee | ||
Comment 12•8 years ago
|
||
I bet nobody has used this code in a decade. I haven't, even though I've been working on reducing XPT memory usage. Well-targeted diagnostic printfs are much more useful than these kind of overview stats, in my experience.
Attachment #8721839 -
Flags: review?(khuey)
Assignee | ||
Comment 13•8 years ago
|
||
These 9 patches reduce the number of lines of code in xpcom/typelib/xpt/*.{h,cpp} from 2680 to 1316, and the diffstat overall is as follows: 13 files changed, 142 insertions(+), 1805 deletions(-)
Assignee | ||
Updated•8 years ago
|
Summary: Removed unused XPT features → Remove unused XPT features
Assignee | ||
Comment 14•8 years ago
|
||
(I tweaked a comment.)
Attachment #8722093 -
Flags: review?(khuey)
Assignee | ||
Updated•8 years ago
|
Attachment #8720647 -
Attachment is obsolete: true
Attachment #8720647 -
Flags: review?(khuey)
Attachment #8719682 -
Flags: review?(khuey) → review+
Attachment #8719683 -
Flags: review?(khuey) → review+
Attachment #8720646 -
Flags: review?(khuey) → review+
Attachment #8722093 -
Flags: review?(khuey) → review+
Attachment #8721161 -
Flags: review?(khuey) → review+
Attachment #8721162 -
Flags: review?(khuey) → review+
Attachment #8721813 -
Flags: review?(khuey) → review+
Attachment #8721814 -
Flags: review?(khuey) → review+
Attachment #8721839 -
Flags: review?(khuey) → review+
Assignee | ||
Comment 15•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/56f75a8f44915a4468fbedaf3beb9767b73eb343 Bug 1248534 (part 1) - Remove XPT encoding support. r=khuey. https://hg.mozilla.org/integration/mozilla-inbound/rev/475874efad984c2141afd6818007f48846999d46 Bug 1248534 (part 2) - Remove unused XPT flags. r=khuey. https://hg.mozilla.org/integration/mozilla-inbound/rev/14ba54064f33d9dc0dbcdca7ebd2dff582973fcf Bug 1248534 (part 3) - Remove almost all support for XPT annotations. r=khuey. https://hg.mozilla.org/integration/mozilla-inbound/rev/a0ce7857613ec423ec143fb3c22c3eee8646fd4e Bug 1248534 (part 4) - Remove unused fields from XPTConstValue. r=khuey. https://hg.mozilla.org/integration/mozilla-inbound/rev/25c818450f3229d4b3904f5eb8a27c4a4d6fb27c Bug 1248534 (part 5) - Remove XPTDatapool. r=khuey. https://hg.mozilla.org/integration/mozilla-inbound/rev/76740f3273fb519efe26f1dd345be20f5c9668d0 Bug 1248534 (part 6) - Stack-allocate XPTState. r=khuey. https://hg.mozilla.org/integration/mozilla-inbound/rev/d380cae049a102d96f94523fab6af90ae324a35a Bug 1248534 (part 8) - Remove useless XPT freeing code. r=khuey. https://hg.mozilla.org/integration/mozilla-inbound/rev/d429066578eb056ca2b9cd110cca8b63490c4d9b Bug 1248534 (part 9) - Remove XPT arena logging code. r=khuey.
Assignee | ||
Comment 16•8 years ago
|
||
Whoops, part 7 didn't get mentioned in comment 15 because I mistakenly put bug 1249174 in the commit message. No matter. See also bug 1249174 comment 15.
Comment 17•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/56f75a8f4491 https://hg.mozilla.org/mozilla-central/rev/475874efad98 https://hg.mozilla.org/mozilla-central/rev/14ba54064f33 https://hg.mozilla.org/mozilla-central/rev/a0ce7857613e https://hg.mozilla.org/mozilla-central/rev/25c818450f32 https://hg.mozilla.org/mozilla-central/rev/76740f3273fb https://hg.mozilla.org/mozilla-central/rev/d380cae049a1 https://hg.mozilla.org/mozilla-central/rev/d429066578eb
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•