Dynamic Flow Analysis for Java']JavaScript

被引:1
作者
Naus, Nico [1 ]
Thiemann, Peter [2 ]
机构
[1] Univ Utrecht, Utrecht, Netherlands
[2] Albert Ludwigs Univ Freiburg, Freiburg, Germany
来源
TRENDS IN FUNCTIONAL PROGRAMMING (TFP 2016) | 2019年 / 10447卷
关键词
Type inference; !text type='Java']Java[!/text]Script; Flow analysis; Dynamic languages; INFERENCE; SYSTEM;
D O I
10.1007/978-3-030-14805-8_5
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Static flow analyses compute a safe approximation of a program's dataflow without executing it. Dynamic flow analyses compute a similar safe approximation by running the program on test data such that it achieves sufficient coverage. We design and implement a dynamic flow analysis for JavaScript. Our formalization and implementation observe a program's execution in a training run and generate flow constraints from the observations. We show that a solution of the constraints yields a safe approximation to the program's dataflow if each path in every function is executed at least once in the training run. As a by-product, we can reconstruct types for JavaScript functions from the results of the flow analysis. Our implementation shows that dynamic flow analysis is feasible for JavaScript. While our formalization concentrates on a core language, the implementation covers full JavaScript. We evaluated the implementation using the SunSpider benchmark.
引用
收藏
页码:75 / 93
页数:19
相关论文
共 22 条
  • [1] Dynamic Inference of Static Types for Ruby
    An, Jong-hoon
    Chaudhuri, Avik
    Foster, Jeffrey S.
    Hicks, Michael
    [J]. POPL 11: PROCEEDINGS OF THE 38TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2011, : 459 - 471
  • [2] Anderson C, 2005, LECT NOTES COMPUT SC, V3586, P428
  • [3] Type Checking for Java']JavaScript
    Anderson, Christopher
    Giannini, Paola
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2005, 138 (02) : 37 - 58
  • [4] [Anonymous], 1979, P 6 ACM SIGACT SIGPL, DOI DOI 10.1145/567752.567776
  • [5] CARTWRIGHT R, 1991, SIGPLAN NOTICES, V26, P278, DOI 10.1145/113446.113469
  • [6] Dependent Types for Java']JavaScript
    Chugh, Ravi
    Herman, David
    Jhala, Ranjit
    [J]. ACM SIGPLAN NOTICES, 2012, 47 (10) : 587 - 606
  • [7] Furr Michael, 2009, Proceedings of the 2009 ACM Symposium on Applied Computing (SAC), P1859
  • [8] Fast and Precise Hybrid Type Inference for Java']JavaScript
    Hackett, Brian
    Guo, Shu-yu
    [J]. ACM SIGPLAN NOTICES, 2012, 47 (06) : 239 - 249
  • [9] HENGLEIN F, 1991, LECT NOTES COMPUT SC, V523, P448
  • [10] A Falsification View of Success Typing
    Jakob, Robert
    Thiemann, Peter
    [J]. NASA FORMAL METHODS (NFM 2015), 2015, 9058 : 234 - 247