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.

220<br />

One option would be to treat multicodes as two byte opcodes while retaining single<br />

byte opcodes for the bytecodes currently defined by the Java Virtual Machine<br />

Specification. This could be accomplished in a manner similar to that employed by<br />

the wide bytecode which is immediately followed by a second opcode specifying what<br />

functionality should be performed in a wide manner. Unfortunately, this strategy increases<br />

the amount of bytecode fetch overhead compared to implementing multicodes<br />

in a manner identical to other bytecodes because a second decode operation must be<br />

performed once it has been determined that the first byte in the two byte structure<br />

indicates the presence of a multicode. However, if the length of the multicode is<br />

greater than 2, the total number of decode operations being performed is still being<br />

reduced compared to the original sequence.<br />

A second option would be to use two byte opcodes for all bytecodes and multicodes.<br />

In essence, this would change the structure of the class file from being bytecode<br />

oriented to being short-code oriented. Those opcodes that require an odd number of<br />

operand bytes would be padded so that the the number of operand bytes was always<br />

even. As a result, the size of the code attribute would approximately double in size.<br />

Adjusting the operands in this manner is not critical on Intel architectures because 2-<br />

byte memory loads are permitted from any address. However, on architectures which<br />

employ memory access alignment rules such as a Sun SPARC, padding operands in<br />

this manner would be critical to the performance of the virtual machine. If operand<br />

padding was not performed, it would be necessary for the low and high order halves of<br />

the opcode to be loaded as separate single byte loads in order to meet the constraints<br />

imposed by the architecture’s alignment rules. Failing to align loads correctly on a<br />

SPARC results in a segmentation fault.<br />

By employing either of these options, the total number of multicodes that can be<br />

executed increases considerably. Under the first option, the number of multicodes<br />

available would grow from 52 to over 13000. If the second option were implemented,<br />

it would be possible to implement more than 65000 multicodes. However, given<br />

the diminishing returns that are observed in all of the performance results, it is<br />

unlikely that it would be worthwhile implementing this many multicodes for a single<br />

application. Instead, allowing such a large number of multicodes to be implemented<br />

would provide another technique for developing multicodes for many applications<br />

without requiring multiple execution engines.

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

Saved successfully!

Ooh no, something went wrong!