Advertisement

Relatively Complete Pushdown Analysis of Escape Continuations

  • Kimball GermaneEmail author
  • Matthew Might
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11388)

Abstract

Escape continuations are weaker than full, first-class continuations but nevertheless can express many common control operators. Although language and compiler designs profitably leverage escape continuations, all previous approaches to analyze them statically in a higher-order setting have been ad hoc or imprecise. We present \(\mathrm {MCCFA}2\), a generalization of \(\mathrm {CFA}2\) that analyzes them with pushdown precision in their most-general form. In particular, the summarization algorithm of \(\mathrm {MCCFA}2\) is both sound and complete with respect to a conservative extension of \(\mathrm {CFA}2\)’s abstract semantics. We also present an continuation age analysis as a client of \(\mathrm {MCCFA}2\) that reveals critical function call optimizations.

Notes

Acknowledgments

This material is partially based on research sponsored by DARPA under agreement number AFRL FA8750-15-2-0092 and by NSF under CAREER grant 1350344. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon.

References

  1. 1.
    Adams, N., Kranz, D., Kelsey, R., Rees, J., Hudak, P., Philbin, J.: ORBIT: an optimizing compiler for scheme. In: SIGPLAN 1986. ACM, New York (1986)Google Scholar
  2. 2.
    Appel, A.W.: Compiling with Continuations. Cambridge University Press, Cambridge (2007)Google Scholar
  3. 3.
    Earl, C., Might, M., Van Horn, D.: Pushdown control-flow analysis of higher-order programs. In: Workshop on Scheme and Functional Programming (2010)Google Scholar
  4. 4.
    Felleisen, M.: On the expressive power of programming languages. Sci. Comput. Program. 17(1), 35–75 (1991)MathSciNetCrossRefGoogle Scholar
  5. 5.
    Germane, K., Might, M.: Multi-continuation pushdown analysis. Technical report, January 2019. http://kimball.germane.net/germane-mccfa2-techreport.pdf
  6. 6.
    Gilray, T., Lyde, S., Adams, M.D., Might, M., Van Horn, D.: Pushdown control-flow analysis for free. In: Proceedings of the 43rd Annual ACM Symposium on Principles of Programming Languages. POPL 2016, pp. 691–704. ACM, New York (2016)Google Scholar
  7. 7.
    Hieb, R., Dybvig, R.K., Bruggeman, C.: Representing control in the presence of first-class continuations. In: Proceedings of the ACM SIGPLAN 1990 Conference on Programming Language Design and Implementation. PLDI 1990, pp. 66–77. ACM, New York (1990)Google Scholar
  8. 8.
    Johnson, J.I., Van Horn, D.: Abstracting abstract control. In: Proceedings of the 10th ACM Symposium on Dynamic languages, pp. 11–22. ACM (2014)Google Scholar
  9. 9.
    Kennedy, A.: Compiling with continuations, continued. In: Proceedings of the 12th ACM International Conference on Functional Programming. ICFP 2007, pp. 177–190. ACM, New York (2007)Google Scholar
  10. 10.
    Kim, J., Yi, K., Danvy, O.: Assessing the overhead of ML exceptions by selective CPS transformation, vol. 5, January 1998Google Scholar
  11. 11.
    Ley-Wild, R., Fluet, M., Acar, U.A.: Compiling self-adjusting programs with continuations. In: Proceedings of the 13th ACM International Conference on Functional Programming. ICFP 2008, pp. 321–334. ACM, New York (2008)Google Scholar
  12. 12.
    Liang, S., Sun, W., Might, M., Keep, A., Horn, D.V.: Pruning, pushdown exception-flow analysis. In: Proceedings of the 2014 IEEE 14th International Working Conference on Source Code Analysis and Manipulation, pp. 265–274. IEEE Computer Society (2014)Google Scholar
  13. 13.
    Might, M.: Environment analysis of higher-order languages (2007)Google Scholar
  14. 14.
    Might, M., Shivers, O.: Environment analysis via \(\Delta \)CFA. In: Conference Record of the 33rd ACM Symposium on Principles of Programming Languages. POPL 2006, pp. 127–140. ACM, New York (2006)Google Scholar
  15. 15.
    Shivers, O.: Control-flow analysis of higher-order languages. Ph.D. thesis. Carnegie Mellon University (1991)Google Scholar
  16. 16.
    Shivers, O., Fisher, D.: Multi-return function call. J. Funct. Program. 16(4), 547–582 (2006)MathSciNetCrossRefGoogle Scholar
  17. 17.
    Thielecke, H.: Comparing control constructs by double-barrelled CPS. Higher-Order Symb. Comput. 15(2), 141–160 (2002)CrossRefGoogle Scholar
  18. 18.
    Van Horn, D., Might, M.: Abstracting abstract machines. In: Proceedings of the 15th ACM International Conference on Functional Programming. ICFP 2010, pp. 51–62. ACM, New York (2010)Google Scholar
  19. 19.
    Vardoulakis, D., Shivers, O.: CFA2: a context-free approach to control-flow analysis. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 570–589. Springer, Heidelberg (2010).  https://doi.org/10.1007/978-3-642-11957-6_30CrossRefGoogle Scholar
  20. 20.
    Vardoulakis, D., Shivers, O.: Ordering multiple continuations on the stack. In: Proceedings of the 20th ACM Workshop on Partial Evaluation and Program Manipulation. PEPM 2011, pp. 13–22. ACM, New York (2011)Google Scholar
  21. 21.
    Vardoulakis, D., Shivers, O.: Pushdown flow analysis of first-class control. In: Proceedings of the 16th ACM International Conference on Functional Programming. ICFP 2011, pp. 69–80. ACM, New York (2011)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.Brigham Young UniversityProvoUSA
  2. 2.University of AlabamaBirminghamUSA

Personalised recommendations