Hello! I'm looking at "Overview of available features" here: http://llvm.org/docs/GarbageCollection.html#collector-algos and can't understand something. First, does table header mean that there are already some GC's implemented besides "shadow stack"? E.g. can I just use them? Second, does row "JIT", "NO" mean that GC is not compatible with jitting at all? Best regards, Victor Milovanov.
As I understand it, LLVM simply gives you support for garbage collectors that you have to implement yourself and link into the final binary, similar to what C's malloc does (it's a library call). The issue with GC's is that they need to be provided info about the stack, thats where LLVM's support comes in. As far as I know, the garbage collector is linked into the final binary along with the language's runtime. On Thu, 2010-09-16 at 22:30 +0400, lost wrote:> Hello! > > I'm looking at "Overview of available features" here: > http://llvm.org/docs/GarbageCollection.html#collector-algos and can't > understand something. > First, does table header mean that there are already some GC's > implemented besides "shadow stack"? E.g. can I just use them? > Second, does row "JIT", "NO" mean that GC is not compatible with jitting at all? > > Best regards, > Victor Milovanov. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Hi Victor, You can write your own GC or use other's GC with LLVM. What LLVM provides is a framework to generate a representation of objects locations in a method's frames. Right now, LLVM can emit the shadow stack (which dynamically updates the locations), or the ocaml format. If you have implemented a GC, you can parse the ocaml format to locate the objects. I think the web page needs to be updated, because you can make the GC work with the JIT. You can just use LLVM's internal representations of frames. Hope that helps, Nicolas On Thu, Sep 16, 2010 at 8:30 PM, lost <lostfreeman at gmail.com> wrote:> Hello! > > I'm looking at "Overview of available features" here: > http://llvm.org/docs/GarbageCollection.html#collector-algos and can't > understand something. > First, does table header mean that there are already some GC's > implemented besides "shadow stack"? E.g. can I just use them? > Second, does row "JIT", "NO" mean that GC is not compatible with jitting at > all? > > Best regards, > Victor Milovanov. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100917/c9647088/attachment.html>
On 17/09/10 09:55, Pedro Ferreira wrote:> As I understand it, LLVM simply gives you support for garbage collectors > that you have to implement yourself and link into the final binary, > similar to what C's malloc does (it's a library call). The issue with > GC's is that they need to be provided info about the stack, thats where > LLVM's support comes in.Are there any standalone accurate garbage collectors that I could use in my project, rather than having to write me own (or use libgc, which is what I'm doing now)? Garbage collectors are subtle and very tricky and I really don't want to have to do one myself, as I know I'll just get it wrong. -- ┌─── dg@cowlark.com ───── http://www.cowlark.com ───── │ │ life←{ ↑1 ⍵∨.^3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵ } │ --- Conway's Game Of Life, in one line of APL -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100917/3ab035fa/attachment.sig>
Does this mean that everything I should do to make simple GC working is setting shadow stack as a GC for every function, calling GC's alloc to allocate (and possible do garbage collection), and during garbage collection I need to traverse shadow stack to get list of stack object references? If so, how can I access shadow stack pointer? Is there any function or must I declare some external variable and then link llvm? Best regards, Victor Milovanov. 2010/9/17, nicolas geoffray <nicolas.geoffray at gmail.com>:> Hi Victor, > > You can write your own GC or use other's GC with LLVM. What LLVM provides is > a framework to generate a representation of objects locations in a method's > frames. Right now, LLVM can emit the shadow stack (which dynamically updates > the locations), or the ocaml format. If you have implemented a GC, you can > parse the ocaml format to locate the objects. > > I think the web page needs to be updated, because you can make the GC work > with the JIT. You can just use LLVM's internal representations of frames. > > Hope that helps, > Nicolas > > On Thu, Sep 16, 2010 at 8:30 PM, lost <lostfreeman at gmail.com> wrote: > >> Hello! >> >> I'm looking at "Overview of available features" here: >> http://llvm.org/docs/GarbageCollection.html#collector-algos and can't >> understand something. >> First, does table header mean that there are already some GC's >> implemented besides "shadow stack"? E.g. can I just use them? >> Second, does row "JIT", "NO" mean that GC is not compatible with jitting >> at >> all? >> >> Best regards, >> Victor Milovanov. >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >