Precise concrete type inference for object-oriented languages

Concrete type information is invaluable for program optimization. The determination of concrete types in object-oriented languages is a flow sensitive global data flow problem. It is made difficult by dynamic dispatch (virtual function invocation) and first class functions (and selectors)—the very program structures for whose optimization its results are most critical. Previous work has shown that constraint-based type inference systems can be used to safely approximate concrete types [15], but their use can be expensive and their results imprecise. We present an incremental constraint-based type inference which produces precise concrete type information for a much larger class of programs at lower cost. Our algorithm extends the analysis in response to discovered imprecisions, guiding the analysis' effort to where it is most productive. This produces precise information at a cost proportional to the type complexity of the program. Many programs untypable by previous approaches or practically untypable due to computational expense, can be precisely analyzed by our new algorithm. Performance results, precision, and running time, are reported for a number of concurrent object-oriented programs. These results confirm the algorithm's precision and efficiency.

[1]  Robert Cartwright,et al.  Soft typing , 1991, PLDI '91.

[2]  Jong-Deok Choi,et al.  Automatic construction of sparse data flow evaluation graphs , 1991, POPL '91.

[3]  Ralph E. Johnson,et al.  A type system for Smalltalk , 1989, POPL '90.

[4]  Jens Palsberg,et al.  Making Type Inference Practical , 1992, ECOOP.

[5]  Bernhard Rytz,et al.  A Polyvariant Binding Time Analysis , 1992, PEPM.

[6]  John C. Mitchell,et al.  A lambda calculus of objects and method specialization , 1993, [1993] Proceedings Eighth Annual IEEE Symposium on Logic in Computer Science.

[7]  Jens Palsberg,et al.  Analysis of Objects with Dynamic and Multiple Inheritance , 1993 .

[8]  Robin Milner,et al.  Definition of standard ML , 1990 .

[9]  Alexander Aiken,et al.  Soft typing with conditional types , 1994, POPL '94.

[10]  Andrew A. Chien,et al.  Concurrent Aggregates: Supporting Modularity in Massively Parallel Programs , 1993 .

[11]  Jens Palsberg,et al.  Type Inference of SELF , 1993, ECOOP.

[12]  Peter Lee,et al.  Topics in advanced language implementation , 1991 .

[13]  Craig Chambers,et al.  Making pure object-oriented languages practical , 1991, OOPSLA 1991.

[14]  Norihisa Suzuki,et al.  Inferring types in Smalltalk , 1981, POPL '81.

[15]  Kim B. Bruce,et al.  Safe and decidable type checking in an object-oriented language , 1993, OOPSLA '93.

[16]  Randall B. Smith,et al.  Self: The power of simplicity , 1987, OOPSLA 1987.

[17]  Craig Chambers,et al.  Iterative type analysis and extended message splitting; optimizing dynamically-typed object-oriented programs , 1990, PLDI '90.

[18]  Jens Palsberg,et al.  Object-oriented type inference , 1991, OOPSLA 1991.