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.

70<br />

constant pool due to a previous despecialization of bipush and the value resides at<br />

an index less than 256. When these constraints are met, replacing bipush with ldc<br />

does not increase the size of the code stream because both bipush and ldc require<br />

exactly two bytes: one for the opcode and one for the operand.<br />

A similar situation can also occur for sipush. In this instance, it is actually<br />

possible that performing despecialization will decrease the size of the class file. A one<br />

byte decrease will occur when the value being loaded already exists in the constant<br />

pool at an index less than 256. This occurs because despecializing sipush to ldc<br />

reduces the number of operand bytes that are required in the code stream from 2<br />

bytes to 1 byte. In other instances, despecializing sipush will have no impact on<br />

class file size. This occurs when the value resides in the constant pool at an index<br />

greater than 255. Consequently, sipush must be despecialized to ldc w which also<br />

requires two operand bytes.<br />

In rare cases, despecialization will not increase class file size when bytecodes other<br />

than bipush and sipush are despecialized. This can occur when the despecializations<br />

are only performed on bytecodes that occur ahead of a lookupswitch or tableswitch<br />

bytecode that includes one or more pad bytes. When the despecialization is performed,<br />

the number of pad bytes is reduced in order to ensure that the alignment<br />

rules for the lookupswitch or tableswitch are still maintained, resulting in no<br />

change in class file size. However, in other cases, performing despecialization can<br />

require the introduction of pad bytes that were not required previously, potentially<br />

increasing the size of the class file by 3 bytes beyond the number of additional bytes<br />

introduced at the location within the code stream that is being despecialized.<br />

The impact despecialization had on class file size was measured. Complete despecialization<br />

was performed on all of the classes in the libraries provided by each of the<br />

virtual machines. Complete despecialization was also performed on all of the class<br />

files in the SPEC JVM98 Benchmark Suite except one. The file install.class was<br />

omitted from consideration because it includes a large non-standard attribute that<br />

can be used to install the benchmark suite. Including this file would have resulted in<br />

smaller class file size increase values.<br />

A summary of the class file size increase values is presented in Table 4.10. It shows<br />

the change in class file size observed for the classes that make up the SPEC JVM98<br />

Benchmarks and the class files that make up the class libraries associated with each<br />

of the virtual machines. The first three columns of data report the average class<br />

file size observed before and after despecialization was performed, and the percentage<br />

change this difference represents. The final three columns of data examine the impact

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

Saved successfully!

Ooh no, something went wrong!