Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can GCJ only handle source code?

GCJ source code
0
10 Posted

Can GCJ only handle source code?

0

GCJ will compile both source (.java) and bytecode (.class) files. However, in many cases the native code produced by compiling from source is better optimized than that compiled from .class files. Per Bothner explains: The reason is that when you compile to bytecode you lose a lot of information about program structure etc. That information helps in generating better code. We can in theory recover the information we need by analysing the structure of the bytecodes, but it is sometimes difficult – or sometimes it just that no-one has gotten around to it. Specific examples include loop structure (gcc generates better code with explicit loops rather than with the equivalent spaghetti code), array initializers, and the JDK 1.1 `CLASS.class’ syntax, all of which are represented using more low-level constructs in bytecode.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123