Can gcj be a Java front-end for llvm as well?

View: New views
3 Messages — Rating Filter:   Alert me  

Can gcj be a Java front-end for llvm as well?

by Yuri-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When I look at GCJ I see that it's a very powerful technology,
generating gcc memory structures to represent code in the end and using
gcc mechanism to write final binary objects.

Since most work that GCJ does isn't directly related to the rest of gcc,
it seems to be possible to have the code generation phase have two
options: gcc and llvm. So it can be a Java frontend for llvm compiler as
well.
The rationale for this is that llvm in many cases produces more optimal
code and it's good to have such option if it doesn't come at too high price.

Does this suggestion seem reasonable?

Yuri


Re: Can gcj be a Java front-end for llvm as well?

by Mark Wielaard :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 2009-10-16 at 13:18 -0700, Yuri wrote:
> The rationale for this is that llvm in many cases produces more optimal
> code and it's good to have such option if it doesn't come at too high price.

When gcj/gcc produces sub-optimal code wouldn't it make more sense to
just fix gcj? Can you give some examples of such code?

Thanks,

Mark

P.S. There is http://vmkit.llvm.org/ladyvm.html if you need to use
llvm/vmkit. It might not produce the fastest runtime code, but it is a
quick way to mix and match various existing free software projects to
produce something gcj/java-like.


Re: Can gcj be a Java front-end for llvm as well?

by Yuri-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mark Wielaard wrote:
> When gcj/gcc produces sub-optimal code wouldn't it make more sense to
> just fix gcj? Can you give some examples of such code?
>  


It does make sense to fix gcj and gcc.
However, since gcj only connects to gcc for code generation, it can also
serve as a java frontend for llvm.
llvm obviously needs Java frontend (just like frontends for other common
languages). And why to redevelop it from scratch, if gcj is almost a
perfect fit?

I can't give a particular example of performance here now. But pretty
much every time when I compiled large (c++) project with llvm I got
better runtime compared to gcc. Usually 10-20%.

I don't try to put blame on gcc here. I am just saying that the more
uses gcj finds the better.

Yuri