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.

261<br />

there are no pointers to these bytecode objects in other data structures. Therefore,<br />

deallocating the objects will not cause any potential problems with the consistency<br />

of those data structures. The first bytecode in the sequence is not deallocated. Its<br />

opcode is changed to the target opcode specified in the substitution rule. Its operands<br />

are determined from the sequence of bytecodes that it replaces. Because the bytecode<br />

object was never deallocated, any pointers in any other data structures that pointed<br />

to the first bytecode in the sequence now point to the multicode, allowing the correct<br />

byte stream to be recreated at the end of the transformation process.<br />

In total, the bsub application consisted of 10 classes. The implementation of<br />

those classes and the application that made use of them required almost 10,000 lines<br />

of code.<br />

B.2 Data Collection Software<br />

Two different versions of the Kaffe virtual machine were created in order to gather the<br />

profile data used during the studies presented in this thesis. One version of the virtual<br />

machine was used to collect the data used in the despecialization studies presented in<br />

Chapter 5 and Chapter 6. This version recorded single bytecodes, including both the<br />

opcode and any operands present. The second modified version of the Kaffe virtual<br />

machine recorded the multicode blocks executed by the application. This version of<br />

the virtual machine only recorded opcodes, discarding all operand values.<br />

B.2.1<br />

Operand Profiling Virtual Machine<br />

This version of the Kaffe virtual machine was modified to record each bytecode executed.<br />

The bytecodes were considered as discrete items. No information was recorded<br />

regarding the context in which the bytecode was executed. Modifications were made<br />

to the interpreter’s main execution engine. They consisted of inserting new function<br />

calls to record the desired information. The implementations of those functions were<br />

provided in a separate C++ source file.<br />

The information recorded by the modified virtual machine included both the opcode<br />

and its associated operands. Additional information from the constant pool was<br />

also recorded for some bytecodes. Recording this information was important because<br />

values can reside at different locations within the constant pool in different class<br />

files. Consequently, the operands specifying an offset into the constant pool are not<br />

sufficient in order to determine if similar values are being used in many files.

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

Saved successfully!

Ooh no, something went wrong!