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.

143<br />

Sequence Count Score<br />

getfield aload 0 getstatic mc 1 4<br />

getfield aload 0 getstatic 1 3<br />

aload 0 getstatic mc 1 3<br />

mc mc 1 2<br />

getfield aload 0 1 2<br />

aload 0 getstatic 1 2<br />

getstatic mc 1 2<br />

Table 7.2: Bytecode Sequences Example after One Multicode Substitution<br />

multicode, after which a new collection of multicode blocks is obtained by replacing<br />

all occurrences of the candidate sequence with a newly assigned bytecode. The process<br />

of obtaining candidate sequences and scores is then repeated, and the candidate<br />

sequence with the best score is chosen as the second multicode. This process repeats<br />

until the desired number of multicodes is obtained.<br />

Table 7.2 shows the candidate sequences, occurrence counts, and scores obtained<br />

after the first multicode has been identified and substituted in the current example.<br />

Note that the number of candidate sequences is smaller than what exists in Table<br />

7.1, and that the number of occurrences for some of the candidate sequences that are<br />

common to the two tables has changed.<br />

This second table indicates that the candidate sequence with the greatest optimization<br />

potential (contingent on the accuracy of the scoring algorithm) is getfield<br />

→ aload 0 → getstatic → mc. Note that this sequence contains mc, representing<br />

the multicode identified previously. From a multicode identification point of view,<br />

this causes no real problems. However, special care must be taken during the implementation<br />

of such nested multicodes to ensure that the codelet representing the<br />

new multicode is generated correctly. As an alternative, the multicode identification<br />

algorithm could ignore any candidate sequences containing previously identified<br />

multicodes.<br />

The iterative multicode identification algorithm was implemented as a set of three<br />

distinct applications:<br />

• The Kaffe virtual machine was modified and used to generated an execution<br />

trace for the application being executed. Note that any virtual machine could<br />

have been used since the sequence of bytecodes executed is independent of the<br />

virtual machine (assuming that the application and library class files utilized<br />

are identical).

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

Saved successfully!

Ooh no, something went wrong!