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.

264<br />

B.3 Virtual Machine Invocation Script<br />

The Kaffe virtual machine is normally invoked using a shell script which executes<br />

the virtual machine binary after performing some setup operations. One of these<br />

operations is to check the value of the CLASSPATH environment variable and modify it<br />

to include Kaffe’s implementation of the Java standard library. While the intentions<br />

of the script are good, allowing the virtual machine to execute when the CLASSPATH<br />

environment variable is not set correctly, performing this update cause problems in<br />

a research environment where one is testing different versions of the library. A new<br />

version of the script was created which did not modify the CLASSPATH environment<br />

variable. Using the modified script ensured that no profiling or timings were inadvertently<br />

conducted using the standard library implementation instead of the modified<br />

version.<br />

Similar scripts were also created for the Sun and IBM virtual machines. These<br />

scripts ensured that the classes loaded by the virtual machine were restricted to<br />

those modified as part of the experiment being performed. Without these scripts,<br />

unmodified classes could be used inadvertently when the CLASSPATH environment<br />

variable was not set correctly or some command line arguments were not specified<br />

correctly.<br />

B.4 Virtual Machine Generation<br />

A separate tool was developed to create a new, multicode enabled version of the<br />

Kaffe virtual machine. It was not used during the despecialization studies presented<br />

in Chapters 4 and 5. This tool was developed using Perl because of the amount of text<br />

processing involved in generating the source code for the new virtual machine. Like<br />

the class file mutator, this tool reads a rule file which describes the despecializations<br />

and / or multicode substitutions to be performed.<br />

A small number of modifications were made to the Kaffe virtual machine by<br />

hand. These changes involved modifying the source files that required modifications<br />

in order to support multicodes so that those portions of the file that would change<br />

were abstracted into separate files. The separate files were inserted at the correct<br />

locations using the #include macro. Making this change has no impact on the<br />

performance of the virtual machine because the macro processor performs a simple<br />

textual substitution as one of the first steps in the compilation process. However, the<br />

change eased the task of developing the virtual machine generation tool, requiring it

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

Saved successfully!

Ooh no, something went wrong!