Constructing Call Graphs of Scala Programs
Constructing Call Graphs of Scala Programs
复制标题
构建 Scala 程序的调用图
DOI:
10.1007/978-3-662-44202-9_3
复制
发表时间:
2014
期刊:
影响因子:
--
通讯作者:
F. Tip
中科院分区:
文献类型:
--
作者:
Karim Ali;Marianna Rapoport;Ondřej Lhoták;Julian T Dolby;F. Tip
As Scala gains popularity, there is growing interest in programming tools for it. Such tools often require call graphs. However, call graph construction algorithms in the literature do not handle Scala features, such as traits and abstract type members. Applying existing call graph construction algorithms to the JVM bytecodes generated by the Scala compiler produces very imprecise results due to type information being lost during compilation. We adapt existing call graph construction algorithms, Name-Based Resolution RA and Rapid Type Analysis RTA, for Scala, and present a formalization based on Featherweight Scala. We evaluate our algorithms on a collection of Scala programs. Our results show that careful handling of complex Scala constructs greatly helps precision and that our most precise analysis generates call graphs with 1.1-3.7 times fewer nodes and 1.5-18.7 times fewer edges than a bytecode-based RTA analysis.