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.

35<br />

is replaced with a new opcode if and only if the sequence is a complete basic block.<br />

This restricts the number of replacements that can be conducted because bytecode<br />

sequences that occur frequently within many basic blocks (without forming a complete<br />

basic block themselves) are completely disregarded. The performance results<br />

generated for multicodes are also more extensive, considering the determination of 50<br />

multicodes for each of 6 benchmarks.<br />

3.1.3 Selective Inlining<br />

Selective inlining [90] is a runtime optimization which improves the performance of<br />

Java interpreters that make use of direct threading [19] by reducing the number of<br />

bytecode dispatches performed. Direct threading is key to selective inlining because<br />

interpreters that use this bytecode dispatch technique are able to increase the number<br />

of codelets that the interpreter can elect to execute to an arbitrarily large number.<br />

Other interpretation techniques bound the number of codelets at 256 because opcodes<br />

are represented using a single byte.<br />

In many ways, selective inlining can be viewed as a form of just in time compilation<br />

performed on a basic block level instead a method level. As the application<br />

executes, profiling is used in order to determine which basic blocks are executed with<br />

greatest frequency. Once a candidate basic block is identified, a new codelet is added<br />

to the interpreter. This codelet is formed by performing a simple merger of the implementations<br />

of the bytecodes that make up the basic block. The threaded code<br />

is then updated to make use of the new codelet. This update is performed in place<br />

because it is known that the selectively inlined threaded code stream will be shorter<br />

than the original threaded code.<br />

There are many distinctions between selective inlining and multicode substitution.<br />

Multicode substitution is performed ahead of time using arbitrary bytecode<br />

sequences while selective inlining is performed at runtime using only those sequences<br />

that represent a complete basic block. Selective inlining is also dependent on the use<br />

of direct threading because many basic blocks may be inlined. Multicode substitution<br />

does not rely on a specific bytecode dispatch technique because it only converts those<br />

sequences of bytecodes that have been shown to execute with great frequency into<br />

multicodes.

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

Saved successfully!

Ooh no, something went wrong!