skip to main content
10.1145/3594671.3594673acmotherconferencesArticle/Chapter ViewAbstractPublication PagesprogrammingConference Proceedingsconference-collections
research-article

Threaded Execution as a Dual to Native Code

Published: 12 September 2023 Publication History

Abstract

Threaded execution has been used as a higher performance alternative to a byte-code interpreter, by utilizing hardware dispatch to replace software interpreter dispatch.
Traditional JIT code is compiled from byte-code to native code for the current machine, with an even higher performance result. Unfortunately, when debugging is required for a method, most JIT-based interpreters discard the JIT code and revert to the byte-code interpreter. Additionally, switching between interpreted code and native code requires clever trampolines to bring the models into alignment.
We describe a technique that maintains the threaded code and native code as parallel implementations of the program. This provides seamless transitions between the implementations and supports full debugging, while providing near full native execution performance.

References

[1]
A. W. Appel and T. Jim. 1989. Continuation-Passing, Closure-Passing Style. In Proceedings of the 16th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Austin, Texas, USA) (POPL ’89). Association for Computing Machinery, New York, NY, USA, 293–302. https://doi.org/10.1145/75277.75303
[2]
Aurèle Barrière, Sandrine Blazy, Olivier Flückiger, David Pichardie, and Jan Vitek. 2021. Formally Verified Speculation and Deoptimization in a JIT Compiler. Proc. ACM Program. Lang. 5, POPL, Article 46 (Jan. 2021), 26 pages. https://doi.org/10.1145/3434327
[3]
James Bell. 1973. Threaded code. Commun. ACM 16, 6 (1973), 370–372.
[4]
Robert Dewar. 1975. Indirect threaded code. Commun. ACM 18, 6 (1975), 330–331.
[5]
Etienne M. Gagnon and Laurie J. Hendren. 2001. SableVM: A Research Framework for the Efficient Execution of Java Bytecode. In Java (TM) Virtual Machine Research and Technology Symposium (JVM 01). USENIX Association, Monterey, CA. https://www.usenix.org/conference/jvm-01/sablevm-research-framework-efficient-execution-java-bytecode
[6]
Tim Hartley, Foivos S. Zakkak, Andy Nisbet, Christos Kotselidis, and Mikel Luján. 2022. Just-In-Time Compilation on ARM—A Closer Look at Call-Site Code Consistency. ACM Trans. Archit. Code Optim. 19, 4, Article 54 (Sept. 2022), 23 pages. https://doi.org/10.1145/3546568
[7]
Andrew Kelly. 2022. Zig. Retrieved 2022-11-10 from https://ziglang.org/
[8]
Paul Klint. 1981. Interpretation Techniques. Software: Practice and Experience 11 (1981). https://doi.org/10.1002/spe.4380110908
[9]
Eliot Miranda. 1987. BrouHaHa- A Portable Smalltalk Interpreter. SIGPLAN Not. 22, 12 (Dec. 1987), 354–365. https://doi.org/10.1145/38807.38839
[10]
Elliot Miranda. 1991. Portable Fast Direct Threaded Code. Retrieved 2022-11-10 from https://compilers.iecc.com/comparch/article/91-03-121
[11]
Charles H. Moore. 1974. FORTH: a new Way to Program a Mini Computer. Astronomy and Astrophysics Supplement 15 (1974), 497–511.
[12]
Ian Piumarta and Fabio Riccardi. 1998. Optimizing Direct Threaded Code by Selective Inlining. SIGPLAN Not. 33, 5 (May 1998), 291–300. https://doi.org/10.1145/277652.277743
[13]
Elizabeth D. Rather, Donald R. Colburn, and Charles H. Moore. 1993. The evolution of Forth. In History of Programming Languages II. 177–199.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
Programming '23: Companion Proceedings of the 7th International Conference on the Art, Science, and Engineering of Programming
March 2023
134 pages
ISBN:9798400707551
DOI:10.1145/3594671
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 the author(s) 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: 12 September 2023

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. execution model
  2. threaded execution

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

<Programming> '23 Companion

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 25
    Total Downloads
  • Downloads (Last 12 months)25
  • Downloads (Last 6 weeks)6
Reflects downloads up to 14 Sep 2024

Other Metrics

Citations

Cited By

View all

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media