摘要
为了实现面向对象语言的部分求值,提出了一种绑定时间分析技术.该技术通过针对引用类型变量和指针变量的上下文敏感分析,能够比较精确地分析面向对象语言中诸如对象元素、数组元素等复杂数据结构元素的绑定时间,进而扩大了部分求值的作用范围.这种方法采用两层BTA环境来保存静态变量和局部变量的BTA状态,设置一种专用句柄来表示不同程序点创建的对象,进而采用这种句柄的集合表示引用类型变量的BTA状态.在为面向对象语言程序标注绑定时间信息的过程中,采用一个正向分析和一个反向分析过程,借助于BTA环境来跟踪和设定各种变量、对象和引用变量的绑定时间.该技术已经用于实现Java程序的绑定时间分析,能够有效地分析大多数单线程的Java程序,为实现高性能Java程序部分求值提供了必要的手段.
A technology of binding time analysis for implementing partial evaluation of object-oriented programming languages is proposed in this paper. By tracing context-sensitivity of reference variables and pointer variables, the new approach can deal with elements of partly static data structure, such as attributes of each object and elements of each array. The new approach uses a two-level BTA environment to hold BTA states for static variables and local variables. The objects created at different program points are represented by a kind of specific handle. The BTA state of a reference variable is represented by a set of such handles. The algorithm of a forward analysis and backward analysis are presented. They are used to annotate source program, with BTA environment to trace binding time of various kind of variables including identifier of array, object and reference. The binding time analysis has been implemented for Java. It is able to analyse most single thread Java programs and support partial evaluation for Java with higher performance.
出处
《软件学报》
EI
CSCD
北大核心
2003年第3期415-421,共7页
Journal of Software
基金
Supported by the National Natural Science Foundation of China under Grant No.60173013 (国家自然科学基金)
the Natural Science Foundation of Beijing City of China under Grant No.4982002 (北京市自然科学基金)
the Assisting Project of Ministry of Educ
关键词
面向对象
程序设计语言
绑定时间分析技术
程序静态分析
binding time analysis
partial evaluation
object-oriented programming language
Java language