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.

139<br />

cache performance. As a result, several different multicode identification techniques<br />

are considered.<br />

Each technique is responsible for assigning a score to each candidate sequence.<br />

The score is an integer value that specifies the candidate sequences’ relative value<br />

as a multicode. It may be derived through the use of a formula or may be assigned<br />

through less definite means such as intuition. Higher scores are assigned to sequences<br />

that are expected to be good selections for replacement with a multicode while lower<br />

scores are assigned to sequences that are expected to be poor selections. Using scores<br />

in this manner provides a mechanism for estimating the value of ε x1 x 2 x 3 ...x n→ during<br />

the multicode identification process. Several scoring systems are discussed in the<br />

following sections.<br />

7.3.1 Intuition<br />

Intuition can be used to identify some short sequences that are expected to execute<br />

with great frequency. An example of such a sequence is aload 0 getfield. It is<br />

expected to execute with great frequency because it represents the process of reading<br />

the value of a field within a receiver object. Consequently, a high score will normally<br />

be assigned to this sequence while another sequence, intuitively expected to be less<br />

useful, will be assigned a low score. Unfortunately this technique may not provide<br />

good results because programs do not always behave the way one might intuitively<br />

expect and because it is difficult to predict sequences of more than a few bytecodes.<br />

This technique has been used by some of the related optimization techniques discussed<br />

in Section 3.1, such as bytecode idioms.<br />

7.3.2 Static Profiling<br />

Techniques were developed that attempted to overcome the problems associated with<br />

intuitive approaches. A static examination of the classes that make up the benchmarks<br />

and the Java library was considered initially. The goal of this examination was<br />

to identify which sequences of bytecodes occurred within those class files with greatest<br />

frequency. Then the frequency information could be used in conjunction with other<br />

information, such as the length of the sequence, in order to determine a score for each<br />

candidate sequence.<br />

A static analysis would have begun by extracting the code attribute for each<br />

method in each class. Each code attribute would have been analyzed in order to

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

Saved successfully!

Ooh no, something went wrong!