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.

141<br />

Block 1:<br />

Block 2:<br />

aload 0 → getfield → aload 0 → getfield →<br />

getfield → aload 0 → getstatic → aload 0 → getfield →<br />

Figure 7.2: Example Candidate Sequences<br />

new multicode block. When such a bytecode was encountered, a newline character<br />

was added to the block list in order to denote the start of a new multicode block.<br />

During the initial phases of this study, multicodes of lengths between two and<br />

seven bytecodes were considered. This analysis consisted of finding all subsequences<br />

of each multicode block and recording how many times each sequence was encountered<br />

in the profile data for the application. Once the counts were determined a scoring<br />

operation was performed. It assigned a score to each multicode, computed as the<br />

product of the number of times it occurred and the length of the sequence.<br />

a result, the score was the total number of bytecodes that would be impacted by<br />

performing the substitution.<br />

those sequences which had the highest score.<br />

The best candidates for multicode substitution were<br />

Figure 7.2 shows a small example consisting of two multicode blocks. It will be<br />

used to illustrate how candidate sequences are identified and how to determine which<br />

candidate sequences will give the most performance benefit.<br />

In a multicode block of length n, each contiguous subsequence of bytecodes is one<br />

occurrence of a particular candidate sequence. There are n − 1 length 2 candidate<br />

sequences, n−2 length 3 candidate sequences, etc., up to one candidate sequence with<br />

Sequence Count Score<br />

aload 0 getfield 3 6<br />

getfield aload 0 getstatic aload 0 getfield 1 5<br />

getfield aload 0 2 4<br />

aload 0 getfield aload 0 getfield 1 4<br />

getfield aload 0 getstatic aload 0 1 4<br />

aload 0 getstatic aload 0 getfield 1 4<br />

aload 0 getfield aload 0 1 3<br />

getfield aload 0 getfield 1 3<br />

getfield aload 0 getstatic 1 3<br />

aload 0 getstatic aload 0 1 3<br />

getstatic aload 0 getfield 1 3<br />

aload 0 getstatic 1 2<br />

getstatic aload 0 1 2<br />

As<br />

Table 7.1: Bytecode Sequences Example

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

Saved successfully!

Ooh no, something went wrong!