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.

187<br />

performed impacts the sequences of bytecodes that remain for all future selections.<br />

Consider a very small example consisting of the two sequences shown below:<br />

aload 0 → getfield → aload 0 → getfield → iconst 3 → imul →<br />

fload → fconst 1 → fstore → aload 0 → getfield → aload 0 → getfield →<br />

When multicode identification is performed using transfer reduction scoring the<br />

best bytecode sequence identified will be aload 0 → getfield → aload 0 → getfield<br />

→ with a score of 6. Performing the identification process again will select<br />

the bytecode sequence fload → fconst 1 → fstore → with a score of 2, giving a<br />

cumulative score of 8 for the first two multicodes identified. However, a better choice<br />

could have been made. If fload → fconst 1 → fstore → aload 0 → getfield<br />

→ aload 0 → getfield → was identified as the first multicode (with score 6) and<br />

the second multicode identified was aload 0 → getfield → aload 0 → getfield<br />

→ iconst 3 → imul → (with score 5) then the cumulative score achieved for two<br />

multicode substitutions would have been 11 rather than 8.<br />

The results seen for 202 jess in Figure 8.1 occur for the same reason that a<br />

less than optimal result was achieved for the example presented in the previous paragraph.<br />

While performing despecialization provides better initial results, they happen<br />

to destroy bytecode sequences that could have been identified as multicodes subsequently.<br />

However, the presence of the specialized bytecodes prevents those sequences<br />

from being destroyed in the original code because the bytecode sequences are distinct.<br />

Solving this problem is non-trivial. Attempting to identify a globally optimal<br />

result by examining all possible combinations would require far too many candidate<br />

sequences to be considered. It may be possible to solve this problem efficiently by<br />

making extensions to the Most Contributory Substring Problem described in Chapter<br />

9. However, more research needs to be conducted in order to determine if that is the<br />

case.<br />

8.3 Performance Results<br />

Performance testing was utilized in order to determine what improvement in application<br />

performance would be achieved by performing both despecialization and<br />

multicode substitution for the same application. Multicodes were selected in the<br />

presence of despecialization using both the transfer reduction and total bytecodes replaced<br />

scoring techniques. The testing was conducted using the six benchmarks from

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

Saved successfully!

Ooh no, something went wrong!