Abstract
We consider a novel use of inlining, where we reduce the amount of stack space consumed when a program is run. Stack space is a critical resource in functional- and logic-programming implementations, especially parallel implementations. We formulate an optimization problem for inlining, where code size is traded for reduced stack use, and we show that this problem is NP-hard. We then develop several heuristics for stack reduction using inlining, and present the experimental results of their effectiveness in reducing the stack use of some functional programs.
Preview
Unable to display preview. Download preview PDF.
References
Aho, A., Sethi, R., and Ullman, J. Compilers, Principles, Techniques, and Tools. Addison-Wesley, Reading, MA, 1986.
Appel, A. Compiling with Continuations. Cambridge University Press, Cambridge, UK, 1992.
Chang, P., Mahlke, S., Chen, W., and Hwu, W. Profile-guided automatic inline expansion for C programs. Software-Practice and Experience, 25:349–369, 1992.
Intel Corp. MCS-86 Assembly Language Reference Manual. Intel Corp., Santa Clara, CA, 1978.
Davidson, J. and Holler, A. Subprogram inlining: a study of its effects on program execution time. IEEE Transactions on Software Engineering, 18:89–101, 1992.
Gabriel, R. Performance and Evaluation of LISP Systems. MIT Press, Cambridge, Massachusetts, 1985.
George, L. An abstract machine for parallel graph reduction. In ACM Conference on Functional Programming Languages and Computer Architecture (FPCA), pages 214–229, 1989.
Goldberg, B. Multiprocessor Execution of Functional Programs. PhD thesis, Yale University, 1988. Also report YALEU/DCS/RR-618.
Graham, I. and King, T. The Transputer Handbook. Prentice Hall, New York, 1990.
Hartley, S. Compile-time program restructuring in multiprogrammed virtual memory systems. IEEE Transactions on Software Engineering, 14:1640–1644, 1988.
Hwu, W. and Chang, P. Inline function expansion for compiling C programs. In Proc. of the SIGPLAN '89 Conference on Programming Language Design and Implementation, pages 246–255, 1989.
Kaser, O. Inlining to Reduce Stack Space. Technical Report 92/07, SUNY at Stony Brook, 1992.
Kaser, O., Pawagi, S., Ramakrishnan, C., Ramakrishnan, I., and Sekar, R. Fast parallel implementations of lazy languages-the EQUALS experience. In Proc. ACM Conference on LISP and Functional Programming, pages 335–344, 1992.
Kaser, O., Ramakrishnan, C, and Pawagi, S. A New Approach to Inlining. Technical Report 92/06, SUNY at Stony Brook, 1992.
Maranget, L. GAML: a parallel implementation of lazy ML. In ACM Conf. on Functional Programming Languages and Computer Architecture (FPCA), 1991.
McFarling, S. Procedure merging with instruction caches. In Proc. of the SIG-PLAN '91 Conf. on Programming Language Design and Implementation, pages 71–79, 1991.
Osborne, A. and Kane, G. 4 & 8-Bit Microprocessor Handbook. OSBORNE/McGraw-Hill, Berkeley, CA, 1981.
Ryder, B. and Pendergrast, S. Experiments in optimizing FP. IEEE Transactions on Software Engineering, 14:444–454, 1988.
Scheifler, R. An analysis of inline substitution for a structured programming language. Communications of the ACM, 20(9):647–654, 1977.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kaser, O. (1993). Inlining to reduce stack space. In: Bruynooghe, M., Penjam, J. (eds) Progamming Language Implementation and Logic Programming. PLILP 1993. Lecture Notes in Computer Science, vol 714. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57186-8_84
Download citation
DOI: https://doi.org/10.1007/3-540-57186-8_84
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57186-5
Online ISBN: 978-3-540-47945-1
eBook Packages: Springer Book Archive