| Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 2
| Graal and Graal VM • A new compiler for HotSpot written in Java and with a focus on speculative optimizations. – Based HotSpot – Aggressive high-level optimizations – JVMCI and Graal included in JDK9 (modified version of JDK8 available via OTN) 5 Graal
| 10 The Ruby Logo is Copyright (c) 2006, Yukihiro Matsumoto. It is licensed under the terms of the Creative Commons Attribution-ShareAlike 2.5 agreement JS Logo Copyright (c) 2011 Christopher Williams <[email protected]>, MIT licence You can distribute the R logo under the terms of the Creative Commons Attribution-ShareAlike 4.0 International license (CC-BY-SA 4.0) or (at your option) the GNU General Public License version 2 (GPL-2).
| • JavaScript – Better ECMAScript2016 score than V8 – Almost same performance as V8 – Fully support for node.js • R – Statistical language 13 • Ruby – Fork of JRuby – 5〜10x better performance • C、C++、Fortran – Native language support via LLVM Graal VM Polyglot
| Truffle • Together with the Graal compiler, Truffle interpreters are automatically just-in-time compiled and programs running on top of them can reach performance of normal Java. • Provides the basic foundation for building abstract-syntax-tree (AST) interpreters that perform self-optimizations at runtime – The included TruffleDSL provides a convenient way to express such optimizations. 15 Framework for implementing languages as simple interpreters
| 16 Fully compatible including native module support! Graal.js Architecture C++ JavaScript Java node modules with only JavaScript node standard library V8 API Thread pool (libeio) Event loop (libev) DNS (c-ares) crypto (OpenSSL) Graal.js JavaScript Engine Adapter V8 API to Graal.js (via JNI) Native extensions node bindings (socket, http, …) node modules with native extensions
| FastR • Goal: realize the advantages of the Truffle stack for R – Superior performance without resorting to C/C++/Fortran/… – Designed for data-heavy and parallel applications – CRAN / Bioconductor repository support • Not an ”incremental improvement” on GNU R – New execution engine written from scratch, based on Truffle – Designed as a drop-in replacement for GNU R • Speedup over latest GNU R interpreter – Somewhere between 2 and 10x 17 https://github.com/graalvm/fastr
| Completeness 19 ECMAScript 2015 (ES6) (16298 tests/16417 tests) Failing tests are to a large part Unicode Regular Expressions 93.4% ECMAScript 2016 (ES7) Supports exponentiation operator, Array.prototype.includes Fails due to new block-level function declaration and corner- case tests of the spread operator 99.3%
| 25 Simple local variables Vectorisation opportunities Simple floating point arithmetic Basic loops No method calls (except operators) Only types are numerical or boolean
| 28 Arithmetic hidden in core library methods Intermediate objects Hash mapped to an array of arrays, via another array, converted back to a hash Inner loop pixels represented as a hash of r, g, b No local variables, only method calls
| JavaScript in Ruby Truffle::Interop.eval('application/javascript', "function add(a,b) { return a + b; } Interop.export('add', add.bind(this));") add = Truffle::Interop.import('add') puts add.call(14,2) 40 Uses function defined in JavaScript from Ruby JavaScript Ruby
| Basic Concepts • Common representation of programs • Keep it rich enough to not have to throw away meaning • Common optimization of the representation 60
| U U U U U Node Rewriting for Profiling Feedback AST Interpreter Uninitialized Nodes Node Transitions S U I D G Uninitialized Integer Generic Double String T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proceedings of Onward!, 2013. 62
| U U U U U I I I G G Node Rewriting for Profiling Feedback AST Interpreter Rewritten Nodes AST Interpreter Uninitialized Nodes Node Transitions S U I D G Uninitialized Integer Generic Double String T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proceedings of Onward!, 2013. 63
| I I I G G I I I G G Rewriting ng Feedback AST Interpreter Rewritten Nodes Compilation using Partial Evaluation Compiled Code I D Uninitialized Integer Generic Double T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proceedings of Onward!, 2013. 64
| T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proceedings of Onward!, 2013. I I I G G I I I G G Deoptimization to AST Interpreter D I Node Rewriting to Update Profiling Feedback 65
| T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proceedings of Onward!, 2013. I I G G D I D G G D I D G G Node Rewriting to Update Profiling Feedback Recompilation using Partial Evaluation 66
| • Includes: – JVM (RE or DK) – Java – JavaScript – Ruby – R – More in the future • Binary tarball release • Mac or Linux 82 Graal VM – everything in one package today
| Acknowledgements Oracle Danilo Ansaloni Stefan Anzinger Cosmin Basca Daniele Bonetta Matthias Brantner Petr Chalupa Jürgen Christ Laurent Daynès Gilles Duboscq Martin Entlicher Brandon Fish Bastian Hossbach Christian Humer Mick Jordan Vojin Jovanovic Peter Kessler David Leopoldseder Kevin Menard Jakub Podlešák Aleksandar Prokopec Tom Rodriguez Oracle (continued) Roland Schatz Chris Seaton Doug Simon Štěpán Šindelář Zbyněk Šlajchrt Lukas Stadler Codrut Stancu Jan Štola Jaroslav Tulach Michael Van De Vanter Adam Welc Christian Wimmer Christian Wirth Paul Wögerer Mario Wolczko Andreas Wöß Thomas Würthinger JKU Linz Prof. Hanspeter Mössenböck Benoit Daloze Josef Eisl Thomas Feichtinger Matthias Grimmer Christian Häubl Josef Haider Christian Huber Stefan Marr Manuel Rigger Stefan Rumzucker Bernhard Urban University of Edinburgh Christophe Dubach Juan José Fumero Alfonso Ranjeet Singh Toomas Remmelg LaBRI Floréal Morandat University of California, Irvine Prof. Michael Franz Gulfem Savrun Yeniceri Wei Zhang Purdue University Prof. Jan Vitek Tomas Kalibera Petr Maj Lei Zhao T. U. Dortmund Prof. Peter Marwedel Helena Kotthaus Ingo Korb University of California, Davis Prof. Duncan Temple Lang Nicholas Ulle University of Lugano, Switzerland Prof. Walter Binder Sun Haiyang Yudi Zheng Oracle Interns Brian Belleville Miguel Garcia Shams Imam Alexey Karyakin Stephen Kell Andreas Kunft Volker Lanting Gero Leinemann Julian Lettner Joe Nash David Piorkowski Gregor Richards Robert Seilbeck Rifat Shariyar Alumni Erik Eckstein Michael Haupt Christos Kotselidis Hyunjin Lee David Leibs Chris Thalinger Till Westmann
| Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 89