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.

39<br />

3.2.5 Bytecode Optimization<br />

Tools have been developed which improve the performance of Java applications by<br />

performing ahead of time optimization on the Java bytecode stream. Soot is a tool<br />

that performs traditional optimizations such as constant folding, copy propagation<br />

and dead code elimination [115, 114] on Java class files. It works by translating the<br />

bytecode stream from Java bytecodes into three different intermediate representations.<br />

Most of the optimizations are conducted on a representation known as Jimple<br />

which is a form of three address code. Using this strategy allows traditional optimization<br />

algorithms to be employed. Unfortunately the conversion process from<br />

Jimple back to Java bytecodes is imperfect, reducing the impact of the optimizations<br />

performed.<br />

Cream is another Java class file optimizer that performs traditional optimizations<br />

such as dead code elimination and loop invariant code removal [36]. In addition,<br />

Cream uses side-effect analysis in order to optimize field accesses and method invocations.<br />

Performance improvements of as much as 25 percent are reported. However,<br />

other applications incurred a performance loss due to the “optimizations” performed.<br />

Unlike the other tools presented in this section, JAX is primarily concerned with<br />

manipulating Java class files in order to reduce their size rather than improving their<br />

runtime performance [110]. The transformations performed include renaming classes,<br />

methods and fields, removing redundant methods and fields, transforming the class<br />

hierarchy and devirtualizing and inlining method calls. Reductions in class file size<br />

of between 14 percent and 90 percent were observed. The average performance gain<br />

achieved was 4.7 percent.<br />

3.2.6 Native Methods<br />

The Java Native Interface (JNI) provides a mechanism for calling code developed in<br />

programming languages other than Java from within a Java application [72]. Performing<br />

this task can serve several purposes including accessing features of the underlying<br />

platform that are not readily accessible through the virtual machine, developing portions<br />

of the application in a language that is more appropriate for the problem being<br />

solved and optimizing performance critical methods by developing them in a language<br />

that offers better performance. Unfortunately these benefits come at the expense of<br />

portability. At a minimum, any code that is called by the Java Native Interface<br />

normally has to be recompiled on any new target architecture.

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

Saved successfully!

Ooh no, something went wrong!