This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: robustness vs. conservative GC


On 30-Jul-2001, dewar@gnat.com <dewar@gnat.com> wrote:
> <<I don't see how you can obtain that sufficient information
> without cooperation from the compiler back-end.
> >>
> 
> But you can't do any kind of type accurate GC without information from the
> compiler back end in any case.

Yes you can, see the code in my other post.

> Actually that's not quite true, see for
> example the CDC implementation of ALgol-68, where they simply went to a fully
> typed runtime data representation (i.e. by looking at any word in memory
> you can tell if or if it is not a pointer).

Just using a fully-tagged data representation like that is not
sufficient for accurate GC in an uncooperative environment.  Relying on
a fully-tagged data representation also requires cooperation from the
compiler back-end.  An uncooperative compiler might (a) store arbitrary
values in registers and on the stack, which the GC might mistake for
pointers, or (b) store pointers with the wrong tag in registers or on
the stack, as a result of compiler optimizations.

However, the approach that I outlined in my other post does not require
any tags on the data.  For example, you can keep all the necessary
type information in the vtables for the StackFrame objects.

BTW, someone must have used the approach that I outlined before, of storing
structs on the stack and manually linking them; the technique is very simple,
so I can't believe that I'm the first to have invented it.  However, I don't
happen to know off-hand of any language implementations that use it.  Does
anyone reading this list happen to know of any systems that have used it,
or papers that have talked about it?

-- 
Fergus Henderson <fjh@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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]