[LLVMdev] JVM Backend

Dan Gohman gohman at apple.com
Mon Nov 30 13:01:01 PST 2009


On Nov 29, 2009, at 10:46 AM, Jon Harrop wrote:

>> 
>> No, structs are supported. The only unsupported types at the moment
>> (as far as I am aware) are things like i31 and f80.
> 
> How do you support structs when the JVM is incapable of expressing value 
> types? Do you box every aggregate in an object? Does insertvalue construct an 
> entirely new object? If so, the performance degradation will be orders of 
> magnitude. Optimizing structs for the JVM is not easy and you will never get 
> decent performance out of the JVM in the general case.

First-class aggregate values can be supported in an environment like this
by lowering each member of a struct into a separate variable. This is what
LLVM's lib/CodeGen backends do, for example. Perhaps some of the code for
that could be factored out into utility routines.

Dan





More information about the llvm-dev mailing list