[LLVMdev] Re: Newbie questions

Archie Cobbs archie at dellroad.org
Wed Apr 26 19:08:32 PDT 2006

Tom Tromey wrote:
> Are we bugging the LLVM folks with all this JVM talk?  We could find
> (or make) another list to discuss this.

Probably :-) At least I think I understand things better now anyway
and plan to pipe down a bit.

> Archie> E.g. devirtualization: this requires knowing the Java type
> Archie> (not LLVM type) of an object. But once you compile to LLVM,
> Archie> that information is lost.
> Archie> If e.g. you're loading LLVM pre-compiled modules then you can
> Archie> never do this optimization because you can't recover the Java
> Archie> type information (which is front-end specific).
> I'm sure you know that precompilation of Java code is already super
> tricky.  To be compatible you have to defer most things anyway.
> But... I think I don't understand your situation that well.

I was using precompilation in the example just to make it explicit
that only the information explicitly supported by the LLVM language
would be available at runtime. Maybe not the best example though.

> In the JIT, devirtualization looks doable, though somewhat fiddly.  At
> least, that is true for straightforward things like calls to methods
> in final classes, or calls to methods on objects allocated with 'new'
> in the current function.  (The latter could be done AOT, at least if
> you defined a way to do the appropriate runtime link; I've considered
> it for gcj.)

I'm not that familiar with how your stuff works, but it sounds like
you would have to do these optimizations before converting to LLVM
format, right?


Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

More information about the llvm-dev mailing list