[m-dev.] LLDS accurate GC status

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 15 19:20:06 AEST 2003


On 15-Oct-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> On Wed, Oct 15, 2003 at 09:49:58AM +1000, Fergus Henderson wrote:
> > 
> > Accurate GC is slower than the conservative collector when used with the
> > high-level back-end.  The reason is that with the high-level back-end,
> > we don't control register allocation; in order to keep track of the
> > locations of pointers, so that they can be traced and updated by the
> > collector, we need to take their addresses, which prevents the C compiler
> > from putting them in registers.  So for the high-level back-end,
> > accurate GC inhibits register allocation.  For the low-level back-end,
> > we do our own register allocation (to our own virtual register set,
> > some of which get mapped to real registers), so we have enough
> > information for the GC to trace values even when they are stored in
> > registers.  Thus the overhead of accurate GC is much smaller for the
> > low-level back-end.
>
> So do you have any ideas on how to work around this for the high level
> backend?

Sure... the easiest one is to compile to C-- instead of C.  C-- provides
hooks which can be used to allow a collector traverse all the pointers
on the stack.

But current C-- implementations are probably not good enough to make
this worthwhile.  To actually realize the potential performance gain we'd
need someone to write a C-- implementation that is performance-competitive
with GCC.

Another alternative would be to hack GCC to keep the information that the
garbage collector needs around at runtime.  Perhaps this could be done
using the DWARF debugging information.  But this alternative is extremely
difficult, to the point of not being feasible with our current resources.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list