Closed Bug 1260984 Opened 8 years ago Closed 8 years ago

Reduce static data sizes by separating js::ClassSpec from js::Class

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

(Whiteboard: [MemShrink])

Attachments

(3 files)

Bug 1259194 moved ObjectOps out of js::Class, reducing static data by 208 KiB (on 64-bit) in the process.

This bug is about doing the same thing with ClassSpec. The reduction is 138 KiB, which a bit smaller because ClassSpec is 8 words compared to ObjectOps' 12 words, but still pretty good.
It's full of nulls which means that JS_NULL_OBJECT_OPS suffices.
Attachment #8736608 - Flags: review?(efaustbmo)
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
A number of ObjectOps instances are more exposed than they need to be. This
patch converts several to be either private (within a class) or static (within
a file).
Attachment #8736609 - Flags: review?(efaustbmo)
js::ObjectOps is often all null. When it's not all null, it's often duplicated
among classes. By pulling it out into its own struct, and using a (possibly
null) pointer in js::Class, we can save 138 KiB per process on 64-bit, and half
that on 32-bit.
Attachment #8736611 - Flags: review?(efaustbmo)
Comment on attachment 8736608 [details] [diff] [review]
(part 1) - Remove ClonedBlockObject::objectOps_

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

*steal*
Attachment #8736608 - Flags: review?(efaustbmo) → review+
Attachment #8736609 - Flags: review?(efaustbmo) → review+
Comment on attachment 8736611 [details] [diff] [review]
(part 3) - Separate js::ClassSpec from js::Class

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

The commit message still refers to js::ObjectOps rather than js::ClassSpec.
Attachment #8736611 - Flags: review?(efaustbmo) → review+
Blocks: 1261720
https://hg.mozilla.org/mozilla-central/rev/fb1734c047af
https://hg.mozilla.org/mozilla-central/rev/0ed129db5548
https://hg.mozilla.org/mozilla-central/rev/f29f34e249d2
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
See Also: → 1318815
You need to log in before you can comment on or make changes to this bug.