arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 0710.1482cs.PLcs.SE
收藏

函数式程序的堆引用分析

Heap Reference Analysis for Functional Programs

Amey Karkare, Amitabha Sanyal, Uday Khedker

摘要:

当前的垃圾收集器留下了大量未收集的垃圾,因为它们保守地通过程序变量的可达性来近似活性。在本文中,我们描述了一系列的静态分析,作为输入的一个程序写在一阶,渴望功能程序设计语言,并发现在每个程序点的引用对象,保证不会被使用在未来。转换过程会将此类引用设为空。如果这使得对象不可访问,则可以由垃圾收集器收集。这会导致收集更多的垃圾,从而导致更少的收集。此外,对于那些回收活动对象的垃圾收集器,它使每次收集更快。我们的方法的有趣的方面是在识别所需的分析,以解决问题和他们进行的方式。我们确定了三种不同的分析--活跃性、共享性和可访问性。在活性和共享分析中,函数定义的分析独立于调用上下文。这是通过使用一个变量来表示被分析的函数的未知上下文,并设置表示函数相对于变量的效果的约束来实现的。约束的解决方案是函数的总结,该函数相对于调用上下文被参数化,并用于分析函数调用。因此,我们在调用站点实现了上下文敏感性,而无需多次分析函数。

英文摘要:

Current garbage collectors leave a lot of garbage uncollected because they conservatively approximate liveness by reachability from program variables. In this paper, we describe a sequence of static analyses that takes as input a program written in a first-order, eager functional programming language, and finds at each program point the references to objects that are guaranteed not to be used in the future. Such references are made null by a transformation pass. If this makes the object unreachable, it can be collected by the garbage collector. This causes more garbage to be collected, resulting in fewer collections. Additionally, for those garbage collectors which scavenge live objects, it makes each collection faster. The interesting aspects of our method are both in the identification of the analyses required to solve the problem and the way they are carried out. We identify three different analyses -- liveness, sharing and accessibility. In liveness and sharing analyses, the function definitions are analyzed independently of the calling context. This is achieved by using a variable to represent the unknown context of the function being analyzed and setting up constraints expressing the effect of the function with respect to the variable. The solution of the constraints is a summary of the function that is parameterized with respect to a calling context and is used to analyze function calls. As a result we achieve context sensitivity at call sites without analyzing the function multiple number of times.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑