Tidy GC allocation paths in preparation for adding a nursery fast path
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox114 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
(Whiteboard: [sp3])
Attachments
(6 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
The GC allocation code is quite complicated. I wrote some patches to tidy it up and make it more consistent between the different allocation kinds.
Assignee | ||
Comment 1•6 months ago
|
||
Currently we call both the TenuredCell consturctor and the derived constructor
for tenured allocations. While this is not illegal, it's strange and we should
rely on the derived constructor.
The patch changes the tenured allocation paths to use void* pointers to
unconstructed memory.
I don't know why the change to cell header initialization was necessary. It
seems the TenuredCell constructor initialized the header to zero for some
reason, but I don't see why it should have.
Assignee | ||
Comment 2•6 months ago
|
||
This moves the dynamic slot allocation code that is currently duplicated
between nursery and tenured allocation paths into NativeObject instead.
Depends on D175372
Assignee | ||
Comment 3•6 months ago
|
||
Previously we didn't call any constructor for nursery-allocated objects, and we
always called the JSObject constructor for tenured objects. This makes object
constructor more like the other paths and calls the constructor in one place at
the end.
Depends on D175373
Assignee | ||
Comment 4•6 months ago
|
||
Depends on D175374
Assignee | ||
Comment 5•6 months ago
|
||
Depends on D175376
Assignee | ||
Comment 6•6 months ago
|
||
This is just so you don't have to include both Cell.h and Allocator.h to
declare a derived cell type.
Depends on D175378
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e8cfac05da4a Part 1: Don't call TenuredCell consturctor but rely on derived constructor r=sfink https://hg.mozilla.org/integration/autoland/rev/cd8376894002 Part 2: Move dynamic slot allocation out of GC allocation path r=jandem https://hg.mozilla.org/integration/autoland/rev/684d845a4a42 Part 3: Common up object construction and call the derived constructor r=sfink https://hg.mozilla.org/integration/autoland/rev/00cf9f71c60e Part 4: Refactor BigInt allocation along the same lines as the other kinds r=sfink https://hg.mozilla.org/integration/autoland/rev/e8e565d555fa Part 5: Rename AllocateString's type parameter in line with the other methods r=sfink https://hg.mozilla.org/integration/autoland/rev/34ed400b7bb1 Part 6: Forward declare CellAllocator in Cell.h since derived types already need to include this r=sfink https://hg.mozilla.org/integration/autoland/rev/179b8c4df1ad apply code formatting via Lando
Comment 8•5 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e8cfac05da4a
https://hg.mozilla.org/mozilla-central/rev/cd8376894002
https://hg.mozilla.org/mozilla-central/rev/684d845a4a42
https://hg.mozilla.org/mozilla-central/rev/00cf9f71c60e
https://hg.mozilla.org/mozilla-central/rev/e8e565d555fa
https://hg.mozilla.org/mozilla-central/rev/34ed400b7bb1
https://hg.mozilla.org/mozilla-central/rev/179b8c4df1ad
Updated•5 months ago
|
Updated•5 months ago
|
Description
•