[LLVMdev] Garbage Collection Project

Cory Nelson phrosty at gmail.com
Thu Jun 18 04:28:57 PDT 2009


On Thu, Jun 18, 2009 at 3:14 AM, Granville
Barnett<granvillebarnett at googlemail.com> wrote:
>
>> Firstly, rather than using a single 1 word pointer to represent a
>> reference I
>> chose to use 3 words including a pointer to the type and a pointer to the
>> value (as well as metadata). This allows typed nulls and that addresses an
>> important deficiency found in most other VMs including the CLR. Is
>> Scarcity
>> able to handle such references or does its implementation of stack frames
>> require references to be a single word?
>
> Three words sounds pretty expensive to me, I can see the use of an extra
> word for typed nulls. If you look at something like the CLR you will see
> that you have very fast access to an objects type, after all when you have a
> reference to an object what you really have is a reference to an objects'
> object header. From there you can access an objects syncblock (if it has
> one, which is before the obj header) and the objects' method table which
> includes the relevant pointers to the objects' type among other things. It
> simply means you do a few hops, each of which is a constant operation
> anyway.
>
> Maybe I'm missing something key about the language you are implementing the
> GC for, also is it really necessary to use an extra word for null types?

I'm also curious what language uses this and why it is useful :)
Also, things like this would make lock-free algorithms difficult or impossible.

-- 
Cory Nelson



More information about the llvm-dev mailing list