Created attachment 508659 [details] [diff] [review]
patch (against TM 61287:a6d56af51d69)
JITScript has several variable-length sections at its end. Currently it
holds a pointer to every section and the length of every section. But only
one or the other is necessary; this patch removes all the pointers.
This reduces sizeof(JITScript) nicely:
- 32-bits: 120 bytes -> 84 bytes
- 64-bits: 200 bytes -> 128 bytes
Reusing the calculation from bug 619849 comment 0: on a 20-tab cad-comics browser run this reduces peak memory use by ~800 KB on 64-bit platforms and ~400 KB on 32-bit platforms.
It also reduces the cost of adding new sections, which may happen with PICs
(see the last sentence of bug 629601 comment 2).
- Changes all the section pointer fields (.nmap, .pics, etc) to methods.
- Removes 'idReg' from PICGenInfo; it's a dead field.
- Reorders the section lengths in JITScript to match the order of the
sections as written by finishThisUp().
- Simplifies the writing of sections in finishThisUp(). Most of the
sections had an "is this zero length?" test that wasn't necessary and just
increased indentation, so I removed it.
The patch is reasonably big but most of the changes are mechanical. I confirmed with Cachegrind that instruction counts were only negligibly affected by the new section-finding methods, each of which requires multiple adds and multiplies.
cdleary-bot mozilla-central merge info: