Closed Bug 1559385 Opened 1 year ago Closed 10 months ago

Investigate tidying up StackGCCellPtr

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox69 --- wontfix
firefox73 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

Bug 1535154 will add StackGCCellPtr, a GCCellPtr that can be used inside Rooted. It's possible we can simplify this by either supplying a GCPolicy for GCCellPtr or moving the trace() method to GCCellPtr itself.

(In reply to Jon Coppeard (:jonco) from comment #0)

or moving the trace() method to GCCellPtr itself.

For what it's worth: I didn't do this because trace() doesn't know whether to trace as root vs edge right? Ideally we'd be able to support both cases so consumers can always call trace() on a GCCellPtr.

(In reply to Jan de Mooij [:jandem] from comment #1)
Good point, but I don't think we ever want to have GCCellPtrs as internal edges. Those should use the appropriate GC thing type.

Assignee: nobody → jcoppeard

This removes StackGCCellPtr and a bunch of indirection.

(In reply to Jon Coppeard (:jonco) from comment #2)

Good point, but I don't think we ever want to have GCCellPtrs as internal edges. Those should use the appropriate GC thing type.

See PrivateScriptData::trace for example: https://searchfox.org/mozilla-central/rev/62a130ba0ac80f75175e4b65536290b52391f116/js/src/vm/JSScript.cpp#4288

(In reply to Jan de Mooij [:jandem] from comment #4)
Oh, that was not the intended use of GCCellPtr. I'm now confused as to how my try run passed...

(In reply to Jon Coppeard (:jonco) from comment #5)
...oh, right, it's because PrivateScriptData::trace doesn't use GCPolicy<GCCellPtr>::trace.

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dc97cf74084d
Implement a way of tracing a GCCellPtr as a root r=jandem
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.