IR, … … on the JVM … … and using a dynamic compiler to make the approach fast. … by compiling them to LLVM IR, … LLVM IR Interpreter JVM LLVM IR C C++ Fortran ... JIT compiler Compile to Execute with
next decade or so we‘ll see C programs, or C++ programs running in managed mode on top of the JVM, I would not be surprised. John Rose (JVM Architect) @ JVMLS 2016
non-standard C! • We want to support existing machine code! 18 • We want to be memory safe! Native/Unmanaged Sulong https://github.com/graalvm/sulong Safe/Managed Sulong
non-standard C! • We want to support existing machine code! 19 • We want to be memory safe! Native/Unmanaged Sulong https://github.com/graalvm/sulong Safe/Managed Sulong
} example = {1, 2}; long val = *((long*) &example); // 8589934593 unsafe.putChar(exampleAddress , (char) 1); unsafe.putInt (exampleAddress + 4, 2); long val = unsafe.getLong(exampleAddress); b 0 4 8 1 a exampleAddress We use the same data layout as static compilers produce!
non-standard C! • We want to support existing machine code! 24 • We want to be memory safe! Native/Unmanaged Sulong https://github.com/graalvm/sulong Safe/Managed Sulong
non-standard C! • We want to support existing machine code! 24 • We want to be memory safe! Native/Unmanaged Sulong https://github.com/graalvm/sulong Safe/Managed Sulong
Shen, Bor-Yeh, et al. "LLBT: an LLVM- based static binary translator." [6] Chipounov, Vitaly, et al. Dynamically Translating x86 to LLVM using QEMU. [5] Dinaburg, Artem, et al. Mcsema: Static translation of x86 instructions to llvm. LLVM IR MC-Semantics [5]/ QEMU [6] x86 LLBT [7] ARM
to use programs that use non-standard C! • We want to support existing machine code! • We want to be memory safe! Native/Unmanaged Sulong https://github.com/graalvm/sulong Safe/Managed Sulong
the JVM." Proceedings of the Third Workshop on Virtual Machines and Intermediate Languages. ACM, 2009. [2] Würthinger, Thomas, et al. "One VM to rule them all." Proceedings of the 2013 ACM international symposium on New ideas, new paradigms, and reflections on programming & software. ACM, 2013. [3] Grimmer, Matthias, et al. "High-performance cross-language interoperability in a multi-language runtime." Proceedings of the 11th Symposium on Dynamic Languages. ACM, 2015. [4] Szekeres, Laszlo, et al. "Sok: Eternal war in memory." Security and Privacy (SP), 2013 IEEE Symposium on. IEEE, 2013. [5] Dinaburg, Artem, and Andrew Ruef. Mcsema: Static translation of x86 instructions to llvm. ReCon 2014 Conference, Montreal, Canada [6] Chipounov, Vitaly, and George Candea. Dynamically Translating x86 to LLVM using QEMU. No. EPFL-REPORT-149975. 2010. [7] Shen, Bor-Yeh, et al. "LLBT: an LLVM-based static binary translator." Proceedings of CASES’12. 32