Currently there is only one implementation of isInsideNewspace / isInsideFromspace in ForkJoinNursery-inl.h. This implementation takes a void* and performs a range check on each chunk in the nursery. (There are some notes there about performance.) In the case when the nursery grows relatively large - more than a few chunks - this test may become hot, since it executed very frequently, more than once per object in practice during GC (once for the object, and once each for slot and element arrays), but also during slot allocation. A specialization is possible where an implementation takes a Cell* and checks the descriptor bits on the chunk holding that cell, but only if we have ways of telling not just fromspaces from newspaces from other spaces, but fromspaces and newspaces belonging to separate ForkJoinNurseries from each other. For that, the descriptor probably needs to contain a field that denotes the worker ID. I don't think we have to worry about workers in separate runtimes having the same ID because as soon as we know something is a Cell we know it's a pointer into this runtime's heap.
This was actually implemented at some point, and the basic functionality will remain even after PJS is gone.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Ah nevermind, the worker ID field was never supported.)
Resolution: FIXED → WONTFIX
You need to log in before you can comment on or make changes to this bug.