13.10.2014 Views

OPTIMIZING THE JAVA VIRTUAL MACHINE INSTRUCTION SET BY ...

OPTIMIZING THE JAVA VIRTUAL MACHINE INSTRUCTION SET BY ...

OPTIMIZING THE JAVA VIRTUAL MACHINE INSTRUCTION SET BY ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

100<br />

interruption was less than two percent of the original benchmark runtime. While<br />

these interruptions were reproduced each time the benchmark was tested, their small<br />

magnitude makes them relatively uninteresting.<br />

The fact that any of the benchmarks showed performance characteristics that<br />

resided in the third group (improved performance as the number of despecializations<br />

increased) was a surprising result. The result that was most shocking was the performance<br />

of JGF LUFact when it was executed using IBM’s RVM on a Pentium 4. A<br />

large reduction in execution performance was observed when 48 or more despecializations<br />

were performed. Performing further tests revealed that the performance gain<br />

of approximately 42 percent could be attributed to the despecialization of the ifeq<br />

bytecode.<br />

Further work was conducted in order to isolate which occurrences of ifeq were<br />

responsible for the change in performance. This involved despecializing groups of<br />

class files until the change in performance was observed. No change in performance<br />

was observed when all occurrences of ifeq were removed from the class files in the<br />

Java library. The change in performance was observed when the original library<br />

class files were employed in conjunction with despecialized benchmark application<br />

files. Despecializing progressively smaller sets of the benchmark’s class files eventually<br />

resulted in the determination of the fact that despecializing only one class file was<br />

responsible for the change in performance. Furthermore, by despecializing only some<br />

of the occurrences of ifeq within that file, it was determined that exactly one static<br />

occurrence of ifeq was responsible for the observed performance increase.<br />

Examining IBM’s RVM revealed that this change in performance is the result of<br />

an unexpected interaction between the bytecode sequence present after despecialization<br />

is performed and the virtual machine’s optimizing compiler. When IBM’s virtual<br />

machine performs JIT compilation it may make use of either its baseline compiler or<br />

its optimizing compiler. The baseline compiler is used initially, quickly generating<br />

machine code that is far from optimal. This translation process is performed on a<br />

per-bytecode basis with no time spent trying to optimize any interactions present<br />

between adjacent bytecodes. When the virtual machine recognizes that a particular<br />

method is executed with great frequency, the method is recompiled using the optimizing<br />

compiler which generates machine code that is generally of much higher quality<br />

than the code generated by the baseline compiler. One technique employed by the<br />

optimizing compiler involves performing pattern matching on the bytecode stream.<br />

This technique, referred to as bytecode idiom matching, identifies sequences of bytecodes<br />

that are found to occur commonly and automatically generates high quality

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!