skip to main content
10.1145/2633448.2633450acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article
Open Access

BEAMJIT: a just-in-time compiling runtime for Erlang

Authors Info & Claims
Published:03 September 2014Publication History

ABSTRACT

BEAMJIT is a tracing just-in-time compiling runtime for the Erlang programming language. The core parts of BEAMJIT are synthesized from the C source code of BEAM, the reference Erlang abstract machine. The source code for BEAM's instructions is extracted automatically from BEAM's emulator loop. A tracing version of the abstract machine, as well as a code generator are synthesized. BEAMJIT uses the LLVM toolkit for optimization and native code emission. The automatic synthesis process greatly reduces the amount of manual work required to maintain a just-in-time compiler as it automatically tracks the BEAM system. The performance is evaluated with HiPE's, the Erlang ahead-of-time native compiler, benchmark suite. For most benchmarks BEAMJIT delivers a performance improvement compared to BEAM, although in some cases, with known causes, it fails to deliver a performance boost. BEAMJIT does not yet match the performance of HiPE mainly because it does not yet implement Erlang specific optimizations such as boxing/unboxing elimination and a deep understanding of BIFs. Despite this BEAMJIT, for some benchmarks, reduces the runtime with up to 40%.

References

  1. D. Anderson. IonMonkey in Firefox 18. https://blog.mozilla.org/javascript/2012/09/12/ionmonkey-in-firefox-18/, 2012. Visited May 2014.Google ScholarGoogle Scholar
  2. J. Aycock. A Brief History of Just-in-time. ACM Comput. Surv., 35 (2): 97--113, June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: A Transparent Dynamic Optimization System. SIGPLAN Not., 35 (5): 1--12, May 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. Bebenita, F. Brandner, M. Fahndrich, F. Logozzo, W. Schulte, N. Tillmann, and H. Venter. SPUR: A Trace-based JIT Compiler for CIL. SIGPLAN Not., 45 (10): 708--725, Oct. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. J. R. Bell. Threaded code. Commun. ACM, 16 (6): 370--372, June 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Bezanson, S. Karpinski, V. B. Shah, and A. Edelman. Julia: A Fast Dynamic Language for Technical Computing. http://arxiv.org/abs/1209.5145, 2012. Visited May 2014.Google ScholarGoogle Scholar
  7. M. Chang, E. Smith, R. Reitmaier, M. Bebenita, A. Gal, C. Wimmer, B. Eich, and M. Franz. Tracing for Web 3.0: Trace Compilation for the Next Generation Web Applications. In Proceedings of the 2009 ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments, VEE '09, pages 71--80. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. B. Cheng and B. Buzbee. A JIT Compiler for Android's Dalvik VM. http://dl.google.com/googleio/2010/android-jit-compiler-androids-dalvik-vm.pdf, 2010. Visited May 2014.Google ScholarGoogle Scholar
  9. M. Fulton and M. Stoodley. Compilation techniques for real-time java programs. In Proceedings of the International Symposium on Code Generation and Optimization, CGO '07, pages 221--231. IEEE Computer Society, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. A. Gal, C. W. Probst, and M. Franz. HotpathVM: An Effective JIT Compiler for Resource-constrained Devices. In Proceedings of the 2Nd International Conference on Virtual Execution Environments, VEE '06, pages 144--153. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. GNU. GNU lightning 2.0. https://www.gnu.org/software/lightning/, 2013. Visited May 2014.Google ScholarGoogle Scholar
  12. N. Grcevski, A. Kielstra, K. Stoodley, M. G. Stoodley, and V. Sundaresan. Java just-in-time compiler and virtual machine improvements for server and middleware applications. In Virtual Machine Research and Technology Symposium, pages 151--162. USENIX, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. Häubl and H. Mössenböck. Trace-based Compilation for the Java HotSpot Virtual Machine. In Proceedings of the 9th International Conference on Principles and Practice of Programming in Java, PPPJ '11, pages 129--138. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. H. Inoue, H. Hayashizaki, P. Wu, and T. Nakatani. A trace-based java jit compiler retrofitted from a method-based compiler. In Proceedings of the 9th Annual IEEE/ACM International Symposium on Code Generation and Optimization, CGO '11, pages 246--256. IEEE Computer Society, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. T. Kotzmann, C. Wimmer, H. Mössenböck, T. Rodriguez, K. Russell, and D. Cox. Design of the Java HotSpot&Trade; Client Compiler for Java 6. ACM Trans. Archit. Code Optim., 5 (1): 7:1--7:32, May 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. C. Lattner and V. Adve. LLVM: a compilation framework for lifelong program analysis transformation. In CGO 2004. International Symposium on Code Generation and Optimization, 2004, pages 75--86, March 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. Malcolm. Just-In-Time Compilation (libgccjit.so). http://gcc.gnu.org/wiki/JIT, 2013. Visited May 2014.Google ScholarGoogle Scholar
  18. J. McCarthy. Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I. Commun. ACM, 3 (4): 184--195, Apr. 1960. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Microsoft. Common Language Runtime (CLR) 4.5. http://msdn.microsoft.com/en-us/library/k5532s8a#running_code, 2012. Visited May 2014.Google ScholarGoogle Scholar
  20. K. Millikin and F. Schneider. A New Crankshaft for V8. http://blog.chromium.org/2010/12/new-crankshaft-for-v8.html, 2010. Visited May 2014.Google ScholarGoogle Scholar
  21. E. Miranda. Build me a JIT as fast as you can... http://www.mirandabanda.org/cogblog/2011/03/01/build-me-a-jit-as-fast-as-you-can/, 2011. Visited May 2014.Google ScholarGoogle Scholar
  22. M. Pall. LuaJIT 2.0. http://luajit.org/luajit.html, 2014. Visited May 2014.Google ScholarGoogle Scholar
  23. M. Pettersson, K. F. Sagonas, and E. Johansson. The HiPE/x86 Erlang Compiler: System Description and Performance Evaluation. In Proceedings of the 6th International Symposium on Functional and Logic Programming, FLOPS '02, pages 228--244. Springer-Verlag, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. A. Rigo and S. Pedroni. PyPy's Approach to Virtual Machine Construction. In Companion to the 21st ACM SIGPLAN Symposium on Object-oriented Programming Systems, Languages, and Applications, OOPSLA '06, pages 944--953. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. K. Sagonas, C. Stavrakakis, and Y. Tsiouris. Erllvm: An llvm backend for erlang. In Proceedings of the Eleventh ACM SIGPLAN Erlang Workshop. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. T. Schilling. Trace-based Just-in-time Compilation for Lazy Functional Programming Languages. PhD thesis, School of Computing, University of Kent at Canterbury, April 2013.Google ScholarGoogle Scholar
  27. K. K. Thorup. Erjang: A virtual machine for erlang which runs on java. http://github.com/trifork/erjang/wiki. Visited May 2014.Google ScholarGoogle Scholar

Index Terms

  1. BEAMJIT: a just-in-time compiling runtime for Erlang

    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
      Erlang '14: Proceedings of the Thirteenth ACM SIGPLAN workshop on Erlang
      September 2014
      84 pages
      ISBN:9781450330381
      DOI:10.1145/2633448

      Copyright © 2014 Owner/Author

      Permission to make digital or hard copies of part or all 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 third-party components of this work must be honored. For all other uses, contact the Owner/Author.

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 3 September 2014

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Erlang '14 Paper Acceptance Rate9of14submissions,64%Overall Acceptance Rate51of68submissions,75%

      Upcoming Conference

      ICFP '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader