Go to main content

School of Computer Science Intranet

APT research areas

Discover our main research areas

Optimising Java programs through basic block dynamic compilation

Ian A. Rogers


This thesis presents new techniques designed to speed up the execution of Java programs within a Java Virtual Machine (JVM). It presents a JVM based on Dynamic Binary Translator (DBT) technology with developments to minimise unnecessary translation and produce optimised hot paths. Existing JVM runtime compilation technology compiles classes, methods or portions of a method. This can make the compilation process inefficient as not all the compiled code will be executed. It does mean however, that mapping from Java to a target machine´┐Ż code can be performed simply at a small number of boundaries.

The thesis develops low overhead mechanisms for executing Java bytecode by compiling it a basic block at a time, thus avoiding unnecessary translation. It also presents mechanisms for grouping translated blocks into larger blocks based on execution statistics. By a novel register-mapping technique inter-procedural optimisation at a low overhead is achieved. As all optimisations are directed by execution statistics, near optimal ordering of code and register usage can be produced quickly.

The thesis shows that basic block translation affords a saving of up to 18% fewer bytecodes being translated than if a method were translated. It is also shown that this is achieved with little overhead in the translated code. A set of representative single threaded Java benchmarks are used for analysis. The overall system performance is compared to the HotSpot client and server JVMs. The measured execution time is from 3.163 to 19 times slower. The thesis discusses how, with improved translation performance, this can be significantly increased. Combined with a more optimal set of library methods and translation savings, performance can be comparable and potentially better than state-of-the art JVMs.

The thesis is available as a PDF (1.2M).