Compile-time analysis of object-oriented programs

  • Jan Vitek
  • R. Nigel Horspool
  • James S. Uhl
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 641)

Abstract

Generation of efficient code for object-oriented programs requires knowledge of object lifetimes and method bindings. For object-oriented languages that have automatic storage management and dynamic look-up of methods, the compiler must obtain such knowledge by performing static analysis of the source code. We present an analysis algorithm which discovers the potential classes of each object in an object-oriented program as well as a safe approximation of their lifetimes. These results are obtained using abstract domains that approximate memory configurations and interprocedural call patterns of the program. We present several alternatives for these abstract domains that permit a trade-off between accuracy and complexity of the overall analysis.

References

  1. 1.
    A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques and Tools. Addison-Wesley, 1986.Google Scholar
  2. 2.
    C. D. Chambers. The Design and Implementation of the Self Compiler, an Optimizing Compiler for Object-Oriented Languages. Ph. D. Thesis, Stanford University, 1992.Google Scholar
  3. 3.
    D. R. Chase, M. Wegman, and F. K. Zadeck. Analysis of Pointers and Structures. In SIGPLAN'90 Conf. on Programming Language Design and Implementation, 1990.Google Scholar
  4. 4.
    P. Cousot and R. Cousot. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Program by Construction or Approximation of Fixpoints. In Conf. Rec. of the 4th ACM Symp. on Principles of Programming Languages, 1977.Google Scholar
  5. 5.
    A. Goldberg and G. Robson. Smalltalk-80 — The Language and its Implementation. Addison-Wesley, 1983.Google Scholar
  6. 6.
    L. Harrison. The Interprocedural Analysis and Automatic Parallelization of Scheme Programs. Technical Report CSRD Rpt. 860, University of Illinois, Urbana, Ill., 1989.Google Scholar
  7. 7.
    A. V. Hense. Type Inference for O'small. Technischer Bericht A 06/91, Universität des Saarlandes, 1991.Google Scholar
  8. 8.
    R. N. Horspool and J. Vitek. Static Analysis of PostScript. In Proceeding of the International Conference on Computer Languages, 1992.Google Scholar
  9. 9.
    P. Hudak. A Semantic Model of Reference Counting and its Abstraction. In Abstract Interpretation of Declarative Languages. Ellis Horwood, 1987.Google Scholar
  10. 10.
    R. E. Johnson. Type-checking Smalltalk. In OOPSLA '86 Conf. Proc., 1986.Google Scholar
  11. 11.
    J. Palsberg and M. I. Schwartzbach. Object-Oriented Type Inference. In OOPSLA'91 Conf. Proc., 1991.Google Scholar
  12. 12.
    M. Sharir and A. Pnueli. Two Approaches to Interprocedural Data Flow Analysis. In S. S. Munchnick and N. D. Jones, editors, Program Flow Analysis: Theory and Applications. Prentice-Hall, 1981.Google Scholar
  13. 13.
    N. Suzuki. Inferring Types in Smalltalk. In Conf. Rec. of the 8th ACM Symp. on Principles of Programming Languages, 1981.Google Scholar

Copyright information

© Springer-Verlag 1992

Authors and Affiliations

  • Jan Vitek
    • 1
  • R. Nigel Horspool
    • 1
  • James S. Uhl
    • 1
  1. 1.Depatrment of Computer ScienceUniversity of VictoriaVictoriaCanada

Personalised recommendations