skip to main content
10.1145/207110.207165acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article
Free Access

Stack caching for interpreters

Authors Info & Claims
Published:01 June 1995Publication History

ABSTRACT

An interpreter can spend a significant part of its execution time on accessing arguments of virtual machine instructions. This paper explores two methods to reduce this overhead for virtual stack machines by caching top-of-stack values in (real machine) registers. The dynamic method is based on having, for every possible state of the cache, one specialized version of the whole interpreter; the execution of an instruction usually changes the state of the cache and the next instruction is executed in the version corresponding to the new state. In the static method a state machine that keeps track of the cache state is added to the compiler. Common instructions exist in specialized versions for several states, but it is not necessary to have a version of every instruction for every cache state. Stack manipulation instructions are optimized away.

References

  1. Bel73.James R. Bell. Threaded code. Communications of the A CM, 16(6):370-372, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Bla77.Russell P. Blake. Exploring a stack architecture, iEEE Computer, 10(5):30-39, May 1977.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. cc.comp. compilers. Usenet Newsgroup; archives available from ftp://primost, cs. wisc.edu.Google ScholarGoogle Scholar
  4. DM82.David R. Ditzel and H. R. McLellan. Register allocation for free: The C machine stack cache. In Symposium on Architectural Support/or Programming Languages and Systems, pages 48-56, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. DV90.Eddy H. Debaere and Jan M. Van Campenhout. Interpretation and Instruction Path Coprocessing. The MIT Press, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. FHP91.Christopher W. Fraser, Robert R. Henry, and Todd A. Proebsting. BURG Fast Optimal Instruction Selection and Tree Parsing, 1991. Available via anonymous ftp from kaese.cs.wisc.edu, file pub/burg, shar. Z.Google ScholarGoogle Scholar
  7. HFWZ87.John R. Hayes, Martin E. Fraeman, Robert L. Williams, and Thomas Zaremba. An architecture for the direct execution of the Forth programming language. In Architectural Support/or Programming Languages and Operating Systems (ASPLOS- II), pages 42-48, 1987. Google ScholarGoogle Scholar
  8. HL89.John Hayes and Susan Lee. The architecture of the SC32 Forth engine. Journal o/ Forth Application and Research, 5(4):493- 5O6, 1989.Google ScholarGoogle Scholar
  9. HP90.John L. Hennessy and David A. Patterson. Computer Architecture. A Quantitative Approach. Morgan Kaufman Publishers, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. HS85.Makoto Hasekawa and Yoshiharu Shigei. High-speed top-of-stack scheme for interpreters: A management algorithm and its analysis. In International Symposium on Computer Archictecture (ISCA), pages 48- 54, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Kli81.Paul Klint. Interpretation techniques. Software--Practice and Experience, 11:963- 973, 1981.Google ScholarGoogle ScholarCross RefCross Ref
  12. Koo89.Philip J. Koopman, Jr. Stack Computers. Ellis Horwood Limited, 1989.Google ScholarGoogle Scholar
  13. Kra83.Glen Krasner, editor. Smalltalk-80: Bits of History, Words o/Advice. Addison-Wesley, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Pit87.Thomas Pittman. Two-level hybrid interpreter/native code execution for combined space-time efficiency. In Symposium on interpreters and Interpretive Techniques (SIGPLAN '87), pages 150-152, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. PLG88.Eduardo Pelegrf-Llopart and Susan L. Graham. Optimal code generation for expression trees: An application of the BURS theory. In Fifteenth Annual A CM Symposium on Principles o/Programming Languages, pages 294-308, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Stack caching for interpreters

      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
      • Published in

        cover image ACM Conferences
        PLDI '95: Proceedings of the ACM SIGPLAN 1995 conference on Programming language design and implementation
        June 1995
        335 pages
        ISBN:0897916972
        DOI:10.1145/207110

        Copyright © 1995 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 June 1995

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        PLDI '95 Paper Acceptance Rate28of105submissions,27%Overall Acceptance Rate406of2,067submissions,20%

        Upcoming Conference

        PLDI '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader