Closed Bug 630445 Opened 15 years ago Closed 15 years ago

JM: shrink JITScript by optimizing the representation of variable-length sections

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

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

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

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). The patch: - 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.
Attachment #508659 - Flags: review?(dvander)
Blocks: JaegerShrink
Blocks: 630738
Summary: JM: shrink JITScript some more → JM: shrink JITScript by optimizing the representation of variable-length sections
Attachment #508659 - Flags: review?(dvander) → review+
Attachment #508659 - Flags: approval2.0?
Attachment #508659 - Flags: approval2.0? → approval2.0+
Whiteboard: fixed-in-tracemonkey
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: