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.

148<br />

CMCB_Name: The name of the compressed multicode block file to<br />

process<br />

BlockCounts: A map from a bytecode sequence to a count of the number<br />

of times that it occurred, initially empty<br />

BestSeq: The sequence of bytecodes that is the best candidate<br />

for multicode substitution<br />

Call DetermineCandidateCounts(CMCB_Name, BlockCount)<br />

BestSeq = Call FindBestSeq(BlockCounts)<br />

Function DetermineCandidateCounts(InputFile, BlockCounts) Returns Nothing<br />

Read InputFile<br />

For each line in the Compressed Multicode Block File<br />

Let s represent the bytecode sequence on that line<br />

Let c be the count for s<br />

For each non-empty subsequence t, of s, such that t.length BestScore<br />

BestSeq = k<br />

BestScore = Score<br />

End If<br />

End For<br />

Return BestSeq<br />

End Function<br />

Function ComputeScore(Sequence, Count) Returns Integer<br />

Return Sequence.length * Count<br />

End Function<br />

Figure 7.4: An Algorithm for Identifying the Best Candidate Sequence in a Compressed<br />

Multicode Block File

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

Saved successfully!

Ooh no, something went wrong!