AutoGCRooter roots get traced multiple times




3 years ago
3 years ago


(Reporter: fitzgen, Unassigned)


Firefox Tracking Flags

(Not tracked)


I noticed this while I was debugging a pointer that wasn't being updated properly. I was logging every time my AutoGCRooter subclass's trace method was called and it was called tens of times for a single gc (I was using trc->runtime()->gc.gcNumber() to determine that it was the same gc).

The test case I was debugging was js/src/jit-test/tests/debug/Memory-takeCensus-09.js and I was using zeal 14. The AutoGCRooter subclass was

I know AutoGCRooter is on its way out, being replaced with JS::Traceable and Rooted, but if we are unnecessarily tracing the same things multiple times, I figured y'all would want to investigate.
Thanks for the report!

For a compacting GC we mark the roots once per zone we compact because there's no way of marking the roots in a particular zone only.

This is not ideal, but also it's not the most costly part of compacting either.
You need to log in before you can comment on or make changes to this bug.