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.

218<br />

specific class file will be dictated by a new attribute that will reside within each class<br />

file. At class load time, the value in this attribute will be used to associate each class<br />

with its execution engine through a function pointer. As the application executes,<br />

method invocations will be performed by identifying the class of the method being<br />

invoked and dereferencing the function pointer rather than making use of a standard<br />

function call. Implementing method invocations in this manner imposes only a small<br />

amount of runtime overhead while allowing multiple sets of multicodes to be employed.<br />

Under this system, it will be possible to execute any class file that does not contain<br />

multicodes using any execution engine since all of the original bytecodes are still<br />

available.<br />

The impact that this strategy will have on instruction cache performance is yet<br />

to be determined. Interpreters suffer from a general problem where the bytecodes<br />

that implement the user’s application reside in the data cache. Only the machine<br />

instructions that implement the virtual machine reside in the instruction cache. As<br />

a result, the demands placed on the instruction cache are relatively small, suggesting<br />

that two or more execution engines may be able to reside within the instruction<br />

cache simultaneously when large instruction caches are available. If the total size of<br />

the execution engines employed by an application is larger than the instruction cache<br />

it is expected that the loss in cache performance will likely exceed the performance<br />

gains that can be achieved with multicodes.<br />

Dynamic Multicode Sets<br />

While the strategy discussed in the previous section provides a technique to use<br />

multiple sets of multicodes, it does not provide any capability for defining these sets<br />

without recompiling the virtual machine. Ideally, a class file should be able to contain<br />

a description of the multicodes that it requires for optimal performance. Upon reading<br />

the list, the virtual machine should provide functionality for these multicodes.<br />

These goals can be accomplished. When the application is compiled, the multicodes<br />

that should be supported for optimal performance will be described in a new<br />

attribute. This attribute will specify the functionality of each multicode in terms of<br />

existing bytecodes. By specifying the functionality in this manner, verifiability of the<br />

class file can be retained.<br />

When the class file is loaded, the virtual machine must update its execution engine<br />

in order to support the multicodes specified by the class file. This kind of dynamic<br />

code modification can be accomplished through the use of a package such as Dyninst<br />

[27]. It is unclear what the best way would be to construct this execution engine. If

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

Saved successfully!

Ooh no, something went wrong!