Efficient Construction of Approximate Call Graphs for JavaScript IDE Services

Asger Feldthaus, Max Schäfer, Manu Sridharan, Julian Dolby, and Frank Tip

Aarhus University, Denmark; IBM Research, USA

Track: Technical Research
Session: Programming Support
The rapid rise of JavaScript as one of the most popular programming languages of the present day has led to a demand for sophisticated IDE support similar to what is available for Java or C#. However, advanced tooling is hampered by the dynamic nature of the language, which makes any form of static analysis very difficult. We single out efficient call graph construction as a key problem to be solved in order to improve development tools for JavaScript. To address this problem, we present a scalable field-based flow analysis for constructing call graphs. Our evaluation on large real-world programs shows that the analysis, while in principle unsound, produces highly accurate call graphs in practice. Previous analyses do not scale to these programs, but our analysis handles them in a matter of seconds, thus proving its suitability for use in an interactive setting.