Skip to main content

Inlining to reduce stack space

  • Conference paper
  • First Online:
Progamming Language Implementation and Logic Programming (PLILP 1993)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 714))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aho, A., Sethi, R., and Ullman, J. Compilers, Principles, Techniques, and Tools. Addison-Wesley, Reading, MA, 1986.

    Google Scholar 

  2. Appel, A. Compiling with Continuations. Cambridge University Press, Cambridge, UK, 1992.

    Google Scholar 

  3. 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.

    Google Scholar 

  4. Intel Corp. MCS-86 Assembly Language Reference Manual. Intel Corp., Santa Clara, CA, 1978.

    Google Scholar 

  5. 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.

    Google Scholar 

  6. Gabriel, R. Performance and Evaluation of LISP Systems. MIT Press, Cambridge, Massachusetts, 1985.

    Google Scholar 

  7. George, L. An abstract machine for parallel graph reduction. In ACM Conference on Functional Programming Languages and Computer Architecture (FPCA), pages 214–229, 1989.

    Google Scholar 

  8. Goldberg, B. Multiprocessor Execution of Functional Programs. PhD thesis, Yale University, 1988. Also report YALEU/DCS/RR-618.

    Google Scholar 

  9. Graham, I. and King, T. The Transputer Handbook. Prentice Hall, New York, 1990.

    Google Scholar 

  10. Hartley, S. Compile-time program restructuring in multiprogrammed virtual memory systems. IEEE Transactions on Software Engineering, 14:1640–1644, 1988.

    Google Scholar 

  11. 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.

    Google Scholar 

  12. Kaser, O. Inlining to Reduce Stack Space. Technical Report 92/07, SUNY at Stony Brook, 1992.

    Google Scholar 

  13. 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.

    Google Scholar 

  14. Kaser, O., Ramakrishnan, C, and Pawagi, S. A New Approach to Inlining. Technical Report 92/06, SUNY at Stony Brook, 1992.

    Google Scholar 

  15. Maranget, L. GAML: a parallel implementation of lazy ML. In ACM Conf. on Functional Programming Languages and Computer Architecture (FPCA), 1991.

    Google Scholar 

  16. 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.

    Google Scholar 

  17. Osborne, A. and Kane, G. 4 & 8-Bit Microprocessor Handbook. OSBORNE/McGraw-Hill, Berkeley, CA, 1981.

    Google Scholar 

  18. Ryder, B. and Pendergrast, S. Experiments in optimizing FP. IEEE Transactions on Software Engineering, 14:444–454, 1988.

    Google Scholar 

  19. Scheifler, R. An analysis of inline substitution for a structured programming language. Communications of the ACM, 20(9):647–654, 1977.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Maurice Bruynooghe Jaan Penjam

Rights and permissions

Reprints 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

Publish with us

Policies and ethics