Closed
Bug 630445
Opened 10 years ago
Closed 10 years ago
JM: shrink JITScript by optimizing the representation of variable-length sections
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: njn, Assigned: njn)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
|
40.98 KB,
patch
|
dvander
:
review+
dvander
:
approval2.0+
|
Details | Diff | Splinter Review |
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)
| Assignee | ||
Updated•10 years ago
|
Blocks: JaegerShrink
| Assignee | ||
Updated•10 years ago
|
Summary: JM: shrink JITScript some more → JM: shrink JITScript by optimizing the representation of variable-length sections
Updated•10 years ago
|
Attachment #508659 -
Flags: review?(dvander) → review+
| Assignee | ||
Updated•10 years ago
|
Attachment #508659 -
Flags: approval2.0?
Updated•10 years ago
|
Attachment #508659 -
Flags: approval2.0? → approval2.0+
| Assignee | ||
Comment 1•10 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/a1a8cd4accba
Whiteboard: fixed-in-tracemonkey
Comment 2•10 years ago
|
||
cdleary-bot mozilla-central merge info: http://hg.mozilla.org/mozilla-central/rev/a1a8cd4accba
Updated•10 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•