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.

263<br />

information for each method so that it was not necessary to parse the method every<br />

time it was invoked. A class was introduced to represent the fully qualified class name<br />

as three pointers – one to the string representing the class name, one to the string<br />

representing the method name and one to the string representing the signature. This<br />

reduced the amount of space required to represent each fully qualified method name<br />

to 12 bytes since the pointers pointed to copies of the names maintained within other<br />

Kaffe data structures. Using this technique also meant that comparison between<br />

method names could be performed using pointer comparisons instead of expensive<br />

string operations.<br />

Before each bytecode was executed, a check was performed in order to determine<br />

if that bytecode represented the start of a new multicode block. This was determined<br />

by searching for its program counter value in the branch targets map entry for the<br />

current method. If it was determined that the bytecode started a new multicode block<br />

then the count associate with the current bytecode sequence was incremented and the<br />

vector representing the sequence was cleared. Once the checks associated with the<br />

start of a new block were performed, the bytecode that was about to execute was<br />

appended to the vector representing the current multicode block.<br />

An exit handler was used in order to ensure that the information recorded during<br />

profiling was saved before the application completed. In addition, the exit handler<br />

was responsible for incrementing the count associated with the last multicode block<br />

executed. The output generated was referred to as a compressed multicode block file.<br />

Its format was text based, with each line beginning with a count of the number of<br />

times the block was executed. This was followed by a space separated list of bytecode<br />

names representing the bytecode sequence.<br />

Once the data was collected it was evaluated using an application that implemented<br />

the multicode identification algorithm presented in Chapter 7. This tool<br />

implemented both the total bytecodes replaced and transfer reduction scoring systems.<br />

In addition, it also implemented the timing based scoring system described<br />

in Section 7.8. The scoring system, number of multicodes to identify and maximum<br />

multicode length to consider are all provided to the application as command line parameters.<br />

The output of the application is a rule file in the format required by the<br />

class file mutator.

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

Saved successfully!

Ooh no, something went wrong!