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.

123<br />

load and store bytecodes. It is the author’s belief that the larger use of specialized<br />

constant loading bytecodes is the result of the fact the bytecode language designers<br />

chose to introduce an asymmetry into the language, supplying more instructions for<br />

handling integer constants than constants of other types. However some integer constants<br />

such as 8, 16 and 65535 still occur more frequently than at least half of the<br />

specialized constant loading bytecodes. It was also observed that unlike the specialized<br />

store bytecodes, all of the specialized constant loading bytecodes made available<br />

by the Java Virtual Machine Specification are executed by the benchmarks tested in<br />

this study.<br />

Examining additional constant loading bytecodes reinforces the patterns observed<br />

initially.<br />

In particular, it was observed that the majority of the top 20 constant<br />

loading bytecodes executed were used for handling integers. Only 5 of these bytecodes<br />

were used to handle other types including 2 bytecodes for loading double constants,<br />

2 bytecodes for loading long integer constants and aconst null, the bytecode that<br />

places the null object reference constant on the stack 1 .<br />

This leaves 15 of the top<br />

20 bytecodes handling integers. It was also observed that 10 of the top 20 load<br />

bytecodes are specialized, a proportion that was superior to that achieved by either<br />

the load or store bytecodes. This is particularly noteworthy because there are only<br />

15 specialized constant loading bytecodes compared to 20 each for specialized load<br />

and store bytecodes.<br />

Examining the top 40 load bytecodes reveals that 29 are used for loading integer<br />

values. The presence of 3 additional long integer constants and 2 additional double<br />

constants was also observed when the top 40 constant loading bytecodes were compared<br />

to the top 20 constant loading bytecodes. The three long integer constants<br />

are particularly noteworthy because the constant values 281474976710655, 2521490-<br />

3917 and 11 are all used during random number generation. The JGF benchmarks<br />

SOR, FFT, HeapSort, and Spare Matrix Multiplication make use of a random number<br />

generator in order to populate data structures. Populating data structures in<br />

this manner is not typical of most “real world” applications. As a result, specializing<br />

constant values used for this purpose is not recommended.<br />

Further analysis was conducted in order to determine which constant values were<br />

1 Strictly speaking aconst null is not a specialized bytecode since the current Java Virtual Machine<br />

Specification does not permit a null object reference to be loaded from the constant pool.<br />

However, such an extension to the semantics of ldc/ldc w would be minor making aconst null a<br />

possible candidate for despecialization if any changes are made to the Java Virtual Machine Specification.<br />

As a result, it was included as part of this analysis.

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

Saved successfully!

Ooh no, something went wrong!