Closed Bug 1926226 Opened 4 months ago Closed 3 months ago

Try to lazily allocate slots for attributes marked as FrozenArray

Categories

(Core :: DOM: Bindings (WebIDL), task, P1)

task

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: hsinyi, Assigned: peterv)

References

Details

Attachments

(5 files, 1 obsolete file)

spin off from bug 1920082 comment 25 -

Each attribute marked with [FrozenArray] requires a reserved slot on the JS object. We went from 1 to 8 slots, so I think that means the size of the JSObject went from a size of 4 64-bit values to 10 (JSObject_slots2 to JSObject_slots8). I'll try to make this more lazily allocated, but it's annoying because it means more special cases in the generated code.

See Also: → 1920082

HTML reflected IDL attributes that return a FrozenArray<T>? need to cache the
FrozenArray. This switches them from using a reserved slot on the JS object
per attribute to using an array of values for all of these types of attributes
for a particular interface, which is then stored in one reserved slot on the JS
object. This reduces the memory reserved for these attributes if they're not
actually used.

Attachment #9437085 - Attachment description: Bug 1926226 - Fix performance regression from reflected attributes. r?edgar! → Bug 1926226 - Use only one reserved slot for reflected attributes returning a FrozenArray. r?edgar!
Pushed by pvanderbeken@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/129aa517bd23 Add a JSSLOT_EXPANDO_COUNT alias in a DOM header, to avoid pulling in XPConnect headers everywhere. r=edgar https://hg.mozilla.org/integration/autoland/rev/028c77b002e3 Change DEFINE_XRAY_EXPANDO_CLASS to allow passing in custom ops. r=edgar https://hg.mozilla.org/integration/autoland/rev/88a6b0fd4e68 Add a ClearXrayExpandoSlots helper for WebIDL bindings. r=edgar https://hg.mozilla.org/integration/autoland/rev/5560b5784075 Use only one reserved slot for reflected attributes returning a FrozenArray. r=edgar
Regressions: 1932400
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: