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

Stack caching for interpreters

Published: 01 June 1995 Publication 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]
James R. Bell. Threaded code. Communications of the A CM, 16(6):370-372, 1973.
[2]
Russell P. Blake. Exploring a stack architecture, iEEE Computer, 10(5):30-39, May 1977.
[3]
comp. compilers. Usenet Newsgroup; archives available from ftp://primost, cs. wisc.edu.
[4]
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.
[5]
Eddy H. Debaere and Jan M. Van Campenhout. Interpretation and Instruction Path Coprocessing. The MIT Press, 1990.
[6]
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.
[7]
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.
[8]
John Hayes and Susan Lee. The architecture of the SC32 Forth engine. Journal o/ Forth Application and Research, 5(4):493- 5O6, 1989.
[9]
John L. Hennessy and David A. Patterson. Computer Architecture. A Quantitative Approach. Morgan Kaufman Publishers, 1990.
[10]
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.
[11]
Paul Klint. Interpretation techniques. Software--Practice and Experience, 11:963- 973, 1981.
[12]
Philip J. Koopman, Jr. Stack Computers. Ellis Horwood Limited, 1989.
[13]
Glen Krasner, editor. Smalltalk-80: Bits of History, Words o/Advice. Addison-Wesley, 1983.
[14]
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.
[15]
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.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 June 1995

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

PLDI95
Sponsor:

Acceptance Rates

PLDI '95 Paper Acceptance Rate 28 of 105 submissions, 27%;
Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)573
  • Downloads (Last 6 weeks)61
Reflects downloads up to 26 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media