Huang, W., A. Milanova, et al. (2012). Reim &
ReImInfer:checking and inference of reference immutability and
method purity. OOPSLA 879-896.
Reference immutability (引用不变性)ensures that a
reference is not used to modify the referenced object, and enables
the safe sharing of object structures. A pure method does not cause
side-effects on the objects that existed in the pre-state of the
method execution. Checking and inference of reference immutability
and method purity enables a variety of program analyses and
optimizations.
引用不变性:保证引用只是用来读取共享对象,而不去修改引用的对象。从而保证了安全地共享 对象 。
We present ReIm, a type system for reference immutability
(类型系统), and ReImInfer, a corresponding type inference
analysis(类型推导分析).
The type system is concise and context-sensitive. The type
inference analysis is precise and scalable, and requires no manual
annotations. In addition, we present a novel application
of the reference immutability type system: method purity inference
(方法纯度推导) .
我们提供了2种:
(1) 用于引用不变性的类型系统
(Relm):简洁和上下文敏感( concise and
context-sentitive)
(2)类型推导分析(ReIm
Infer):准确和可扩展(precise and scable)
To support our theoretical results, we implemented the type system
and the type inference analysis for Java. We include a type checker
to verify the correctness of the inference
result. Empirical results on Java applications and libraries of up
to 348kLOC show that our approach achieves both scalability and
precision.
我们实现了用于Java的类型系统和类型推导分析。