That is, it's the same strategy that CPython uses (although CPython's detector is generational). People seem to say that CPython's design is old or suboptimal, but a brand new interpreter made the same choices.
And as the manual says, a major reason is that the interpreter can hold pointers to values without any special consideration. In contrast, v8 has to carefully wrap everything in Handle<>, and there are a bunch of elaborations on that which seem tricky to me. Then again, doing ref counting with 100% accuracy by hand also seems tricky to me.
AIUI part of the trade-off between cycle counting and tracing is ease of implementation vs performance. I also remember reading somewhere (unfortunately the where is lost to the mists of my memory) that as the reference implementation simplicity was an explicit goal of CPython, to the extent that there's little optimization done to the bytecode.
https://bellard.org/quickjs/quickjs.html#Garbage-collection
That is, it's the same strategy that CPython uses (although CPython's detector is generational). People seem to say that CPython's design is old or suboptimal, but a brand new interpreter made the same choices.
And as the manual says, a major reason is that the interpreter can hold pointers to values without any special consideration. In contrast, v8 has to carefully wrap everything in Handle<>, and there are a bunch of elaborations on that which seem tricky to me. Then again, doing ref counting with 100% accuracy by hand also seems tricky to me.