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.

228<br />

was developed which allowed such bytecode sequences to be identified automatically.<br />

Because the identification process was automated, some long sequences of bytecodes<br />

were replaced by multicodes. Such sequences could not be determined by human<br />

intuition alone. Performance results showed that designing a set of multicodes for a<br />

single application could decrease application runtime to approximately 70 percent of<br />

the original runtime in the best case.<br />

The performance gains achieved by performing multicode substitution come from<br />

at least two sources. Some of the performance gain is achieved as a result of reducing<br />

the total number of bytecode dispatches necessary in order to execute the application.<br />

Additional performance gains were achieved by performing optimizations on<br />

the codelet that implements the multicode. While some of these optimization can be<br />

performed automatically by the compiler, other optimizations rely on knowledge of<br />

the behaviour associated with internal virtual machine data structures. In particular,<br />

it is possible to reduce the number of memory writes considerably by recognizing that<br />

values which reside above the top of the stack once the multicode finishes executing<br />

will not be utilized subsequently.<br />

One of the disadvantages associated with performing multicode substitution is the<br />

fact that those bytecodes that are not currently defined by the Java Virtual Machine<br />

Specification are utilized. This means that performing multicode substitution prevents<br />

other optimizations that rely on their availability from being performed and<br />

limits the options for future expansion of the Java bytecode language. In order to<br />

overcome this disadvantage, a study was performed that examined the impact of<br />

performing both despecialization and multicode substitution at the same time.<br />

It was necessary to profile the applications again in order to perform this study<br />

due to four specialized bytecodes whose general purpose form depends on the context<br />

in which the despecialization is performed. Performing 67 despecializations before<br />

50 multicodes were identified showed an average performance loss of approximately<br />

four percent compared to performing multicode substitution alone. This difference<br />

in performance occurred for two reasons. Part of the difference can be attributed to<br />

the fact that despecialization has already been shown to have a small detrimental<br />

impact on application runtime. The remainder of the performance loss occurred because<br />

performing 67 despecializations caused poorer overall multicode selections to be<br />

made because the best initial candidate identified in the presence of despecialization<br />

broke up many other sequences. Consequently, these sequences were not available for<br />

consideration subsequently.<br />

A second study was conducted where both despecialization and multicode sub-

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

Saved successfully!

Ooh no, something went wrong!