
Permalink for comment 526364
JVM Bytecode to "native"
by Lennie on Wed 11th Jul 2012 11:50 UTC
Member since:

Java is compiled to processor independant bytecode so you can run it on any device which has a JVM which understands that bytecode. The bytecode is "the program" you download onto your device.

That bytecode than gets "compiled" at runtime optimized for the processor it is running on (x86, ARM, AMD64, etc.). This is what they call Just-In-Time compilation is. Depending on how JIT is done, it can mean that only the part of the code that is used will be JIT compiled.

As some examples: PHP files are also compiles to bytecode before it is run. The bytecode is what is actually 'running' when a PHP-script is doing it's work, it is interpreting the bytecode.

JavaScript doesn't use a bytecode intermediate, I believe. But it does do the JIT compilation to optimise for the processor it is running on.

Anyway, I assume the cache you mentioned is the used for the result of the JIT compilation.

And the reason why it needs to be cleared I guess is because for Android system classes it would always use the JIT and not even check if it the bytecode is newer/different/has been updated.

Edited 2012-07-11 11:53 UTC

Reply Score: 1