Closed Bug 1723085 Opened 3 years ago Closed 3 years ago

Optimize reserved slot accesses

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox92 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(3 files)

After removing private slots in bug 1719457, we can optimize gets/sets of reserved slots by relying on the fact that fixed slots are used for them (up to the maximum number of fixed slots).

This means we no longer need to read obj->shape->numFixedSlots when getting/setting reserved slots and can optimize a slot access with constant index (the common case) to a single memory load/store.

Unfortunately doing the same for the JS::GetReservedSlot and JS::SetReservedSlot APIs is more complicated because these can also be used for proxies.

After removing private slots, we can optimize gets/sets of reserved slots by
relying on the fact that fixed slots are used for them (up to the maximum number
of fixed slots).

This means we no longer need to read obj->shape->numFixedSlots when getting/setting
reserved slots and can optimize a slot access with constant index (the common case)
to a single memory load/store.

Unfortunately doing the same for the JS::GetReservedSlot and JS::SetReservedSlot
APIs is more complicated because these can also be used for proxies and swappable
DOM objects.

Depends on D121355

Pushed by nbeleuzu@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/54dc60004dcf part 1 - Remove getReservedSlotRef. r=jonco https://hg.mozilla.org/mozilla-central/rev/dfd6d7623515 part 2 - Optimize getting/setting reserved slots inside the JS engine. r=jonco https://hg.mozilla.org/mozilla-central/rev/62aa961c1bd7 part 3 - Use getReservedSlot/setReservedSlot in more places. r=jonco
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: