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.

215<br />

Figure 10.1: Multicode Blocks under the Original and Proposed Future Definition<br />

• The bytecodes within the sequence are adjacent to each other within the code<br />

stream.<br />

• A bytecode within the sequence is the target of a branch if and only if it is the<br />

first bytecode in the sequence.<br />

• Each bytecode within the sequence will be executed zero or one times. If bytecode<br />

i will not be executed then bytecode i + j will not execute for j = 1..n − i.<br />

• An exception handler covers a bytecode within the sequence if and only if that<br />

exception handler covers all bytecodes within the sequence.<br />

Under the revised definition, it is possible that only some initial bytecodes within<br />

the multicode will execute. The advantage of such a definition is that it would allow<br />

conditional branch bytecodes to exist within a multicode at a point other than the<br />

last bytecode. Consequently, the bytecode sequence would have a single point of entry<br />

but many potential points of exit. This is illustrated if Figure 10.1 which shows the<br />

multicodes blocks that will be identified under the original multicode block definition<br />

and the revised multicode block definition.<br />

Care must be used when performing optimizations using the revised multicode<br />

block definition. Because there is no guarantee that every bytecode within the sequence<br />

will execute, it is necessary to ensure that the optimizer does not move any<br />

code across branch points which changes the semantics of the multicode when the<br />

branch is taken. Otherwise the multicode will provide different functionality than the<br />

original bytecode sequence, resulting in incorrect application behaviour.

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

Saved successfully!

Ooh no, something went wrong!