skip to main content
10.1145/2843915.2843924acmotherconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Towards reducing the need for algorithmic primitives in dynamic language VMs through a tracing JIT

Published: 04 July 2015 Publication History

Abstract

When implementing virtual machines, besides the interpreter and optimization facilities, we have to include a set of primitive functions that the client language can use. Some of these implement truly primitive behavior, such as arithmetic operations. Other primitive functions, which we call algorithmic primitives, are expressible in the client language, but are implemented in the vm to improve performance.
However, having many primitives in the vm makes it harder to maintain them, or re-use them in alternative vm implementations for the same language. With the advent of efficient tracing just-in-time compilers we believe the need for algorithmic primitives to be much diminished, allowing more of them to be implemented in the client language.
In this work, we investigate the trade-offs when creating primitives, and in particular how large a difference remains between primitive and client function run times in vms with tracing just-in-time compiler. To that end, we extended the RSqueak/VM, a vm for Squeak/Smalltalk written in RPython. We compare primitive implementations in C, RPython, and Smalltalk, showing that due to the tracing JIT the performance gap can be significantly reduced.

References

[1]
V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: a transparent dynamic optimization system. In ACM SIGPLAN Notices, volume 35, pages 1--12. ACM, 2000.
[2]
C. F. Bolz and L. Tratt. The impact of meta-tracing on VM design and implementation. Science of Computer Programming, 98:408--421, 2013. ISSN 0167-6423.
[3]
C. F. Bolz, A. Kuhn, A. Lienhard, N. Matsakis, O. Nierstrasz, L. Renggli, A. Rigo, and T. Verwaest. Back to the future in one week---implementing a smalltalk vm in pypy. In R. Hirschfeld and K. Rose, editors, Self-Sustaining Systems, volume 5146 of Lecture Notes in Computer Science, pages 123--139. Springer Berlin Heidelberg, 2008. ISBN 978-3-540-89274-8.
[4]
C. F. Bolz, A. Cuni, M. Fijałkowski, and A. Rigo. Tracing the meta-level: PyPy's tracing JIT compiler. In Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, ICOOOLPS '09, pages 18--25. ACM, 2009. ISBN 978-1-60558-541-3.
[5]
C. F. Bolz, L. Diekmann, and L. Tratt. Storage strategies for collections in dynamically typed languages. In ACM SIGPLAN Notices, volume 48, pages 167--182. ACM, 2013.
[6]
C. Chambers, D. Ungar, and E. Lee. An efficient implementation of SELF, a dynamically-typed object-oriented language based on prototypes. SIGPLAN Not., 24(10):49--70, Sept. 1989. ISSN 0362-1340.
[7]
A. C. Davison and D. V. Hinkley. Bootstrap Methods and Their Application, chapter 5. Cambridge, 1997.
[8]
B. Freudenberg, D. H. H. Ingalls, T. Felgentreff, T. Pape, and R. Hirschfeld. SqueakJS: a modern and practical Smalltalk that runs in any browser. In Proceedings of the 10th ACM Symposium on Dynamic Languages, DLS '14, pages 57--66, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-3211-8.
[9]
A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. SIGPLAN Not., 44(6):465--478, June 2009. ISSN 0362-1340.
[10]
A. Goldberg and D. Robson. Smalltalk-80: The Language and Its Implementation. Addison-Wesley, 1983. ISBN 0-201-11371-6.
[11]
L. J. Guibas and J. Stolfi. A language for bitmap manipulation. ACM Trans. Graph., 1(3):191--214, July 1982. ISSN 0730-0301.
[12]
U. Hölzle. Adaptive optimization for SELF: reconciling high performance with exploratory programming. Technical report, Stanford University, 1995.
[13]
D. H. H. Ingalls, T. Kaehler, J. Maloney, S. Wallace, and A. Kay. Back to the future: the story of Squeak, a practical Smalltalk written in itself. SIGPLAN Not., 32(10):318--326, Oct. 1997. ISSN 0362-1340.
[14]
S. Marr. Supporting Concurrency Abstractions in High-level Language Virtual Machines. PhD thesis, Software Languages Lab, Vrije Universiteit Brussel, Pleinlaan 2, B-1050 Brussels, Belgium, 2013.
[15]
National Institute of Standards and Technology. FIPS PUB 180-1: Secure Hash Standard. National Institute for Standards and Technology, Gaithersburg, MD, USA, Apr. 1995. URL http://www.itl.nist.gov/fipspubs/fip180-1.htm.
[16]
National Institute of Standards and Technology. FIPS PUB 186-2: Digital Signature Standard (DSS). National Institute for Standards and Technology, Gaithersburg, MD, USA, Jan. 2000. URL http://www.itl.nist.gov/fipspubs/fip186-2.pdf.
[17]
B. Schneier. Applied Cryptography: Protocols, algorithms, and source code in C. John Wiley & Sons, 1996.
[18]
C. Wimmer, M. Haupt, M. L. Van De Vanter, M. Jordan, L. Daynès, and D. Simon. Maxine: An approachable virtual machine for, and in, java. ACM Trans. Archit. Code Optim., 9 (4):30:1--30:24, Jan. 2013. ISSN 1544-3566.

Cited By

View all

Index Terms

  1. Towards reducing the need for algorithmic primitives in dynamic language VMs through a tracing JIT

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    ICOOOLPS '15: Proceedings of the 10th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems
    July 2015
    51 pages
    ISBN:9781450336574
    DOI:10.1145/2843915
    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: 04 July 2015

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Squeak/Smalltalk
    2. algorithmic primitives
    3. tracing JIT

    Qualifiers

    • Research-article

    Conference

    ECOOP '15

    Acceptance Rates

    Overall Acceptance Rate 11 of 14 submissions, 79%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 64
      Total Downloads
    • Downloads (Last 12 months)3
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 08 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media