Closed Bug 1719457 Opened 3 years ago Closed 3 years ago

Remove object private slots

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox92 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 file)

Native objects can have a private slot via JSCLASS_HAS_PRIVATE, but most of the objects using this can be easily converted to use a reserved slot instead. Reserved slots are strictly more powerful because there can be multiple slots.

Private slots complicate and slow down the object allocation code and it's another obscure thing to think about when making changes.

There's some complexity around JSCLASS_PRIVATE_IS_NSISUPPORTS but I hope we can find a solution for that.

Depends on: 1719795
Depends on: 1721333
Depends on: 1722453
Depends on: 1722674
Depends on: 1722872

Initially the only way to attach data to an object was with a private slot.
More than 21 years ago (bug 73843) support for reserved slots was added
to the engine. An object can have multiple reserved slots, which makes
reserved slots more powerful and useful than the old-style private slot.

After converting the remaining private slots to reserved slots, we can now finally
remove support for private slots.

There's a bit more optimization work we can do to reserved slot accesses after
this lands.

Blocks: 1723085
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ba6511f2bc3e
Remove support for JSObject private slots. 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: