Closed Bug 1834537 Opened 1 year ago Closed 1 year ago

Simplify allocation code and make it more generic

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox115 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

(Whiteboard: [sp3])

Attachments

(6 files, 1 obsolete file)

This is a for a bunch more refactoring in preparation for inlining more of the allocation path.

Most of the patches relate to reducing duplication and making allocation methods common between the different trace kinds.

Since we discard JIT code when enabling/disabling nursery allocation of
different kinds, we don't need to use specific nursery end pointers to check
whether that kind is enabled any more.

Objects with foreground finalizers can be allocated in the nursery if the
JSCLASS_SKIP_NURSERY_FINALIZE flag is specified.

Depends on D178807

This replaces individual methods for different trace kinds.

Depends on D178809

This is templated on trace kind and AllowGC and instantiated for every combination.

Depends on D178810

This renames the methods called by NewCell into NewBlah, since like |new| they
do both allocation and construction.

The cell allocation methods are renamed to be slightly shorter because the
names are getting unwieldy.

Depends on D178811

This makes allowGC checks constexpr to make it clearer that these parts are
conditionally compiled.

gcIfNeededAtAllocation always returns true so we can remove the return value.

Depends on D178812

Blocks: 1834993

Comment on attachment 9335453 [details]
Bug 1834537 - Part 2: Fix nursery allocatable flag for objects with foreground finalizers r?sfink

Revision D178808 was moved to bug 1834993. Setting attachment 9335453 [details] to obsolete.

Attachment #9335453 - Attachment is obsolete: true
Attachment #9335454 - Attachment description: Bug 1834537 - Part 3: Replace nursery allocation methods with use ofuse allocateCell r?sfink → Bug 1834537 - Part 2: Replace nursery allocation methods with use ofuse allocateCell r?sfink
Attachment #9335455 - Attachment description: Bug 1834537 - Part 4: Add a generic tryNewNurseryCell method to GCRuntime r?sfink → Bug 1834537 - Part 3: Add a generic tryNewNurseryCell method to GCRuntime r?sfink
Attachment #9335456 - Attachment description: Bug 1834537 - Part 5: Make a generic function to allocate a cell in either the nursery or the tenured heap r?sfink → Bug 1834537 - Part 4: Make a generic function to allocate a cell in either the nursery or the tenured heap r?sfink
Attachment #9335457 - Attachment description: Bug 1834537 - Part 6: Rename allocator methods for consistency and simplicity r?sfink → Bug 1834537 - Part 5: Rename allocator methods for consistency and simplicity r?sfink
Attachment #9335458 - Attachment description: Bug 1834537 - Part 7: Simplify GCRuntime::checkAllocatorState a little r?sfink → Bug 1834537 - Part 6: Simplify GCRuntime::checkAllocatorState a little r?sfink
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b48e468f29c1 Part 1: Simplify JIT nursery allocation r=jandem https://hg.mozilla.org/integration/autoland/rev/834625707519 Part 2: Replace nursery allocation methods with use ofuse allocateCell r=sfink https://hg.mozilla.org/integration/autoland/rev/6a44dedea3ad Part 3: Add a generic tryNewNurseryCell method to GCRuntime r=sfink https://hg.mozilla.org/integration/autoland/rev/aa8117171a65 Part 4: Make a generic function to allocate a cell in either the nursery or the tenured heap r=sfink https://hg.mozilla.org/integration/autoland/rev/93b8493126c5 Part 5: Rename allocator methods for consistency and simplicity r=sfink https://hg.mozilla.org/integration/autoland/rev/4651a95b056e Part 6: Simplify GCRuntime::checkAllocatorState a little r=sfink
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: