Skip to main content

STRAF: A Scala Framework for Experiments in Trace-Based JIT Compilation

  • Conference paper
  • First Online:
Book cover Grand Timely Topics in Software Engineering (GTTSE 2015)

Abstract

We introduce straf, a Scala framework for recording and optimizing execution traces of an interpreter it is composed with. For interpreters that satisfy the requirements detailed in this paper, this composition requires but a small effort from the implementer to result in a trace-based JIT compiler. We describe the framework, and illustrate its composition with a Scheme interpreter that satisfies the aforementioned requirements. We benchmark the resulting trace-based JIT compiler on a set of Scheme programs. Finally, we implement an optimization to demonstrate that straf enables further experimentation in the domain.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://github.com/mvdcamme/scala-am/blob/master/src/main/scala/tracing/SchemeTraceOptimizer.scala.

  2. 2.

    https://github.com/mvdcamme/scala-am/blob/master/src/main/scala/tracing/SchemeTracer.scala.

References

  1. Bolz, C.F., Cuni, A., Fijalkowski, M., Rigo, A.: Tracing the meta-level: Pypy’s tracing JIT compiler. In: Proceedings of the 4th ICOOOLPS Workshop (2009)

    Google Scholar 

  2. Chang, M., Bebenita, M., Yermolovich, A., Gal, A., Franz, M.: Efficient just-in-time execution of dynamically typed languages via code specialization using precise runtime type inference. Technical report ICS-TR-07-10, University of Irvine, Department of Computer Science (2007)

    Google Scholar 

  3. Chang, M., Smith, E., Reitmaier, R., Bebenita, M., Gal, A., Wimmer, C., Eich, B., Franz, M.: Tracing for web 3.0: trace compilation for the next generation web applications. In: Proceedings of the 2009 ACM SIGPLAN/SIGOPS International VEE Conference (2009)

    Google Scholar 

  4. Corporation, N.: Constant folding. http://www.compileroptimizations.com/category/constant_folding.htm. Accessed 24 May 2016

  5. Felleisen, M., Friedman, D.P.: Control Operators, the SECD-machine, and the \(\lambda \)-calculus. Indiana University, Computer Science Department (1986)

    Google Scholar 

  6. Felleisen, M., Friedman, D.P.: A calculus for assignments in higher-order languages. In: Proceedings of the 14th ACM SIGACT-SIGPLAN POPL Symposium (1987)

    Google Scholar 

  7. Gal, A., Eich, B., Shaver, M., Anderson, D., Mandelin, D., Haghighat, M.R., Kaplan, B., Hoare, G., Zbarsky, B., Orendorff, J., Ruderman, J., Smith, E.W., Reitmaier, R., Bebenita, M., Chang, M., Franz, M.: Trace-based just-in-time type specialization for dynamic languages. In: Proceedings of the 30th ACM SIGPLAN PLDI Conference (2009)

    Google Scholar 

  8. Gal, A., Probst, C.W., Franz, M.: Hotpathvm: an effective JIT compiler for resource-constrained devices. In: Proceedings of the 2nd International VEE Conference (2006)

    Google Scholar 

  9. Marr, S., Ducasse, S.: Tracing vs. partial evaluation: comparing meta-compilation approaches for self-optimizing interpreters. In: Proceedings of the 2015 ACM International OOPSLA Conference (2015)

    Google Scholar 

  10. Stiévenart, Q., Nicolay, J., De Meuter, W., De Roover, C.: Building a modular static analysis framework in scala (tool paper). In: Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala, SCALA 2016, NY, USA, pp. 105–109 (2016). http://doi.acm.org/10.1145/2998392.3001579

  11. Vandercammen, M., De Roover, C.: Improving trace-based JIT optimisation using whole-program information. In: Proceedings of the 8th International Workshop on Virtual Machines and Intermediate Languages, VMIL 2016, NY, USA, pp. 16–23 (2016). http://doi.acm.org/10.1145/2998415.2998418

  12. Vandercammen, M., Nicolay, J., Marr, S., De Koster, J., D’Hondt, T., De Roover, C.: A formal foundation for trace-based JIT compilers. In: Proceedings of the 13th WODA (2015)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Maarten Vandercammen .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Cite this paper

Vandercammen, M., Stiévenart, Q., De Meuter, W., De Roover, C. (2017). STRAF: A Scala Framework for Experiments in Trace-Based JIT Compilation. In: Cunha, J., Fernandes, J., Lämmel, R., Saraiva, J., Zaytsev, V. (eds) Grand Timely Topics in Software Engineering. GTTSE 2015. Lecture Notes in Computer Science(), vol 10223. Springer, Cham. https://doi.org/10.1007/978-3-319-60074-1_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-60074-1_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-60073-4

  • Online ISBN: 978-3-319-60074-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics