Abstract
This paper presents Soot, a framework for optimizing Java™ bytecode. The framework is implemented in Java and supports three intermediate representations for representing Java bytecode: Baf, a streamlined representation of Java’s stack-based bytecode; Jimple, a typed three-address intermediate representation suitable for optimization; and Grimp, an aggregated version of Jimple.
Our approach to class file optimization is to first convert the stack-based bytecode into Jimple, a three-address form more amenable to traditional program optimization, and then convert the optimized Jimple back to bytecode.
In order to demonstrate that our approach is feasible, we present experimental results showing the effects of processing class files through our framework. In particular, we study the techniques necessary to effectively translate Jimple back to bytecode, without losing performance. Finally, we demonstrate that class file optimization can be quite effective by showing the results of some basic optimizations using our framework. Our experiments were done on ten benchmarks, including seven SPECjvm98 benchmarks, and were executed on five different Java virtual machine implementations.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Ali-Reza Adl-Tabatabai, Michal Cierniak, Guei-Yuan Lueh, Vishesh M. Parikh, and James M. Stichnoth. Fast and effective code generation in a just-in-time Java compiler. ACM SIGPLAN Notices, 33(5):280–290, May 1998. 18
Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers Principles, Techniques and Tools. Addison-Wesley, 1986. 26, 30
Lars R. Clausen. A Java bytecode optimizer using side-effect analysis. Concurrency: Practice & Experience, 9(11):1031–1045, November 1997. 30
Geoff A. Cohen, Jeffrey S. Chase, and David L. Kaminsky. Automatic program transformation with JOIE. In Proceedings of the USENIX 1998 Annual Technical Conference, pages 167–178, Berkeley, USA, June 15–19 1998. USENIX Association. 31
Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark K. Wegman, and F. Kenneth Zadeck. An efficient method of computing static single assignment form. In 16th Annual ACM Symposium on Principles of Programming Languages, pages 25–35, 1989. 22
DashOPro. http://www.preemptive.com/products.html. 32
Jeffrey Dean, Greg DeFouw, David Grove, Vassily Litvinov, and Craig Chambers. VORTEX: An optimizing compiler for object-oriented languages. In Proceedings OOPSLA’ 96 Conference on Object-Oriented Programming Systems, Languages, and Applications, volume 31 of ACM SIGPLAN Notices, pages 83–100. ACM, October 1996. 32
Jeffrey Dean, David Grove, and Craig Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In Walter G. Olthoff, editor, ECOOP’95-Object-Oriented Programming, 9th European Conference, volume 952 of Lecture Notes in Computer Science, pages 77–101, Åarhus, Denmark, 7–11 August 1995. Springer. 30
Étienne Gagnon and Laurie Hendren. Intra-procedural Inference of Static Types for Java Bytecode. Sable Technical Report 1999-1, Sable Research Group, McGill University, March 1999. 22
Robert Fitzgerald, Todd B. Knoblock, Erik Ruf, Bjarne Steensgaard, and David Tarditi. Marmot: an Optimizing Compiler for Java. Microsoft technical report, Microsoft Research, October 1998. 32
Jasmin: A Java Assembler Interface. http://www.cat.nyu.edu/meyer/jasmin/. 22
JavaClass. http://www.inf.fu-berlin.de/dahm/JavaClass/. 31
Compaq JTrek. http://www.digital.com/java/download/jtrek. 31
Han Bok Lee and Benjamin G. Zorn. A Tool for Instrumenting Java Bytecodes. In The USENIX Symposium on Internet Technologies and Systems, pages 73–82, 1997. 31
Martin Maierhofer and M. Anton Ertl. Local stack allocation. In Kai Koskimies, editor, Compiler Construction (CC’98), pages 189–203, Lisbon, 1998. Springer LNCS 1383. 32
Steven S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann, 1997. 21
Gilles Muller, Bárbara Moura, Fabrice Bellard, and Charles Consel. Harissa: A flexible and efficient Java environment mixing bytecode and compiled code. In Proceedings of the 3rd Conference on Object-Oriented Technologies and Systems, pages 1–20, Berkeley, June 16–20 1997. Usenix Association. 18, 21, 22, 32
Todd A. Proebsting, Gregg Townsend, Patrick Bridges, John H. Hartman, Tim Newsham, and Scott A. Watterson. Toba: Java for applications: A way ahead of time (WAT) compiler. In Proceedings of the 3rd Conference on Object-Oriented Technologies and Systems, pages 41–54, Berkeley, June 16–20 1997. Usenix Association. 18, 21, 22, 32
Tatiana Shpeisman and Mustafa Tikir. Generating Efficient Stack Code for Java. Technical report, University of Maryland, 1999. 32
Soot-a Java Optimization Framework. http://www.sable.mcgill.ca/soot/. 19
4thpass SourceGuard. http://www.4thpass.com/sourceguard/. 32
SuperCede, Inc. SuperCede for Java. http://www.supercede.com/. 32
Frank Tip, Chris Laffra, Peter F. Sweeney, and David Streeter. Practical Experience with an Application Extractor for Java. IBM Research Report RC 21451, IBM Research, 1999. 30, 32
Tower Technology. Tower J. http://www.twr.com/. 32
Raja Vallée-Rai and Laurie J. Hendren. Jimple: Simplifying Java Bytecode for Analyses and Transformations. Sable Technical Report 1998-4, Sable Research Group, McGill University, July 1998. 20
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Vallée-Rai, R., Gagnon, E., Hendren, L., Lam, P., Pominville, P., Sundaresan, V. (2000). Optimizing Java Bytecode Using the Soot Framework: Is It Feasible?. In: Watt, D.A. (eds) Compiler Construction. CC 2000. Lecture Notes in Computer Science, vol 1781. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46423-9_2
Download citation
DOI: https://doi.org/10.1007/3-540-46423-9_2
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67263-0
Online ISBN: 978-3-540-46423-5
eBook Packages: Springer Book Archive