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.

144<br />

• The second application converts the execution trace (a stream of bytecodes and<br />

method invocations) into a collection of multicode blocks.<br />

• The third application was responsible for processing the list of multicode blocks<br />

in order to generate a list of bytecode sequences to be represented by multicodes.<br />

This was accomplished by first counting the number of times each sequence of<br />

bytecodes occurred within the block list. The score for each sequence was then<br />

computed and the best sequence was identified.<br />

The entire identification process is shown graphically in Figure 7.3. Unfortunately<br />

this identification algorithm presents some practical difficulties. Even when executed<br />

at their smallest input sizes, some benchmarks generated execution traces that were<br />

gigabytes in size. While modern disks can easily accommodate these files, the amount<br />

of time required to both generate and process them was cumbersome. This was also<br />

true of the files used to hold the block lists. While they were approximately 30 percent<br />

of the size of the execution traces, they still represented a large amount of data that<br />

had to be processed for each multicode that was identified. As a result, the multicode<br />

identification process was revised to reduce both the amount of space required to<br />

record the profile data and shorten the time required for multicode identification.<br />

These revisions are discussed in the next section.<br />

7.3.4 Reducing the Cost of Dynamic Profiling<br />

The original multicode identification algorithm, presented in the previous section,<br />

required excessive disk space because even simple applications can execute millions<br />

of bytecodes. To address this problem, additional modifications were made to the<br />

Kaffe virtual machine. Some of this additional work reflects tasks that were previously<br />

performed in later stages of the analysis while other additions were made based<br />

on insights gained during the implementation of the iterative algorithm described<br />

previously.<br />

The first addition involved adding a data structure to the Kaffe virtual machine<br />

that maintained the branch and exception structure of each method encountered. By<br />

storing this information in memory, a second, more significant addition was made<br />

possible. In particular, the Kaffe virtual machine became capable of identifying multicode<br />

blocks itself, without having to write millions of bytecodes to disk so that they<br />

could be broken into multicode blocks by another application.<br />

The process of identifying multicode blocks is relatively straightforward. As the<br />

virtual machine executes each new bytecode, it checks to see whether the bytecode

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

Saved successfully!

Ooh no, something went wrong!