[论文解读] Structural Analysis: Shape Information via Points-To Computation
本文提出结构化分析(Structural Analysis),一种混合式堆分析方法,通过结合形状分析的表达能力与点向分析的效率,利用基于集合的弱更新转移函数和基于经验堆结构的正规形式,实现高精度与可扩展性。该方法在不到65秒内分析超过30,000条字节码的大型 .NET 程序,内存占用低于130 MB。
This paper introduces a new hybrid memory analysis, Structural Analysis, which combines an expressive shape analysis style abstract domain with efficient and simple points-to style transfer functions. Using data from empirical studies on the runtime heap structures and the programmatic idioms used in modern object-oriented languages we construct a heap analysis with the following characteristics: (1) it can express a rich set of structural, shape, and sharing properties which are not provided by a classic points-to analysis and that are useful for optimization and error detection applications (2) it uses efficient, weakly-updating, set-based transfer functions which enable the analysis to be more robust and scalable than a shape analysis and (3) it can be used as the basis for a scalable interprocedural analysis that produces precise results in practice. The analysis has been implemented for .Net bytecode and using this implementation we evaluate both the runtime cost and the precision of the results on a number of well known benchmarks and real world programs. Our experimental evaluations show that the domain defined in this paper is capable of precisely expressing the majority of the connectivity, shape, and sharing properties that occur in practice and, despite the use of weak updates, the static analysis is able to precisely approximate the ideal results. The analysis is capable of analyzing large real-world programs (over 30K bytecodes) in less than 65 seconds and using less than 130MB of memory. In summary this work presents a new type of memory analysis that advances the state of the art with respect to expressive power, precision, and scalability and represents a new area of study on the relationships between and combination of concepts from shape and points-to analyses.
研究动机与目标
- 通过结合表达力强的形状分析与高效点向风格的转移函数,解决堆分析中的可扩展性-精度权衡问题。
- 利用对现代面向对象程序堆结构的经验洞察(如主要为不可变行为及标准容器的使用)来指导分析设计。
- 开发一种混合分析方法,在使用弱更新的同时保持精度,避免强更新与实例化带来的复杂性。
- 实现对具有复杂数据结构、递归与动态分派的真实世界程序的可扩展、过程间分析。
- 证明弱更新、基于集合的转移函数可在实践中实现对常见形状、共享与连通性属性的精确结果。
提出的方法
- 抽象堆域基于增强有向图的存储形状图,附加数据结构形状与共享(单射性)信息。
- 通过在 O((N+E) log N) 时间内进行合一闭包计算正规形式,利用从经验堆模式中导出的等价关系。
- 分配操作创建新节点,随后通过连通性与等价关系将节点分组为结构。
- 转移函数使用集合运算与弱更新,无需实例化或分支拆分,高效模拟程序语句。
- 上下文敏感的过程间分析通过克隆与合并本地形状图实现,保持精度。
- 分析在局部上为流不敏感,但在全局上为上下文敏感,从而实现可扩展性与精度的平衡。
实验结果
研究问题
- RQ1仅使用弱更新、基于集合的转移函数,而非复杂形状分析操作,能否实现高精度的混合堆分析?
- RQ2现代面向对象堆结构的经验特征(如主要为不可变行为及标准容器的使用)在多大程度上可支持更简单、可扩展的分析?
- RQ3在形状风格域中使用弱更新是否在实践中导致显著精度损失?或可通过结构正规形式与不相交性特性加以缓解?
- RQ4此类混合分析能否扩展到具有复杂数据结构、递归与动态分派的大规模真实程序?
- RQ5是否可能在不使用强更新或实例化的情况下,实现对形状、连通性与共享的精确追踪?
主要发现
- 该分析精确捕获了真实世界面向对象程序中绝大多数连通性、形状与共享属性。
- 尽管使用弱更新,分析仍达到接近理想结果的精度,仅因域中强不相交性与隔离性导致极小程度的不精确。
- 实现可在不到65秒内分析超过30,000条字节码的大型 .NET 程序,内存占用低于130 MB。
- 基于经验堆模式的正规形式可实现快速收敛,同时减少无关细节,而不损失关键结构信息。
- 该方法在可扩展性方面优于现有形状分析,尤其适用于具有递归与复杂数据结构的程序。
- 该方法成功处理了动态分派与递归遍历,而这些对许多先前方法而言是挑战。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。