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.

219<br />

a strategy other than direct threading is used, then the number of multicodes that<br />

can be implemented is quite restricted, requiring the virtual machine to either ignore<br />

some multicode requests or build multiple execution engines in order to support the<br />

multicodes requested by each class file. Ideally, when the class files are modified in<br />

order to make use of multicodes, effort should be expended in order to only define<br />

multicodes that actually result in a meaningful change in performance. However, in<br />

general, one cannot assume that all of the class files were generated with the same<br />

compiler or modified to make use of multicodes at the same time, requiring the virtual<br />

machine to handle competing requests for multicodes in a reasonable manner.<br />

10.2.4 Multicodes and Operands<br />

When profiling was conducted as part of the multicode identification process, every<br />

opcode executed was recorded. No information about the operands supplied to those<br />

opcodes was retained. Expanding the profiling to include the operands utilized may<br />

lead to further insights into the behaviour of the application and multicodes that offer<br />

even greater optimization opportunities.<br />

Consider the following bytecode sequence: iload → iconst 3 → imul → istore.<br />

When this sequence is converted to a multicode it will require two operand bytes. The<br />

first will specify the local variable accessed by the iload bytecode while the second<br />

will specify the local variable accessed by the istore bytecode. Profiling the operands<br />

in addition to the opcodes may reveal that there are many cases where each of these<br />

operands are the same, indicating that the same memory location is both read and<br />

written. This will reduce the number of operand bytes that must be provided to the<br />

multicode and may also offer additional optimization opportunities in the codelet for<br />

the multicode that could not be exploited when it was not known that each bytecode<br />

referred to the same local variable.<br />

10.2.5 Expanding the Number of Multicodes<br />

Presently, the number of multicode substitutions that can be performed is restricted<br />

by the number of bytecodes that are left undefined by the Java Virtual Machine Specification,<br />

at 52. However, when considering many applications that will be executed<br />

by a single virtual machine, it may be desirable to support more multicodes without<br />

moving to multiple execution engines. This goal can be accomplished in one of several<br />

manners.

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

Saved successfully!

Ooh no, something went wrong!