4 ms·
Isn't java already compiled ahead-of-time? You give the JVM a .class file, not a .java file. Though this is a technicality. Java 9 will be able to compile ja
by shuntress 10y ago
Isn't java already compiled ahead-of-time?
You give the JVM a .class file, not a .java file.
Though this is a technicality.
Java 9 will be able to compile java source code to java byte code then compile that java byte code to native machine code, correct?
- mason55 10y agoIt is compiled to intermediate byte code but not machine code. You still need the JVM to JIT the byte code to something the CPU can deal with.
- jsprogrammer 10y agoNot necessarily. Java byte code can be run directly on a JPM (Java Physical Machine).
- jerven 10y agoAre there any that support the current class file format? ARM jazelle is no longer being worked on. So I would be surprised if there is anything that can do Java SE directly. JavaCard of course being quite different than standard Java.
- imtringued 10y agoJava bytecode is too highlevel for it to be suitable to run directly on hardware. Each instruction can map to multiple machine instructions. A JIT or AOT compiler can optimize the code on a lower level. A hardware implementation cannot do inlining, loop unrolling, hoist array length checks out of a loop, etc...
- jdc0589 10y agocompile means "native code" here, not jvm bytecode.
- brianwawok 10y agoLook at class file sometime. It is basically bad C code in appearance. It is nowhere close to assembly type code, which is what the final output of the JIT is.
- joe-user 10y agoMaybe I'm crazy, but the bytecode dumped from a class file definitely looks more like assembly than "bad C" to me, personally: https://gist.github.com/anonymous/e824444ea158beb7b72b26fbf19ba23b https://gist.github.com/anonymous/e824444ea158beb7b72b26fbf1...