[virtmach] VM with garbage collection

Anton Ertl anton@mips.complang.tuwien.ac.at
Fri, 11 Jan 2002 13:54:02 +0100 (MET)

Bart Demoen wrote:
> > > 4. As in 3., but observe that if the GC understands the instruction format,
> > >    it doesn't need the table but can find the pointers itself. This is very complex.
> > 
> > This is really a just refinement of 1. It loses to 3 because for 3 you
> > don't have to change the GC to accomadate new instructions or native
> > code.
> If you have a description of your instructions at a bit higher level,
> you can use this description to generate the GC (at least the part
> that is related to code) instead of writing it. We followed such an
> approach for the code GC itself. As far as GC is concerned, adding an
> instruction means only adding its description - the description is
> also used to generate the loader, necessary tables for the compiler, a
> print-code routine, a bunch of C-macros ... 
> Makes us very willing any day to add new instructions or delete some :-)

Right, I have similar experiences with code-walking routines generated
by vmgen (http://www.complang.tuwien.ac.at/anton/vmgen/), e.g., the
disassembler and the profiler (no garbage collection support yet),
among other stuff.

- anton