Store native object private fields using PrivateValue()
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox84 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
Details
Attachments
(1 file)
Currently private fields work by getting a reference to the private field's HeapSlot (which is a class containing a Value), casting it to a void* reference and accessing that. Instead we can store private pointers in Value using PrivateValue and it would be simpler to do so. This could also help simplify GC marking in the future because it wouldn't have to take account of whether a slot is a private field.
(The stored representation for this actually ends up the same because PrivateValue() converts the pointer to a uintptr_t. When interpreted as a Value it looks like a double for all valid pointers that we want to store:
https://searchfox.org/mozilla-central/source/js/public/Value.h#198-199 )
Assignee | ||
Comment 1•4 years ago
|
||
This means all native object slots are JS::Values and removes a bunch of
dubious casting.
One wrinkle was that we now have to initialize both words of the value on
32-bit platforms; previously JIT code got away with leaving one word
uninitialized.
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6441ff615b73 Store native object's private slot using PrivateValue r=jandem
Comment 3•4 years ago
|
||
bugherder |
Description
•