Linked by Thom Holwerda on Tue 10th Jul 2012 17:08 UTC
Thread beginning with comment 526364
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
RE: JVM Bytecode to "native"
by Lennie on Fri 13th Jul 2012 23:59
in reply to "JVM Bytecode to "native""
RE[2]: JVM Bytecode to "native"
by zima on Tue 17th Jul 2012 23:33
in reply to "RE: JVM Bytecode to "native""




Member since:
2007-09-22
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