Annotating Java Bytecode

This page reflects ongoing work concerning Annotating Java Bytecode done in the context of the course Optimizing Compilers given at McGill University and with the The Sable Compiler Research Group.

A s most people who have used or worked with Java will testify, serious performance issues need to be addressed. Java is part of the emergence of a whole new class of highly dynamic and object-oriented programming languages which present new challenges to the established field of Compiler Optimizations. Given the popularity of these, and Java in particular, there is now a great incentive for addressing related performance issues.

Java is compiled to classfiles that hold platform independent bytecode. Classfiles have a special feature whereas they can hold user defined attributes. Adding custom attributes to classfiles will not change their semantics as JVMs simply ignore attributes they do not understand. There is ongoing research on how to exploit this classfile facility to improve the runtime performance of Java. In particular efforts have been devoted to developing Virtual Register Allocation schemes for bytecode.

I have written a paper and a presentation describing how the Runtime performance of Java could benefit by annotating Java code by means of classfile attributes and which detail how support for this feature has been added and implemented in Soot . Soot is a Bytecode Optimization Framework being developed by the Sable Compiler Research Group. It allows a user to easily implement high-level program analyses and transformations starting from a bytecode representation. As detailed in my paper, I have added attribute generation support to Soot, enabling new Soot based analyses to easily produce bytecode annotations. Work involving identifying safe Java array accesses has already made use of Soot annotations. The analysis creates ArrayCheckAttributes that are propagated by Soot to classfiles to flag safe array accesses.

The paper is available in pdf format here

You can either browse the presentation online or download it in PowerPoint format.

A paper that builds on the information presented here will be presented at the upcoming CASCON 2000 conference next November, in Mississauga Canada.

Links

The Soot Bytecode Optimization Framework Homepage
An extendable framework for program analysis and optimization. Enables bytecode to bytecode transformations and much more.
Ana Azevedo's Homepage
Bunch of links to the Java Annotation-aware Just In Time (AJIT) Compilation System.

Papers

Annotating Java Class Files with Virtual Registers for Performance
By Joel Jones and Samuel Kamin, In Concurrency: Practice and Experience, forthcoming.
Annotating the Java Bytecodes in Support of Optimization
By Ana Azevedo, Alex Nicolau and Joe Hummel. Presented at the ACM Java Grande Conference, San Francisco, CA, June 1999.
Optimizing Java Bytecode using the Soot Framework: Is it Feasible?
By Raja Vallée-Rai, Etienne Gagnon, Laurie Hendren, Patrick Lam, Patrice Pominville, and Vijay Sundaresan. Presented at Compiler Construction 2000, Berlin, Germany, March 2000.
Soot - a Java Optimization Framework
By Raja Vallée-Rai, Laurie Hendren, Vijay Sundaresan, Patrick Lam, Etienne Gagnon and Phong Co Presented at CASCON99, Toronto, Canada, September 1999. ~~

Patrice Pominville
Last modified: Wed Apr 26 16:06:16 EDT 2000