[Mono-list] Announce: A .NET assembly -> native code generationtool (ala ngen for MONO)

Dietmar Maurer dietmar@ximian.com
01 Aug 2002 16:32:53 +0200


On Thu, 2002-08-01 at 13:42, Zoltan.2.Varga@nokia.com wrote:
> A conservative garbage collector, like the Boehm collector can work with gcc code if the code is "GC-safe", i.e. it always
> keeps pointers to the beginning or interior of all live objects. An example of non-gc safe code is:
>      a[i - 5] = 0;
> 
> When confronted with such code an optimizing compiler might decide to transform it to something like (a-5)[i], which means
> there are no pointers left pointing to a, so it will be garbage collected. A relevant paper is here:
> 
> http://www.hpl.hp.com/personal/Hans_Boehm/gc/papers/pldi96.ps.gz
> 
> Unfortunately, based on a web search on google about 'gcc gc-safe', it looks like the code generated by gcc is not always
> gc-safe. It looks like the projects which use Boehm-GC like to live dangerously...
> It might be possible to generated GC safe code based on the ideas of the above paper.
> 
> Of course, the gcc approach does not work at all with non-conservative collectors, since these like to know which registers/
> memory locations contain pointers.

We consider the Boehm GC only as temporary solution, so our final ngen
solution must be able to work with non-conservative collectors.

- Dietmar