This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: libffi & LLVM
- From: Andrew Haley <aph at redhat dot com>
- To: Anthony Green <green at redhat dot com>
- Cc: libffi-discuss at sourceware dot org
- Date: Fri, 23 Oct 2009 13:02:35 +0100
- Subject: Re: libffi & LLVM
- References: <4AE1965D.1030808@redhat.com>
Anthony Green wrote:
> The latest MacRuby version replaced libffi with LLVM for closure
> support, the result of which is 3 to 4 times performance boost:
> http://www.macruby.org/blog/2009/10/07/macruby05b1.html
I wonder if they measured the overhead for generating the closures.
If they didn't, perhaps we should. Also, LLVM has a pretty big
footprint. So, it's not all positive.
> I've been thinking for a while that a LLVM backend to libffi makes
> sense. Does anybody have any thoughts or opinions on this?
It makes some sense, but I warn you: while working on Shark we've
found that the JIT interfaces to LLVM are rather unstable. We'd be
setting libffi up for an eternal game of catch-up every time the
LLVM interfaces change. (Perhaps not eternal: there's every chance
that as LLVM matures its JIT interface will stabilize.)
A better solution for libffi closures would be for libffi to generate
its own code, but I think that would be too much effort, given the
complexity of some of the ABIs we have to work with.
Andrew.