Closed Bug 1635185 Opened 5 years ago Closed 4 years ago

Consider storing an object's dynamic slot count directly in a header

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(4 files)

Jan suggested that we might store the number of dynamic slots in a header like we do for object elements.

Currently it's quite involved working this out (see NativeObject::numDynamicSlots, NativeObject::dynamicSlotsCount, NativeObject::slotSpan) and touches the class, the shape and possibly the base shape.

Severity: -- → N/A
Priority: -- → P3
Assignee: nobody → jcoppeard

I wonder if the new field could eventually replace BaseShape::slotSpan_, so the slot span would always be stored in obj->slots->slotSpan, for both dictionary and non-dictionary native objects... For that to work we'd need statically-allocated empty-dynamic-slots structs for slot span 0-16, similar to EmptyObjectElements.

Attachment #9170941 - Attachment description: Bug 1635185 - Use a header for dynamic object slots and use it to store the capacity r?jandem → Bug 1635185 - Part 1: Use a header for dynamic object slots and use it to store the capacity r?jandem
Attachment #9170943 - Attachment description: Bug 1635185 - Use the stored capacity for NativeObject::numDynamicSlots() and rename methods that calculate the required slot count to calculateDynamicSlots() r?jandem → Bug 1635185 - Part 2: Use the stored capacity for NativeObject::numDynamicSlots() r?jandem

As suggested, this uses special shared header objects if there are no dynamic slots.

Depends on D87597

This also shrinks BaseShape down to 16 bytes on 32 bit platforms.

Depends on D87888

Attachment #9171439 - Attachment description: Bug 1635185 - Part 3: Also store the slot span in the slots header r?jandem → Bug 1635185 - Part 3: Store dictionary object slot span in the slots header r?jandem
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9eb95eed348c Part 1: Use a header for dynamic object slots and use it to store the capacity r=jandem https://hg.mozilla.org/integration/autoland/rev/d00c06a25def Part 2: Use the stored capacity for NativeObject::numDynamicSlots() r=jandem https://hg.mozilla.org/integration/autoland/rev/a1ede76c8e1c Part 3: Store dictionary object slot span in the slots header r=jandem https://hg.mozilla.org/integration/autoland/rev/1f3b9d75281c Part 4: Removed the unused slotSpan field from BaseShape r=jandem
Regressions: 1663741
Regressions: 1666436
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: