Adding them to the set of things the GC tracks requires global synchronization that limits parallelism. Also, types that use those APIs tend to use them unconditionally, so we could just put the type into a subspace and iterate the subspace during finalization (to emulate UnconditionalFinalizer) and during constraint solving (to emulate WeakReferenceHarvester).
The outcome of this change should be an increase in GC throughput. It might even improve splay perf.
So far, this isn't yielding any speed-ups. It's also not yielding slow-downs either. So maybe the lock contention measurements that I made previously were showing the kind of contention that isn't actually a perf problem.
But this is a clean way of introducing IsoSubspaces. In the world of IsoSubspaces for everything, we shouldn't need UnconditionalFinalizers or WeakReferenceHarvesters.
Great, now, I have WeakMap/WeakSet redesign patch in my hand. I'll apply your change to my new WeakMap/WeakSet too :)
(In reply to Yusuke Suzuki from comment #2)
> Great, now, I have WeakMap/WeakSet redesign patch in my hand. I'll apply
> your change to my new WeakMap/WeakSet too :)
> : https://bugs.webkit.org/show_bug.cgi?id=179929
Note that I’m about to change how unconditional finalization works again. The current approach is not a good fit for InferredValue. In the new API, you’ll be able to opt cells into and out of being part of the GC’s unconditional finalizes set.
The fancy thing is that now JSWeakMap is the last user of WeakReferenceHarvester. (JSWeakSet does not use it since WeakSet does not need to harvest weak references. All the keys are weak.)
Created attachment 341864 [details]
Committed r232463: <https://trac.webkit.org/changeset/232463>
(In reply to Keith Miller from comment #8)