Constructing Call Graphs of Scala Programs

Constructing Call Graphs of Scala Programs
复制标题

构建 Scala 程序的调用图

DOI:
10.1007/978-3-662-44202-9_3
复制
发表时间:
2014
期刊:
Proceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools
影响因子:
--
通讯作者:
F. Tip
F. Tip
中科院分区:
--
文献类型:
--
作者:
Karim Ali;Marianna Rapoport;Ondřej Lhoták;Julian T Dolby;F. Tip

文献摘要

被引文献

相似文献

随着Scala的受欢迎程度,对其编程工具的兴趣越来越大。这样的工具通常需要呼叫图。但是,文献中调用图形构造算法不能处理Scala特征,例如性状和抽象类型成员。将现有的呼叫图构造算法应用于Scala编译器生成的JVM字节码,由于汇编过程中丢失的类型信息而产生的结果非常不精确。我们适应现有的呼叫图构建算法,基于名称的分辨率RA和快速类型分析RTA,用于Scala,并根据轻量级的Scala提供形式化。我们在Scala程序集中评估了我们的算法。我们的结果表明,仔细处理复杂的Scala构造极大地有助于精确,并且我们最精确的分析生成的呼叫图少于节点少的1.1-3.7倍,而边缘的1.5-18.7倍比基于字节码的RTA分析少1.5-18.7倍。
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.