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.

74<br />

Because despecialization increases the size of the code attribute, it was necessary to<br />

update the start pc and end pc values so as to guarantee that any of the general<br />

purpose bytecodes generated for a specialized bytecode are within the range of each<br />

exception handler if and only if the original specialized bytecode was within the range<br />

of the exception handler. Furthermore, it was also necessary to update handler pc<br />

in order to ensure that control is transferred to the correct location in the event that<br />

an exception is caught.<br />

Performing despecialization does not inhibit verification. It has already been<br />

noted previously that, in practice, despecialization does not violate any of the size<br />

constraints imposed by the Java Virtual Machine Specification. Consequently, verification<br />

is performed on the larger class files. Since the despecialized code attributes<br />

are semantically equivalent to their original specialized forms, a despecialized code<br />

attribute will pass verification if and only if the original specialized form passed verification.<br />

Similarly, a code attribute that failed verification before despecialization<br />

will still fail verification after despecialization is performed.<br />

4.5 Summary<br />

This chapter has described the difference between general purpose bytecodes and<br />

specialized bytecodes. A total of 76 specialized bytecodes were identified along with<br />

their corresponding general purpose forms. Of these, 67 were implemented and tested<br />

using three Java virtual machines. Performance results were presented for the SPEC<br />

JVM98 Benchmark Suite. These results showed that an average increase of 2.0 percent<br />

was observed across all three virtual machines when complete despecialization<br />

was performed on all of the benchmarks. An analysis was also performed on despecialization’s<br />

impact on class file size. It was found that despecialization had a<br />

similarly small impact on class file size, increasing average class file size across all of<br />

the library and application classes by between 5.3 and 6.3 percent depending on the<br />

set of classes under consideration.<br />

While there are minor performance and class file size penalties associated with<br />

performing despecialization, a large benefit is achieved: the number of Java bytecodes<br />

in use is reduced from 201 to 134. This opens up many opportunities for expanding<br />

the bytecode language. New instructions could include:<br />

• Supporting frequently occurring operations that require several bytecodes to<br />

perform. The task of incrementing a field by a small integer is a particularly<br />

good example, requiring six bytecodes to perform.

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

Saved successfully!

Ooh no, something went wrong!