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.

150<br />

sequence will be handled by a subsequent iteration of the outside loop since it processes<br />

the sequences from longest to shortest, and the suffix sequence is guaranteed<br />

to be shorter e. Consequently, an arbitrary number of multicodes can be determined<br />

by repeatedly using FindBestSeq from Figure 7.4 and the update algorithm from<br />

Figure 7.5, without the need to determine all subsequences of the blocks listed in the<br />

compressed multicode block file multiple times.<br />

7.3.5 A Simple Alternative Scoring Technique<br />

All of the examples discussed to this point have assumed that the score for a multicode<br />

was computed as the number of occurrences of the bytecode sequence multiplied by<br />

the length of the sequence. Consequently, the score for the multicode is the total<br />

number of bytecodes that will be directly impacted by the substitution. Using the<br />

notation expressed in the previous section, the total bytecodes substituted would be<br />

expressed as:<br />

T otalBytecodesScore = N x1 /x 2 /x 3 /.../x n→ × n (7.14)<br />

A simple alternative to this scoring technique is counting the number of transfers<br />

removed by performing the substitution. Computing the score in this manner effectively<br />

assumes that the change in performance due to transfer reductions is much<br />

larger than the change in performance due to optimization potential within the sequence<br />

and other factors such as the impact on caching. Under this system, the score<br />

for any potential multicode becomes:<br />

T ransferReductionScore = N x1 /x 2 /x 3 /.../x n→ × (n − 1) × Cost(→) (7.15)<br />

However, because the cost of a transfer is a constant cost in every score calculation,<br />

it can be assigned the value 1, simplifying the equation without impacting the relative<br />

ordering of the bytecode sequences under consideration. When this simplification is<br />

performed, the score represents the total number of transfers that will be removed<br />

as a result of performing the multicode substitution, remembering that a transfer of<br />

control must still be present after the multicode in order to reach the next bytecode<br />

or multicode in the method.<br />

T ransferReductionScore = N x1 /x 2 /x 3 /.../x n→ × (n − 1) (7.16)

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

Saved successfully!

Ooh no, something went wrong!