skip to main content
research-article

Dynamic determinacy analysis

Authors Info & Claims
Published:16 June 2013Publication History
Skip Abstract Section

Abstract

We present an analysis for identifying determinate variables and expressions that always have the same value at a given program point. This information can be exploited by client analyses and tools to, e.g., identify dead code or specialize uses of dynamic language constructs such as eval, replacing them with equivalent static constructs. Our analysis is completely dynamic and only needs to observe a single execution of the program, yet the determinacy facts it infers hold for any execution. We present a formal soundness proof of the analysis for a simple imperative language, and a prototype implementation that handles full JavaScript. Finally, we report on two case studies that explored how static analysis for JavaScript could leverage the information gathered by dynamic determinacy analysis. We found that in some cases scalability of static pointer analysis was improved dramatically, and that many uses of runtime code generation could be eliminated.

References

  1. Umut A. Acar. Self-Adjusting Computation. Ph.D. thesis, Carnegie Mellon University, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Shay Artzi, Julian Dolby, Simon Holm Jensen, Anders Møller, and Frank Tip. A Framework for Automated Testing of JavaScript Web Applications. In ICSE, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Thomas H. Austin and Cormac Flanagan. Efficient Purely-Dynamic Information Flow Analysis. In PLAS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Thomas H. Austin and Cormac Flanagan. Multiple Facets for Dynamic Information Flow. In POPL, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Eric Bodden, Andreas Sewe, Jan Sinschek, Hela Oueslati, and Mira Mezini. Taming Reflection: Aiding Static Analysis in the Presence of Reflection and Custom Class Loaders. In ICSE, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Yan Chen, Joshua Dunfield, and Umut A. Acar. Type-Directed Automatic Incrementalization. In PLDI, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Yan Chen, Joshua Dunfield, Matthew Hammer, and Umut Acar. Implicit Self-Adjusting Computation for Purely Functional Programs. In ICFP, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Aske Simon Christensen, Anders Møller, and Michael I. Schwartzbach. Precise Analysis of String Expressions. In SAS, 2003.Google ScholarGoogle Scholar
  9. Ravi Chugh, Jeffrey A. Meister, Ranjit Jhala, and Sorin Lerner. Staged Information Flow for JavaScript. In PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Charles Consel. Polyvariant Binding-Time Analysis For Applicative Languages. In PEPM, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Douglas Crockford. JavaScript: The Good Parts. O'Reilly, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Bruno Dufour, Barbara G. Ryder, and Gary Sevitsky. Blended Analysis for Performance Understanding of Framework-based Applications. In ISSTA, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Michael Furr, Jong-hoon An, and Jeffrey S. Foster. Profile-guided Static Typing for Dynamic Scripting Languages. In OOPSLA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Salvatore Guarnieri and V. Benjamin Livshits.textscGatekeeper: Mostly Static Enforcement of Security and Reliability Policies for JavaScript Code. In USENIX Security Symposium, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Arjun Guha, Claudiu Saftoiu, and Shriram Krishnamurthi. The Essence of JavaScript. In ECOOP, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Brian Hackett and Shu-yu Guo. Fast and Precise Hybrid Type Inference for JavaScript. In PLDI, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Simon Holm Jensen, Peter A. Jonsson, and Anders Møller. Remedying the Eval That Men Do. In ISSTA, 2012.Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Simon Holm Jensen, Anders Møller, and Peter Thiemann. Type Analysis for JavaScript. In SAS, 2009.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial evaluation and automatic program generation. Prentice-Hall, Inc., 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. James C. King. Symbolic Execution and Program Testing. Communications of the ACM, 19(7), July 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Etienne Kneuss, Philippe Suter, and Viktor Kuncak. Runtime Instrumentation for Precise Flow-Sensitive Type Analysis. In RV, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Xavier Leroy and Hervé Grall. Coinductive Big-Step Operational Semantics. Inf. Comput., 207(2):284--304, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Fadi Meawad, Gregor Richards, Floréal Morandat, and Jan Vitek. Eval Begone! Semi-Automated Removal of Eval from JavaScript Programs. In OOPSLA, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Thomas W. Reps, Stefan Schwoon, Somesh Jha, and David Melski. Weighted Pushdown Systems and Their Application to Interprocedural Dataflow Analysis. Sci. Comput. Program., 58(1--2):206--263, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Thomas W. Reps and Tim Teitelbaum. The Synthesizer Generator. In SDE, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Gregor Richards, Christian Hammer, Brian Burg, and Jan Vitek. The Eval That Men Do--A Large-Scale Study of the Use of Eval in JavaScript Applications. In ECOOP, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Gregor Richards, Sylvain Lebresne, Brian Burg, and Jan Vitek. An Analysis of the Dynamic Behavior of JavaScript Programs. In PLDI, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. David A. Schmidt. Trace-Based Abstract Interpretation of Operational Semantics. Lisp and Symbolic Computation, 10(3):237--271, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. O. Shivers. Control Flow Analysis in Scheme. In PLDI, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Manu Sridharan, Julian Dolby, Satish Chandra, Max Schäfer, and Frank Tip. Correlation Tracking for Points-To Analysis of JavaScript. In ECOOP, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Shiyi Wei and Barbara G. Ryder. A Practical Blended Analysis for Dynamic Features in JavaScript. TR 12--18, Virginia Tech, 2012.Google ScholarGoogle Scholar
  32. Steve Zdancewic. Programming Languages for Information Security. PhD thesis, Cornell University, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Dynamic determinacy analysis

      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

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 48, Issue 6
        PLDI '13
        June 2013
        515 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2499370
        Issue’s Table of Contents
        • cover image ACM Conferences
          PLDI '13: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation
          June 2013
          546 pages
          ISBN:9781450320146
          DOI:10.1145/2491956

        Copyright © 2013 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 16 June 2013

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!