Closed Bug 1750792 Opened 2 years ago Closed 2 years ago

Add an abstraction for pointers to malloc-allocated structures containing GC thing pointers

Categories

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

task

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

For pointers between GC things we have the GCPtr abstraction, which adds a pre-write barrier to ensure our incremental marking invariants are enforced.

There's a few places however where we have a pointer from a GC thing to a malloc-allocated structure containing GC pointers. When the pointer to this structure is overwritten we also need such a barrier, but this must be added manually at the moment.

For concurrent marking we may need additional barriers (e.g. a memory fence) in situations like these, so it makes sense to add an abstraction for this.

Adds GCStructPtr to hold pointers from GC things to malloc-allocated structures
containing GC things, adding a write barrier when the pointer is overwritten.

The set() method also takes a Zone pointer so that we can check whether
barriers are currently required.

The patch replaces use of such pointers with the abstraction.

Depends on D136249

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/77fb99339966
Add GCPtr-style abstraction for pointers to malloced structures that hold GC pointers r=jandem
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: