Closed Bug 1735296 Opened 3 years ago Closed 3 years ago

Improve weak edge tracing APIs in preparation for replacing uses of IsAboutToBeFinalized

Categories

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

task

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(6 files)

To allow most uses of IsAboutToBeFinalized to be replaced with tracing we need to improve the infrastructure a little.

One issue is that when tracing a weak edge you may need to initial referent of the edge after it has been traced and potentially cleared (e.g. to perform some cleanup on it). But you may also need the updated edge if it has been updated. This is currently possible but makes the code more complex than it needs to be.

Another thing we'll need is a sweeping tracer for nursery collections.

Finally it would be good to remove as many sweeping functions as possible from the public API since some of these are unused or only used internally.

With the following patches, this lets us remove public GCPolicy APIs for
sweeping raw pointers.

This is also required to remove some public GCPolicy methods for bare pointer
types.

Depends on D128257

This was a minor optimisation to remove unnecessary barriers but it probably
makes negligable difference.

Depends on D128258

This should make it hader for users of the public API to put unbarriered
pointers in hash tables.

Depends on D128259

This is intended to be a simple as possible so that compilers can optimise away
the bits that aren't used after inlining. The result value includes the edge
state before and after update and there are runtime checks that you only use
the right one, depending on whether the edge was removed or not.

The signature of TraceWeakEdge changes to allow any barriered type because in
practice we have weak edges that are no WeakHeapPtr in cases where we don't
want the read barrier (e.g. WeakMap keys).

Depends on D128260

Analagous to the sweeping tracer, this checks whether nursery things have been
moved and updates the edge as necessary.

Depends on D128261

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/428faca846f2
Part 1: Use HeapPtrObject in NonshrinkingGCObjectVector r=sfink
https://hg.mozilla.org/integration/autoland/rev/08feb5a97da0
Part 2: Add an UnsafeBarePtr wrapper for use in NurseryAwareHashMap r=sfink
https://hg.mozilla.org/integration/autoland/rev/d38fc222540e
Part 3: Change Zone::RttValueObjectSet to use HeapPtrObject r=sfink
https://hg.mozilla.org/integration/autoland/rev/7288d6f9db62
Part 4: Remove unused public APIs for sweeping pointers r=sfink
https://hg.mozilla.org/integration/autoland/rev/088062e599d5
Part 5: Add a result value for TraceWeakEdge that encapsulates all relevant information r=sfink
https://hg.mozilla.org/integration/autoland/rev/ea691ffad825
Part 6: Add minor sweeping tracer r=sfink
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: