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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

113<br />

function being integrated. Because the method to perform this task is an instance<br />

method, accessing its first parameter (the position at which to compute the value of<br />

the function) results in the use of a dload 1 bytecode rather than a dload 0. Had the<br />

JGF Series benchmark been removed from consideration, both dload 0 and dload 1<br />

would have dropped out of the top 40 most frequently executed load bytecodes.<br />

The preceding analysis leads to the conclusions that many specialized load bytecodes<br />

are not being utilized effectively. This suggests that a new set of specialized<br />

load bytecodes could be selected which would be executed with greater frequency.<br />

Ideally, the distribution of these specialized bytecodes would include those local variable<br />

positions and data types that are being used with greatest frequency. While the<br />

current selection of specialized load bytecodes has a level of symmetry to it that is<br />

appealing to many people because it offers identical coverage for all data types, it is<br />

not reflective of the reality of the bytecodes executed by Java applications. For example,<br />

no float or long loads are present in the list of 40 most frequently executed load<br />

bytecodes while half of the list consists of integer loads. Loads of double precision<br />

floating point values and object references account for the other half of the 40 most<br />

frequently executed load bytecodes. Reallocating many of the float and long loads<br />

to cover additional integer locations would shrink class file size and could improve<br />

virtual machine performance.<br />

In addition to suggesting changes to the distribution of specialized bytecodes based<br />

on data type, the absence of any loads for the float and long data types in the top<br />

40 specialized bytecodes suggests that optimizers may not want to spend the time<br />

necessary to perform complex optimizations on these data types. Since the bytecodes<br />

that access these data types are executed infrequently, any performance gains achieved<br />

from these optimizations would need to be vast in comparison to the gains achieved<br />

for integers, object references or double precisions floating point numbers.<br />

It was also observed that the design of the Java Virtual Machine greatly restricts<br />

the ability of the compiler to make use of the specialized bytecodes that access slot 0.<br />

The Java Virtual Machine specification requires that the receiver object be passed as<br />

the first parameter to all virtual methods. A direct consequence of this design choice<br />

is the fact that the specialized bytecodes dload 0, fload 0, iload 0 and lload 0 can<br />

never be executed in a virtual method since slot 0 is already occupied by the receiver<br />

object. While it was observed that the JGF Series benchmark makes effective use<br />

of the dload 0 bytecode, most applications make heavy use of instance methods,<br />

preventing them from making effective use of these bytecodes during much of their<br />

execution.

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

Saved successfully!

Ooh no, something went wrong!