[LLVMdev] LLVM JIT + Boehm's GC, Need I Worry?

Nicolas Geoffray nicolas.geoffray at lip6.fr
Tue Mar 10 10:50:35 PDT 2009


Nyx wrote:
> The virtual machine I'm implementing allocates objects on the heap using
> Boehm's garbage collector. I currently have an interpreter working for my
> language, and I'm working on a JIT that will compile some of the functions
> that would otherwise get interpreted.
>
> What I'm wondering is whether or not I need to perform special adjustments
> for the GC to work properly. My understanding is that the Boehm GC can scan
> the stack for roots. Functions compiled from LLVM into machine code should
> just be normal functions on the stack when they are called... And thus, I
> don't think I need to change anything, Boehm's GC should be able to find
> roots in those functions when they are on the stack just as well as any
> C/C++ function.
>
> Am I mistaken about this?
>   

No mistakes here :) You don't need to do anything with the Boehm GC. 
VMKit uses it without doing anything.


Nicolas



More information about the llvm-dev mailing list