skip to main content
article
Open Access

Data descriptors: a compile-time model of data and addressing

Published:01 July 1987Publication History
Skip Abstract Section

Abstract

Data descriptors, which have evolved from Wilcox's value descriptors [16], are a notation for representing run-time data objects at compile time. One of the principal reasons for developing this notation was to aid in the rapid construction of code generators, especially for new microprocessors. Each data descriptor contains a base, a displacement, and a level of indirection. For example, a variable x lying at displacement 28 from base register B3 is represented by this data descriptor: @B3.28. The general form of a data descriptor is @kb.d.i where k gives the number of levels of indirection, b is a base, d is a displacement, and I is an index.

Data descriptors are convenient for representing addressing in Fortran (with static allocation and common blocks), in Pascal and Turing (with automatic allocation and stack frames), and in more general languages such as Euclid and PL/I. This generality of data descriptors allows code generation to be largely independent of the source language.

Data descriptors are able to encode the addressing modes of typical computer architectures such as the IBM 360 and the PDP-11. This generality of data descriptors allows code generation to be largely machine independent.

This paper gives a machine independent method of storage allocation that uses data descriptors. Techniques are given for local optimization of basic arithmetic and addressing code using data descriptors. Target machine dependencies are isolated so that the part of the code generator that handles high-level addressing (such as subscripting) is machine independent. The techniques described in this paper have proven effective in the rapid development of a number of production code generators.

References

  1. 1 CARTER, L.R. An analysis of Pascal programs and several block optimizations. Ph.D. dissertation, Dept. of Computer Science, University of Colorado, Boulder, 1980. Google ScholarGoogle Scholar
  2. 2 CORDY, J.R. An orthogonal model for code generation. Ph.D. dissertation, Report CSRI-177, Computer Systems Research Institute, University of Toronto, Toronto, Feb. 1985. Google ScholarGoogle Scholar
  3. 3 CORDY, J. R., AND HOLT, g.C. Specification of Concurrent Euclid. In Concurrent Euclid, the Unix System, and Tun/s, R. C. Holt, Ed. Addison-Wesley, Reading, Mass., 1983, 243-297.Google ScholarGoogle Scholar
  4. 4 CONWAY, R. W., AND WILCOX, T.R. Design and implementation of a diagnostic compiler for PL/I. Commun. ACM 16, 3 (Mar. 1973), 169-179. Google ScholarGoogle Scholar
  5. 5 HOLT, R.C. Data descriptors for use by the emitter. Euclid Working Paper 58, Toronto Euclid Workbook, Computer Systems Research Group, University of Toronto, Toronto, June 1978.Google ScholarGoogle Scholar
  6. 6 HOLT, R. C., AND CORDY, J. g. The Turing language report. Report CSRG-153, Computer Systems Research Group, University of Toronto, Toronto, Dec. 1983.Google ScholarGoogle Scholar
  7. 7 HOLT, R. C., AND HUME, J. N.P. Introduction to Computer Science Using the Turing Programruing Language. Reston, Reston, Va., 1984. Google ScholarGoogle Scholar
  8. 8 HOLT, R. C., AND WORTMAN, D.B. A model for implementing Euclid modules and prototypes. ACM Trans. Program. Lang. Syst. 4, 4 (Oct. 1982). Google ScholarGoogle Scholar
  9. 9 HOLT, R. C., WORTMAN, D. B., AND CORDY, J. R. S/SL: syntax/semantic language. ACM Trans. Program. Lang. Syst. 4, 2 (April 1982). Google ScholarGoogle Scholar
  10. 10 LEWIS, C. Some early results and documentation for Concurrent Euclid. Master's thesis, Dept. of Computer Science, University of Toronto, Toronto, 1982.Google ScholarGoogle Scholar
  11. 11 LOWRY, E. AND MEDLOCK, C. Object code optimization. Commun. ACM 12, I (Jan. 1969), 13-22. Google ScholarGoogle Scholar
  12. 12 MCCROSKY, C.D. Porting a syntax/semantic language compiler for Concurrent Euclid. Master's thesis, Computer Science Dept., Queen's University, Kingston, Canada, 1981.Google ScholarGoogle Scholar
  13. 13 MCKEEMAN, W. M., HORNING, J. J., AND WORTMAN, D.B. A Compiler Generator. Prentice- Hall, Englewood Cliffs, NJ, 1970.Google ScholarGoogle Scholar
  14. 14 SPINNEY, B. A technique for the construction of portable production quality code generators. Master's thesis, Dept. of Computer Science, University of Toronto, Toronto, 1981.Google ScholarGoogle Scholar
  15. 15 WAITE, W. M. AND GOOS, G. Compiler Construction. Springer-Verlag, New York, 1984. Google ScholarGoogle Scholar
  16. 16 WILCOX, T.R. Generating machine code for high-level programming languages. Ph.D. dissertation, Computer Science Dept., Cornell University, Ithaca, NY, 1971. Google ScholarGoogle Scholar
  17. 17 WIRTH, N. Design of a Pascal compiler. So{tw. Pract. Exper. 1, 4 (Oct-Dec. 1971), 309-333.Google ScholarGoogle Scholar
  18. 18 WULF, W., JOHNSSON, R. K., WEINSTOCK, C. B., HOE~S, S. O., AND GESCHKE, C.M. The Design o{ an Optimizing Compiler. Elsevier North-Holland, New York, 1975. Google ScholarGoogle Scholar

Index Terms

  1. Data descriptors: a compile-time model of data and addressing

        Recommendations

        Reviews

        Pani N. Chakrapani

        This paper presents and describes in detail, through a number of examples, a new notation called data descriptors for representing run-time data objects at compile time. The author points out that this notation helps in making the storage allocation and code generation phases of a compiler largely machine independent. The examples use Pascal for the source language and the machine codes of the IBM 360 and the PDP-11 for the target code. The data types of the Pascal language that have been represented using this notation are scalars, arrays, records, and pointers. The paper also points out the feasibility of local code optimization of basic arithmetic and addressing code when using this notation. Once the formal definition of the notation is understood, the rest of the material in the paper is easy to follow, provided the reader has had a good exposure to the compiler construction process. The presentation of the subject matter is done lucidly. It would have been more appropriate if some microprocessor had been used as the target machine, since the author claims that “one of the principle reasons for developing this notation was to aid in the rapid construction of code generators, especially for new microprocessors.” The usefulness of this notation, when data structures like strings, sets, and files are used in the source language, has not been considered.

        Access critical reviews of Computing literature here

        Become a reviewer for Computing Reviews.

        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 Transactions on Programming Languages and Systems
          ACM Transactions on Programming Languages and Systems  Volume 9, Issue 3
          July 1987
          166 pages
          ISSN:0164-0925
          EISSN:1558-4593
          DOI:10.1145/24039
          Issue’s Table of Contents

          Copyright © 1987 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 July 1987
          Published in toplas Volume 9, Issue 3

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader