Abstract
Automatic program specialization can derive effcient implementations from generic components, thus reconciling the often opposing goals of genericity and efficiency. This technique has proved useful within the domains of imperative, functional, and logical languages, but so far has not been explored within the domain of object-oriented languages. We present experiments in the specialization of Java programs. We demonstrate how to construct a program specializer for Java programs from an existing specializer for C programs and a Java-to-C compiler. Specialization is managed using a declarative approach that abstracts over the optimization process and masks implementation details. Our experiments show that program specialization provides a four-time speedup of an image-filtering program. Based on these experiments, we identify optimizations of object-oriented programs that can be carried out by automatic program specialization. We argue that program specialization is useful in the field of software components, allowing a generic component to be specialized to a specific configuration.
★
Supported in part by BULL, and in part by Alcatel under the Reutel 2000 contract.
★★
Supported in part by an H.H. Powers grant from Oberlin College, and by NSF grant EIA-9806718. Author’s current address: Department of Computer Science, Brandeis University, Waltham, MA 02254. e-mail: jll@cs.brandeis.edu
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
L.O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, Computer Science Department, University of Copenhagen, May 1994. DIKU Technical Report 94/19.
J. Auslander, M. Philipose, C. Chambers, S.J. Eggers, and B.N. Bershad. Fast, effective dynamic compilation. In PLDI’96, 31(5), pages 149–159.
R. Baier, R. Glück, and R. Zöchling. Partial evaluation of numerical programs in Fortran. In ACM SIGPLANWorkshop on Partial Evaluation and Semantics-Based Program Manipulation, pages 119–132, Orlando, FL, USA, June 1994. Technical Report 94/9, University of Melbourne, Australia.
A.A. Berlin. Partial evaluation applied to numerical computation. In ACM Conference on Lisp and Functional Programming, pages 139–150, Nice, France, 1990. ACM Press.
B.N. Bershad, T.E. Anderson, E.D. Lazowska, and H.M. Levy. Lightweight remote procedure call. ACM Transactions on Computer Systems, 8(1):37–55, February 1990.
W.H. Cheung and A. Loong. Exploring issues of operating systems structuring: from microkernel to extensible systems. ACM Operating Systems Reviews, 29(4):4–16, October 1995.
C. Consel. A tour of Schism: a partial evaluation system for higher-order applicative languages. In Partial Evaluation and Semantics-Based Program Manipulation, pages 66–77, Copenhagen, Denmark, June 1993. ACM Press.
C. Consel, L. Hornof, F. Noël, J. Noyé, and E.N. Volanschi. A uniform approach for compile-time and run-time specialization. In O. Danvy, R. Glück, and P. Thiemann, editors, Partial Evaluation, International Seminar, Dagstuhl Castle, number 1110 in Lecture Notes in Computer Science, pages 54–72, February 1996.
C. Consel and F. Noël. A general approach for run-time specialization and its application to C. In Conference Record of the 23rd Annual ACM SIGPLAN-SIGACT Symposium on Principles Of Programming Languages, pages 145–156, St. Petersburg Beach, FL, USA, January 1996. ACM Press.
J. Dean, G. DeFouw, D. Grove, V. Litvinov, and C. Chambers. Vortex: an optimizing compiler for object-oriented languages. In OOPSLA’ 96 Conference, pages 93–100, San Jose (CA), October 1996.
J. Dean, D. Grove, and C. Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In Proceedings of ECOOP’ 95, Aarhus, Denmark, August 1995. Springer-Verlag.
J. Dolby and A. A. Chien. An evaluation of automatic object inline allocation techniques. In Proceedings OOPSLA’ 98 Conference on Object-Oriented Programming Systems, Languages, and Applications, ACM SIGPLAN Notices. ACM, 1998.
D.R. Engler and M.F. Kaashoek. DPF: Fast, flexible message demultiplexing using dynamic code generation. In SIGCOMM Symposium on Communications Architectures and Protocols, pages 26–30, Stanford University, CA, August 1996. ACM Press.
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns. Addison-Wesley, 1994.
B. Guenter, T.B. Knoblock, and E. Ruf. Specializing shaders. In Computer Graphics Proceedings, Annual Conference Series, pages 343–350. ACM Press, 1995.
Urs Hölzle and David Ungar. Optimizing dynamically-dispatched calls with runtime type feedback. In Proceedings of the Conference on Programming Language Design and Implementation, pages 326–336, New York, NY, USA, June 1994. ACM Press.
S. C. Khoo and R. S. Sundaresh. Compiling inheritance using partial evaluation. In Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 211–222, Yale University, 17–19 June 1991.
P. Kleinrubatscher, A. Kriegshaber, R. Zöchling, and R. Glück. Fortran program specialization. In U. Meyer and G. Snelting, editors, Workshop Semantikgestützte Analyse, Entwicklung und Generierung von Programmen, pages 45–54. Justus-Liebig-Universität, Giessen, Germany, 1994. Report No. 9402.
P. Lee and M. Leone. Optimizing ML with run-time code generation. In PLDI’96, [27], pages 137–148.
B.N. Locanthi. Fast bitblt() with asm() and cpp. In European UNIX Systems User Group Conference Proceedings, pages 243–259, AT&T Bell Laboratories, Murray Hill, September 1987. EUUG.
R. Marlet, S. Thibault, and C. Consel. Mapping software architectures to effcient implementations via partial evaluation. In Conference on Automated Software Engineering, pages 183–192, Lake Tahoe, Nevada, November 1997. IEEE Computer Society.
M. Marquard and B. Steensgaard. Partial evaluation of an object-oriented imperative language. Master’s thesis, Master’s thesis University of Copenhagen, Department of Computer Science, Universitetsparken 1, 2100 Copenhagen O., Denmark, April 1992.
B. Moura. Bridging the Gap between Functional and Imperative Languages. PhD thesis, University of Rennes I, April 1997.
G. Muller, R. Marlet, E.N. Volanschi, C. Consel, C. Pu, and A. Goel. Fast, optimized Sun RPC using automatic program specialization. In Proceedings of the 18th International Conference on Distributed Computing Systems, pages 240–249, Amsterdam, The Netherlands, May 1998. IEEE Computer Society Press.
G. Muller, B. Moura, F. Bellard, and C. Consel. Harissa: A flexible and effcient Java environment mixing bytecode and compiled code. In Proceedings of the 3rd Conference on Object-Oriented Technologies and Systems, pages 1–20, Portland (Oregon), USA, June 1997. Usenix.
G. Muller and U. Schultz. Harissa: A hybrid approach to Java execution. IEEE Software, pages 44–51, March 1999.
Proceedings of the ACM SIGPLAN’ 96 Conference on Programming Language Design and Implementation, Philadelphia, PA, May 1996. ACM SIGPLAN Notices, 31(5).
C. Pu, T. Autrey, A. Black, C. Consel, C. Cowan, J. Inouye, L. Kethana, J. Walpole, and K. Zhang. Optimistic incremental specialization: Streamlining a commercial operating system. In Proceedings of the 1995 ACM Symposium on Operating Systems Principles, pages 314–324, Copper Mountain Resort, CO, USA, December 1995. ACM Operating Systems Reviews, 29(5), ACM Press.
C. Pu, H. Massalin, and J. Ioannidis. The Synthesis kernel. Computing Systems, 1(1):11–32, Winter 1988.
J.C. Russ. The Image Processing Handbook. CRC Press, Inc., second edition, 1995.
T. L. Veldhuizen. C++ templates as partial evaluation. In ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pages 13–18, San Antonio, TX, USA, January 1999. ACM Press.
E.N. Volanschi, C. Consel, G. Muller, and C. Cowan. Declarative specialization of object-oriented programs. In OOPSLA’97 Conference Proceedings, pages 286–300, Atlanta, USA, October 1997. ACM Press.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-VerlagBerlin Heidelberg
About this paper
Cite this paper
Pagh Schultz, U., Lawall, J.L., Consel, C., Muller, G. (1999). Towards Automatic Specialization of Java Programs. In: Guerraoui, R. (eds) ECOOP’ 99 — Object-Oriented Programming. ECOOP 1999. Lecture Notes in Computer Science, vol 1628. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48743-3_17
Download citation
DOI: https://doi.org/10.1007/3-540-48743-3_17
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66156-6
Online ISBN: 978-3-540-48743-2
eBook Packages: Springer Book Archive