Re:Executing ARM Jazelle (JVM Bytecode) on the Wii's Starlet
by colejohnson66 on Friday November 29, 2024 @08:39AM
(#42273774)
Not just JITs; An out-of-order scheduler would have no issue reordering those instructions. However, Jazelle was designed for the low-end ARM processors that are all in-order (or were at the time; not sure how true that is today)
Because Jazelle converted Java bytecodes into ARM instructions in sequence, there is no opportunity for any instruction scheduling. So a bytecode sequence like:
would go down the pipeline as something like: There would be a pipeline stall before each instruction marked with a *.On the first ARM 9 CPUs with Jazelle, the pipeline is fairly similar to the standard 5 stage RISC pipeline (Fetch-Decode-Execute-MemoryAccess-Writeback) so this stall would be 1 cycle. That wasn't too bad - you could just accept that loads took usally 2 cycles, and it would still be pretty fast.
However, on later CPUs with a longer pipeline the load-use delay was increased. By ARM11, it was 2 cycles - so now the CPU is spending more time waiting for pipeline stalls that it spends actually executing instructions.
In contrast, even a basic JIT can implement instruction scheduling and find some independent instructions to do between a load and the use of the result, which makes the JIT much more performant than Jazelle could be.