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.

217<br />

approximately 30 percent of the size of a typical class file is used to represent methods<br />

[14]. However, this includes the bytecodes themselves as well as additional attributes<br />

such as the line number table and local variable table. Since the size of a multicode<br />

attribute is at most the same size as the original code attribute, it is known that<br />

performing this modification will increase class file size by 30 percent at most. In<br />

practice, the increase can be smaller because it is not necessary to duplicate the local<br />

variable table. The line number table can also be omitted for the multicode attribute<br />

if debugging is performed on the original unoptimized bytecode stream instead of the<br />

multicode stream.<br />

The impact on class file size can also be reduced by providing only a single code<br />

attribute for those methods that do not make use of any multicodes. This will require<br />

a small amount of additional work to be performed at class load time. In particular, it<br />

will be necessary for the multicode enabled virtual machine to check for the presence<br />

of a multicode attribute. In the event that the multicode attribute is not present,<br />

it will need to treat the code attribute as if it were the multicode attribute. Since<br />

each class is only normally loaded once during the execution of the application, the<br />

overhead imposed by performing this check should be negligible.<br />

10.2.3 Dynamic Virtual Machine Modification<br />

The multicode substitution process requires the Java Virtual Machine to be modified<br />

in order to support the newly defined multicodes. In the present implementation,<br />

these modifications are performed ahead of time, resulting in a virtual machine that<br />

is only capable of handling one set of multicodes. The virtual machine must be<br />

recompiled in order to change the set of multicodes that are supported. Ideally, the<br />

virtual machine should be capable of handling many sets of multicodes. There are<br />

several options for how this goal could be accomplished.<br />

Standard Multicode Sets<br />

One option would be to develop several standard sets of multicodes. Each set would<br />

attempt to address a specific type of class. For example, one set would contain<br />

multicodes that primarily conduct integer operations while a second set would include<br />

multicodes that handle common array-oriented bytecode patterns. Further sets would<br />

address other data types and program styles.<br />

Multiple execution engines will exist within the virtual machine in order to support<br />

the standard sets of multicodes. The execution engine that will be employed for any

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

Saved successfully!

Ooh no, something went wrong!