[LLVMdev] Garbage collection: Multiple copies of a root

Harmen van der Spek hvdspek at liacs.nl
Fri Mar 20 04:09:33 PDT 2009


Hi,

As far as I understand now, only stack variables can be marked as gc  
roots. Our
compiler however can also generate roots that are not necessarily on  
the stack.
We can solve this by putting it on the stack anyway. So far so good.

The problem is that we want to implement some sort of copying garbage  
collector.
In this case, the roots on the stack must be updated. However, if  
this root is also
stored in an IR register, then this pointer should be updated as  
well. Is there
support for identifying and updating such references in the GC  
framework, or should we generate
code ourselves to reload the updated references from the stack.

Thanks,

Harmen



More information about the llvm-dev mailing list