Call graphs for languages with parametric polymorphism

Author:

Petrashko Dmitry1,Ureche Vlad1,Lhoták Ondřej2,Odersky Martin1

Affiliation:

1. EPFL, Switzerland

2. University of Waterloo, Canada

Abstract

The performance of contemporary object oriented languages depends on optimizations such as devirtualization, inlining, and specialization, and these in turn depend on precise call graph analysis. Existing call graph analyses do not take advantage of the information provided by the rich type systems of contemporary languages, in particular generic type arguments. Many existing approaches analyze Java bytecode, in which generic types have been erased. This paper shows that this discarded information is actually very useful as the context in a context-sensitive analysis, where it significantly improves precision and keeps the running time small. Specifically, we propose and evaluate call graph construction algorithms in which the contexts of a method are (i) the type arguments passed to its type parameters, and (ii) the static types of the arguments passed to its term parameters. The use of static types from the caller as context is effective because it allows more precise dispatch of call sites inside the callee. Our evaluation indicates that the average number of contexts required per method is small. We implement the analysis in the Dotty compiler for Scala, and evaluate it on programs that use the type-parametric Scala collections library and on the Dotty compiler itself. The context-sensitive analysis runs 1.4x faster than a context-insensitive one and discovers 20% more monomorphic call sites at the same time. When applied to method specialization, the imprecision in a context-insensitive call graph would require the average method to be cloned 22 times, whereas the context-sensitive call graph indicates a much more practical 1.00 to 1.50 clones per method. We applied the proposed analysis to automatically specialize generic methods. The resulting automatic transformation achieves the same performance as state-of-the-art techniques requiring manual annotations, while reducing the size of the generated bytecode by up to 5x.

Publisher

Association for Computing Machinery (ACM)

Subject

Computer Graphics and Computer-Aided Design,Software

Reference20 articles.

1. K. Ali and O. Lhoták . Application-only call graph construction . In J. Noble editor ECOOP 2012 - Object-Oriented Programming - 26th European Conference Beijing China June 11-16 2012. Proceedings volume 7313 of Lecture Notes in Computer Science pages 688– 712 . Springer 2012. ISBN 978-3-642-31056-0. K. Ali and O. Lhoták. Averroes: Whole-program analysis without the whole program. In G. Castagna editor ECOOP 2013 - Object-Oriented Programming - 27th European Conference Montpellier France July 1-5 2013. Proceedings volume 7920 of Lecture Notes in Computer Science pages 378–400. Springer 2013. ISBN 978-3-642-39037-1. doi: 10. 1007/978-3-642-39038-8. 10.1007/978-3-642-31057-7_30 K. Ali and O. Lhoták. Application-only call graph construction. In J. Noble editor ECOOP 2012 - Object-Oriented Programming - 26th European Conference Beijing China June 11-16 2012. Proceedings volume 7313 of Lecture Notes in Computer Science pages 688–712. Springer 2012. ISBN 978-3-642-31056-0. K. Ali and O. Lhoták. Averroes: Whole-program analysis without the whole program. In G. Castagna editor ECOOP 2013 - Object-Oriented Programming - 27th European Conference Montpellier France July 1-5 2013. Proceedings volume 7920 of Lecture Notes in Computer Science pages 378–400. Springer 2013. ISBN 978-3-642-39037-1. doi: 10. 1007/978-3-642-39038-8. 10.1007/978-3-642-31057-7_30

2. 286957. 286957.

3. Compiling generics through user-directed type specialization

4. EXPLORER : query- and demand-driven exploration of interprocedural control flow properties

Cited by 8 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. A Cocktail Approach to Practical Call Graph Construction;Proceedings of the ACM on Programming Languages;2023-10-16

2. Incremental Call Graph Construction in Industrial Practice;2023 IEEE/ACM 45th International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP);2023-05

3. Jasmine: A Static Analysis Framework for Spring Core Technologies;Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering;2022-10-10

4. Dynamic dispatch of context-sensitive optimizations;Proceedings of the ACM on Programming Languages;2020-11-13

5. Interflow: interprocedural flow-sensitive type inference and method duplication;Proceedings of the 9th ACM SIGPLAN International Symposium on Scala;2018-09-17

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3