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.

121<br />

are never executed by any of the benchmarks. The fifth bytecode, lstore 2, is<br />

executed extremely infrequently, accounting for less than 1 out of every 1 million<br />

bytecodes executed. The presence of three store bytecodes that access slots 0 and 1<br />

in this list is the result of the pass by value semantics used for all method parameters<br />

of primitive type as described previously. The presence of lstore 2 and fstore 2 in<br />

this list is due to the relatively infrequent use of the long and float data types as<br />

described previously.<br />

These results indicate that future virtual machine designers should eliminate both<br />

the symmetry that exists across data types accessed by load and store bytecodes and<br />

the symmetry that exists in the slot numbers between the load and store bytecodes.<br />

Future instruction sets should include more specialized loads than specialized stores<br />

and both loads and stores should be concentrated on those data types executed with<br />

greatest frequency. The results of this study indicate that integers should receive<br />

the greatest attention in this regard with additional specialized bytecodes also being<br />

allocated for object references and doubles. Specialized loads and stores for floats and<br />

longs are generally executed infrequently leading to the recommendation that few, if<br />

any, specialized bytecodes be allocated for handling these data types.<br />

6.2.3 Constant Loading<br />

There are three general mechanisms provided by the Java Virtual Machine that allow<br />

a constant value to be placed on the operand stack. One option is to use a specialized<br />

bytecode that pushes a specific value dictated by the opcode employed. A second<br />

option is to load a value from the constant pool onto the operand stack. Finally, it is<br />

also possible to generated integer constants within a limited range using the bipush<br />

and sipush bytecodes. These bytecodes read one or two operand bytes directly from<br />

the code stream which represent the constant value to be placed on the stack. Table<br />

6.1 lists the 40 most frequently used constant values and the manner in which each<br />

was placed on the stack.<br />

It is interesting to note the six most frequently executed constant loading bytecodes<br />

are specialized. The remaining four bytecodes in the 10 most frequently executed<br />

constant loading bytecodes are general purpose. These include 4 specialized<br />

integer loads and 2 specialized double loads, leaving 3 general purpose integer load<br />

bytecodes and one general purpose long integer load in the top 10. This result indicates<br />

that the choices made for what constant values should be handled by a specialized<br />

bytecode appear to have been better than the corresponding choices made for

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

Saved successfully!

Ooh no, something went wrong!