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.

71<br />

Category Original Desp. Percent Original Desp. Percent<br />

Average Average Increase Maximum Maximum Increase<br />

SPEC Classes 2582 2745 6.3 35697 38381 7.5<br />

Kaffe Library 1825 1929 5.7 26172 27743 6.0<br />

RVM Library 2644 2785 5.3 283144 311148 9.9<br />

Sun Library 2700 2870 6.3 122426 124213 1.5<br />

Table 4.10: Despecialization’s Impact on Class File Size<br />

despecialization had on the largest class file within each group. It shows that the<br />

largest files were not necessarily the ones that showed the greatest increase in size<br />

due to despecialization.<br />

4.4 Class File Correctness<br />

The despecialization rules outlined previously do not impact the computational power<br />

of the Java Virtual Machine. Furthermore, the rules make no semantic changes to the<br />

Java class files, with each despecialized form providing identical semantics compared<br />

to its corresponding specialized bytecode. However, despecializations do generally<br />

increase class file size. Consequently, size constraints imposed by the Java Virtual<br />

Machine Specification may be violated during the despecialization process, making it<br />

difficult to apply some despecialization rules.<br />

One size constraint dictated by the Java Virtual Machine Specification is the<br />

maximum size of a method’s code attribute. This constraint requires that no method<br />

exceed 65535 bytes in size. Consequently, it is possible that performing despecialization<br />

may take a very large method and make it even larger, resulting in a method in<br />

excess of the maximum size permitted. With some effort, such a method could automatically<br />

be split into two or more methods, resulting in two or more methods that<br />

are all within the required size. In practice such a problem was never encountered<br />

anywhere in any of the virtual machine’s libraries or within the class files that make<br />

up the SPEC JVM98 Benchmark Suite. Before despecialization was performed the<br />

longest method was 21104 bytes. This grew to 29697 bytes after complete despecialization<br />

was performed, still less than half of the maximum size permitted.<br />

Some of the despecializations considered previously have the potential to increase<br />

the number of elements in the constant pool. These include despecializing the bipush,<br />

sipush and const bytecodes. The Java Virtual machine specification restricts<br />

the number of elements in the constant pool to 65535. Consequently, it is

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

Saved successfully!

Ooh no, something went wrong!