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%.
- D. Anderson. IonMonkey in Firefox 18. https://blog.mozilla.org/javascript/2012/09/12/ionmonkey-in-firefox-18/, 2012. Visited May 2014.Google Scholar
- J. Aycock. A Brief History of Just-in-time. ACM Comput. Surv., 35 (2): 97--113, June 2003. Google ScholarDigital Library
- V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: A Transparent Dynamic Optimization System. SIGPLAN Not., 35 (5): 1--12, May 2000. Google ScholarDigital Library
- 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 ScholarDigital Library
- J. R. Bell. Threaded code. Commun. ACM, 16 (6): 370--372, June 1973. Google ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- GNU. GNU lightning 2.0. https://www.gnu.org/software/lightning/, 2013. Visited May 2014.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- D. Malcolm. Just-In-Time Compilation (libgccjit.so). http://gcc.gnu.org/wiki/JIT, 2013. Visited May 2014.Google Scholar
- J. McCarthy. Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I. Commun. ACM, 3 (4): 184--195, Apr. 1960. Google ScholarDigital Library
- Microsoft. Common Language Runtime (CLR) 4.5. http://msdn.microsoft.com/en-us/library/k5532s8a#running_code, 2012. Visited May 2014.Google Scholar
- 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 Scholar
- 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 Scholar
- M. Pall. LuaJIT 2.0. http://luajit.org/luajit.html, 2014. Visited May 2014.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- K. K. Thorup. Erjang: A virtual machine for erlang which runs on java. http://github.com/trifork/erjang/wiki. Visited May 2014.Google Scholar
Index Terms
- BEAMJIT: a just-in-time compiling runtime for Erlang
Recommendations
ErLLVM: an LLVM backend for Erlang
Erlang '12: Proceedings of the eleventh ACM SIGPLAN workshop on Erlang workshopThis paper describes ErLLVM, a new backend for the HiPE compiler, the native code compiler of Erlang/OTP, that targets the LLVM compiler infrastructure. Besides presenting the overall architecture of ErLLVM and its integration in Erlang/OTP, we describe ...
Pyrlang: a high performance Erlang virtual machine based on RPython
SPLASH Companion 2015: Companion Proceedings of the 2015 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for HumanityIn widely-used actor-based programming languages, such as Erlang, sequential execution performance is as important as scalability of concurrency. We are developing a virtual machine called Pyrlang for the Erlang BEAM bytecode with a just-in-time (JIT) ...
Bringing low-level languages to the JVM: efficient execution of LLVM IR on Truffle
VMIL 2016: Proceedings of the 8th International Workshop on Virtual Machines and Intermediate LanguagesAlthough the Java platform has been used as a multi-language platform, most of the low-level languages (such as C, Fortran, and C++) cannot be executed efficiently on the JVM. We propose Sulong, a system that can execute LLVM-based languages on the ...
Comments