Closed Bug 1697143 Opened 3 years ago Closed 3 years ago

Use NewObjectGCKind for empty object literals

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(2 files)

While working on optimizing Object.assign (bug 1696178) I noticed empty object literals result in an object with no fixed slots. This means we usually have to allocate dynamic slots for Object.assign({}, from).

For new (and the Object constructor), we use NewObjectGCKind which gives the object 4 fixed slots. This is sufficient for the majority of assign calls on Reddit and Slack.

Looking at AWSY data this doesn't affect our memory usage numbers much.

This helps avoid a lot of dynamic slot allocations on popular websites which
improves performance. AWSY seems unaffected.

Depends on D107632

Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bf705899fc86
part 1 - Fix JSObject::sizeOfIncludingThisInNursery to not include fixed slots twice. r=jonco
https://hg.mozilla.org/integration/autoland/rev/a527a3ec7f54
part 2 - Use NewObjectGCKind for empty object literals. r=jonco
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: