skip to main content
article
Free Access

Precise concrete type inference for object-oriented languages

Authors Info & Claims
Published:01 October 1994Publication History
Skip Abstract Section

Abstract

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.

References

  1. 1 O. Agesen, J. Palsberg, and M. Schwartzbach. Type inference of SELF: Analysis of objects with dynamic and multiple inheritance. In Proceedings of ECOOP '93, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2 Ole Agesen. Personal communication, 1993.Google ScholarGoogle Scholar
  3. 3 Alexander Aiken, Edward L. Wimmers, and T. K. Lakshman. Soft typing with conditional types. In Twenty Firs~ Symposium on Principles of Programming Languages, pages 151-162, Portland, Oregon, January 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4 Kim B. Bruce, Jon Crabtree, Thomas P. Murtagh, and Robert van Gent. Safe and decidable type checking in an object-oriented language. In Proceedings of OOPSLA '93, pages 29-46, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5 Robert Cartwright and Mike Fagan. Soft typing. In Proceedings of the ACM SIGPLAN '91 Conference on Programming Language Design and Implementation, pages 278-292, Ontario, Canada, June 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6 C. Chambers and D. Ungar. Customization: Optimizing compiler technology for SELF, a dynamically-typed object-oriented programming language. In Proceedings of SIGPLAN Conference on Programming Language Design and Implementation, pages 146-60, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7 C. Chambers and D. Ungar. Iterative type analysis and extended message splitting. In Proceedings of the SIGPI, AN Conference on Programming ;Language Design and Implementation, pages 150-60, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8 C. Chambers and D. Ungar. Making pure objectoriented languages practical. In OOPSLA '91 Conference Proceedings, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9 Andrew A. Chien. Concurrent Aggregates: Supporting Modularity in Massively.Parallel Programs. MIT Press, Cambridge, MA, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10 Andrew A. Chien, Vijay Karamcheti, John Plevyak, and Xingbin Zhang. Concurrent aggregates language report 2.0. Available via anonymous ftp from cs.uiuc.edu in /pub/csag or from http://www-csag.cs.uiuc.edu/, September 1993.Google ScholarGoogle Scholar
  11. 11 J. Choi, R. Cytron, and J. Ferrante. Automatic construction of sparse dataflow evaluation graphs. In Proceedings of the A CM Symposium on Principles of Programming Languages, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12 J. Graver and R. Johnson. A type system for smalltalk, in Proceedings of POPL, pages 136-150, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13 Robin Milner, Marls Torte, and Robert Harper. The Definition of Standard ML. The MIT Press, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14 John C. Mitchell, Furio Honsell, and Kathleen Fisher. A lambda calculus of objects and method specialization. In 1993 IEEE Symposium on Logic in Computer Science, pages 26-38, June 1993.Google ScholarGoogle ScholarCross RefCross Ref
  15. 15 N. Oxhoj, J. Palsberg, and M. Schwartzbach. Making type inference practical. In Proceedings of OOPSLA '92, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 16 J. Palsberg and M. Schwartzbach. Object-oriented type inference. In Proceedings of OOPSLA '91, pages 146-61, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17 John Plevyak and Andrew Chien. Precise objectoriented type inference and its use in program optimization. To be issued as a technical report, 1994.Google ScholarGoogle Scholar
  18. 18 Bernhard Rytz and Marc Gengler. A polyvariant binding time analysis. Technical Report YALEU/DCS/RR-909, Yale University, Department of Computer Science, 1992. Proceedings of the 1992 ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation.Google ScholarGoogle Scholar
  19. 19 Olin Shivers. Topics in Advanced Language Implementation, chapter Data-Flow Analysis and Type Recovery in Scheme, pages 47-88. MIT Press, Cambridge, MA, 1991.Google ScholarGoogle Scholar
  20. 20 Norihisa Suzuki. Inferring types in Smalltalk. In Eighth Symposium on Principles of Programming Languages, pages 187-199, January 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 21 Thinking Machines Corporation, Cambridge, Massachusetts. CM-5 Technical Summary, October 1991.Google ScholarGoogle Scholar
  22. 22 David Ungar and Randall B. Smith. SELF: The power of simplicity. In Proceedings of OOPSLA '87, pages 227-41. ACM SIGPLAN, ACM Press, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Precise concrete type inference for object-oriented languages

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 29, Issue 10
        Oct. 1994
        473 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/191081
        Issue’s Table of Contents
        • cover image ACM Conferences
          OOPSLA '94: Proceedings of the ninth annual conference on Object-oriented programming systems, language, and applications
          October 1994
          476 pages
          ISBN:0897916883
          DOI:10.1145/191080

        Copyright © 1994 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 October 1994

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader