Any interpreter could theoretically do those "marking" things, also JIT's do far more than just "bytecompile" hot loops, _all_ cooperative modern GC's are enabled by JIT semantics for things like read and/or write barriers (this helps a GC keep track of objects that keep getting "touched" whilst the GC can work in parallel).

Outside of the mentioned, things like detecting finegrained lifetimes is very very hard and the mentioned escape analysis is an optimization that needs to be capped to avoid the halting problem. (1)

A fairly deep covererage of GC behaviours can found in Bacon's "Unified Theory of Garbage Collection" where the author theoretically connect previous works on tracing collectors and reference-counting systems and show that the optimized variations often existing in a design-space between them. (2)

1: https://en.wikipedia.org/wiki/Halting_problem

2: https://web.eecs.umich.edu/~weimerw/2008-415/reading/bacon-g...

[dead]