Re: Language features for compiler writing was: Java compiler courses

Hans-Peter Diettrich <DrDiettrich1@aol.com>
28 Apr 2007 23:30:35 -0400

          From comp.compilers

Related articles
[2 earlier articles]
Re: Java compiler courses torbenm@app-7.diku.dk (2007-04-26)
Language features for compiler writing was: Java compiler courses cfc@shell01.TheWorld.com (Chris F Clark) (2007-04-27)
Re: Language features for compiler writing was: Java compiler courses torbenm@app-2.diku.dk (2007-04-27)
Re: Language features for compiler writing was: Java compiler courses DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-27)
Re: Language features for compiler writing was: Java compiler courses la@iki.fi (Lauri Alanko) (2007-04-28)
Re: Language features for compiler writing was: Java compiler courses jon@ffconsultancy.com (Jon Harrop) (2007-04-28)
Re: Language features for compiler writing was: Java compiler courses DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-28)
Re: Language features for compiler writing was: Java compiler courses danwang74@gmail.com (Daniel C. Wang) (2007-04-28)
Re: Language features for compiler writing was: Java compiler courses s.r.clarkstone@durham.ac.uk (Simon Richard Clarkstone) (2007-04-29)
Re: Language features for compiler writing was: Java compiler courses torbenm@app-5.diku.dk (2007-05-04)
Re: Language features for compiler writing was: Java compiler courses dot@dotat.at (Tony Finch) (2007-05-04)
| List of all articles for this month |
From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers,comp.lang.functional
Date: 28 Apr 2007 23:30:35 -0400
Organization: Compilers Central
References: 07-04-074 07-04-084 07-04-109 07-04-125 07-04-134
Keywords: Java, functional, design
Posted-Date: 28 Apr 2007 23:30:35 EDT

Torben Ęgidius Mogensen wrote:


> In SML and similar langauges with updatable references, you can build
> and manipulate graph nodes and edges directly. If a part of the graph
> becomes unreachable from the root set, it is GC'ed.


A note, applicable to many languages:


Graph transformations are one reason, why GC requires RTTI. Imagine
that you want to move a node around in the tree. Since it cannot
reside in two places at the same time, you have to remove it first,
and ... bang!?


That's why a mark-sweep collector must know about e.g. parameters and
local variables in subroutines, where a reference to the above node
will prevent it from being collected. When a garbage collector
searches the entire call stack for possible object references, it can
find false references, e.g. locations containing patterns that look
like an object reference. Fortunately that's quite harmless, such a
misinterpretation will never cause an object to be collected. More
annoying were unaligned references, where every byte in the stack
could be the first byte of a reference. Such guessing also disallows
copy-collection, because then a false hit will result in a modifaction
of an unrelated value, when the object is moved during GC.


DoDi


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.