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.

227<br />

based on these profile results will also decrease class file size by utilizing one byte to<br />

represent those loads and stores that occur with greatest frequency and two bytes to<br />

represent loads and stores that are performed less frequently.<br />

Researchers and developers creating new intermediate representations and virtual<br />

machines should also consider these profiling results. In particular, these results<br />

indicate that while the Java Virtual Machine Specification provides a symmetric set<br />

of load and store bytecodes, the behavior of Java applications is not symmetric. The<br />

symmetries present that do not reflect the reality of the applications tested include:<br />

• Type Symmetry: The virtual machine specification provides 8 specialized<br />

load / store bytecodes for each of the 5 primitive data types supported by the<br />

virtual machine. However, the profile data collected shows that integer values<br />

are loaded and stored with great frequency while floating point and long integer<br />

variables are rarely used.<br />

• Slot Symmetry: Specialized load and store bytecodes are provided for slots<br />

0 through 3 for each data type. However, Java applications execute a large<br />

number of instance methods making accesses to slot 0 with object reference type<br />

far more common that accesses to this slot for other data types. The utilization<br />

of dload and lload bytecodes is also negatively impacted by this<br />

symmetry. Because doubles and long integers each occupy two adjacent slots<br />

in the local variable array, it is impossible for any method to make use of more<br />

than 2 of the specialized category 2 load bytecodes.<br />

• Load / Store Symmetry: The profile data collected during this study shows<br />

that applications perform many more loads than stores. Consequently, providing<br />

the same number of specialized load and store bytecodes is illogical. Instead,<br />

more specialized bytecodes should be devoted to performing loads than stores<br />

since loads execute with greater frequency.<br />

Based on these results, the author concludes that future intermediate representations<br />

and virtual machines should have an asymmetric instruction set. If specialized bytecodes<br />

are included, the number of load bytecodes should exceed the number of store<br />

bytecodes and those specialized bytecodes should only be provided for those slots and<br />

data types that are expected to be used frequently.<br />

The concept of multicodes was introduced in Chapter 7. A detailed discussion<br />

was presented which outlined the gains that can be achieved by replacing frequently<br />

executed sequences of bytecodes with a single new multicode. A profiling technique

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

Saved successfully!

Ooh no, something went wrong!