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.

48<br />

...<br />

i − 1<br />

iload 0x03 iload 0x04 iadd istore 2<br />

i i + 1 i + 2 i + 3 i + 4 i + 5<br />

(a) Before Store Despecialization<br />

...<br />

i + 6<br />

...<br />

i − 1<br />

iload 0x03 iload 0x04 iadd istore 0x02<br />

i i + 1 i + 2 i + 3 i + 4 i + 5 i + 6<br />

(b) After Store Despecialization<br />

...<br />

i + 7<br />

Figure 4.2: An Example of Store Despecialization<br />

Specialized<br />

Bytecode<br />

astore <br />

dstore <br />

fstore <br />

istore <br />

lstore <br />

General Purpose<br />

Bytecode<br />

astore<br />

dstore<br />

fstore<br />

istore<br />

lstore<br />

Table 4.2: Specialized Store Bytecodes and their General Purpose Forms<br />

4.1.2 Store Despecializations<br />

The Java Virtual Machine Specification also makes use of data type specific store<br />

bytecodes for writing to local variables. As is the case for load bytecodes, there is<br />

one general purpose store bytecode specified to handle each primitive type. There are<br />

also four specialized bytecodes defined for each data type. These store a value into<br />

one of the first four local variable slots. Despecializing store bytecodes is performed<br />

by replacing the specialized bytecode with the data type appropriate general purpose<br />

bytecode including the appropriate operand byte.<br />

Figure 4.2 continues the example started in Figure 4.1. The upper portion of<br />

the figure shows the bytecodes used to represent a statement of the form a = b +<br />

c after load despecialization but before store despecialization. The lower portion of<br />

the figure shows the block of code once both the load and store bytecodes have been<br />

despecialized.<br />

Table 4.2 shows each of the specialized bytecodes and its corresponding general

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

Saved successfully!

Ooh no, something went wrong!