skip to main content
10.1145/2034773.2034785acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Pushdown flow analysis of first-class control

Published:19 September 2011Publication History

ABSTRACT

Pushdown models are better than control-flow graphs for higher-order flow analysis. They faithfully model the call/return structure of a program, which results in fewer spurious flows and increased precision. However, pushdown models require that calls and returns in the analyzed program nest properly. As a result, they cannot be used to analyze language constructs that break call/return nesting such as generators, coroutines, call/cc, etc.

In this paper, we extend the CFA2 flow analysis to create the first pushdown flow analysis for languages with first-class control. We modify the abstract semantics of CFA2 to allow continuations to escape to, and be restored from, the heap. We then present a summarization algorithm that handles escaping continuations via a new kind of summary edge. We prove that the algorithm is sound with respect to the abstract semantics.

Skip Supplemental Material Section

Supplemental Material

_talk7.mp4

mp4

55.2 MB

References

  1. A. W. Appel. Compiling with Continuations. Cambridge University Press, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. P. Cousot and R. Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of the Fourth Annual ACM Symposium on Principles of Programming Languages, pages 238--252, Jan. 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. O.-J. Dahl and K. Nygaard. SIMULA - an ALGOL-based simulation language. Communications of the ACM, 9 (9): 671--678, 1966. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. O. Danvy and A. Filinski. A functional abstraction of typed contexts. Technical Report 89/12, University of Copenhagen, 1989.Google ScholarGoogle Scholar
  5. Doctor JS: A set of static-analysis tools for JavaScript. https://github.com/mozilla/doctorjs.Google ScholarGoogle Scholar
  6. C. Earl, M. Might, and D. Van Horn. Pushdown control-flow analysis of higher-order programs. In Proceedings of the 2010 Workshop on Scheme and Functional Programming, 2010.Google ScholarGoogle Scholar
  7. M. Felleisen. The theory and practice of first-class prompts. In Proceedings of the Fifteenth Annual ACM Symposium on Principles of Programming Languages, pages 180--190, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. JavaScript generators. https://developer.mozilla.org/en/JavaScript/New_in_JavaScript/1.7.Google ScholarGoogle Scholar
  9. D. Kranz. ORBIT: An Optimizing Compiler for Scheme. PhD thesis, Yale University, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D. Kranz, R. Kelsey, J. Rees, P. Hudak, J. Philbin, and N. Adams. Orbit: an optimizing compiler for Scheme. In Proceedings of the 1986 SIGPLAN Symposium on Compiler Construction, pages 219--233, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. The Lua programming language. http://www.lua.org.Google ScholarGoogle Scholar
  12. M. Might. Environment Analysis of Higher-Order Languages. PhD thesis, Georgia Institute of Technology, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Might and O. Shivers. Analyzing the environment structure of higher-order languages using frame strings. Theoretical Computer Science, 375 (1-3): 137--168, May 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Python generators. http://www.python.org/dev/peps/pep-0255.Google ScholarGoogle Scholar
  15. T. W. Reps, S. Horwitz, and S. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In Proceedings of the Twenty-Second Annual ACM Symposium on Principles of Programming Languages, pages 49--61, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. T. Rompf, I. Maier, and M. Odersky. Implementing first-class polymorphic delimited continuations by a type-directed selective CPS-transform. In Proceeding of the 14th ACM SIGPLAN International Conference on Functional Programming, pages 317--328, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Sharir and A. Pnueli. Two approaches to interprocedural data-flow analysis. In S. Muchnick and N. Jones, editors, Program Flow Analysis: Theory and Applications. Prentice Hall, 1981.Google ScholarGoogle Scholar
  18. O. Shivers. Continuations and threads: Expressing machine concurrency directly in advanced languages. In O. Danvy, editor, Proceedings of the Second ACM SIGPLAN Workshop on Continuations (CW 1997), Technical report BRICS-NS-96-13, University of Århus, pages 2:1--15, Paris, France, Jan. 1997.Google ScholarGoogle Scholar
  19. O. Shivers and M. Might. Continuations and transducer composition. In Proceedings of the 2006 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2006), pages 295--307, Ottawa, Canada, June 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Sperber, R. K. Dybvig, M. Flatt, A. van Straaten, R. Findler, and J. Matthews, editors. Revised6 Report on the Algorithmic Language Scheme. Cambridge University Press, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. G. L. Steele. Rabbit: A Compiler for Scheme. Master's thesis, MIT, 1978.Google ScholarGoogle Scholar
  22. D. Vardoulakis and O. Shivers. CFA2: A context-free approach to control-flow analysis. In Proceedings of the 19th European Symposium on Programming (ESOP 2010), volume 6012 of Lecture Notes in Computer Science, pages 570--589, Paphos, Cyprus, Mar. 2010. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Vardoulakis and O. Shivers. Ordering multiple continuations on the stack. In Proceedings of the 2011 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM 2011), pages 13--22, Austin, Texas, Jan. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. D. Vardoulakis and O. Shivers. CFA2: A context-free approach to control-flow analysis. Logical Methods in Computer Science, 7 (2:3): 1--39, May 2011.Google ScholarGoogle ScholarCross RefCross Ref
  25. M. Wand. Continuation-based multiprocessing. In Conference Record of the 1980 LISP Conference, pages 19--28, Stanford, 1980. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Pushdown flow analysis of first-class control

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        ICFP '11: Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
        September 2011
        470 pages
        ISBN:9781450308656
        DOI:10.1145/2034773
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 46, Issue 9
          ICFP '11
          September 2011
          456 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2034574
          Issue’s Table of Contents

        Copyright © 2011 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 19 September 2011

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        ICFP '11 Paper Acceptance Rate33of92submissions,36%Overall Acceptance Rate333of1,064submissions,31%

        Upcoming Conference

        ICFP '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader