Closed Bug 1417028 Opened 2 years ago Closed 2 years ago

Shrink VMFunction

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: jandem, Assigned: jandem)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
VMFunctions are allocated statically and we currently have 263 of them. We can easily save some KB:

* VMFunction::name_ is only used in TraceLogging code so we can #ifdef it.
* The fields can be reordered by size to minimize wasted space.
* Some enums can have explicit uint8_t storage.

On 64-bit opt, this shrinks VMFunction from 72 bytes to 40 bytes, so it saves 32 * 263 bytes (~8.2 KB).

On 32-bit opt, this shrinks VMFunction from 52 bytes to 32 bytes, so it saves 20 * 263 bytes (~5.1 KB).
Attachment #8928130 - Flags: review?(nicolas.b.pierron)
(In reply to Jan de Mooij [:jandem] from comment #0)
> * VMFunction::name_ is only used in TraceLogging code so we can #ifdef it.

This might save some KBs as well, since we no longer have to store the names in the binary.
Attachment #8928130 - Flags: review?(nicolas.b.pierron) → review+
https://hg.mozilla.org/mozilla-central/rev/365135d6f7cc
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.