Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Managed Runtime Systems: Lecture 07 - Meta-circ...

zakkak
March 12, 2018

Managed Runtime Systems: Lecture 07 - Meta-circular VMs

zakkak

March 12, 2018
Tweet

More Decks by zakkak

Other Decks in Programming

Transcript

  1. Managed Runtime Systems Lecture 07: Meta-circular VMs Foivos Zakkak https://foivos.zakkak.net

    Except where otherwise noted, this presentation is licensed under the Creative Commons Attribution 4.0 International License. Third party marks and brands are the property of their respective holders.
  2. Meta-circularity Using the language that the VM implements to write

    the VM itself! Managed Runtime Systems 1 of 9 https://foivos.zakkak.net
  3. Why??? 1. All the advantages of managed and high-level languages

    2. Consistent calling conventions (going from app to VM and back) 3. Consistent Types and sizes 4. Consistent memory model 5. Re-use the same compilers at compile-time and run-time 6. Maintainability Managed Runtime Systems 2 of 9 https://foivos.zakkak.net
  4. But! 1. Slower product 2. Slower development cycles 3. Thinking

    in a meta-circular manner is not trivial (hard to find bugs) 4. More complex testing infrastructure Managed Runtime Systems 3 of 9 https://foivos.zakkak.net
  5. Using a substrate VM Rely on C compilers to produce

    machine code C-based implementation of a minimal runtime Bootstraps the Java in Java VM and implements system handling JIT compilation with C compilers is too slow, LLVM aims to fix that Squawk VM is one such example Managed Runtime Systems 4 of 9 https://foivos.zakkak.net
  6. Re-using the same compiler at compile-time and run-time Old VM

    javac MyCompiler.java MyCompiler.class MyCompiler.java MyVM.java Old VM My VM + Compiler HelloWorld.class Hello World!!! Managed Runtime Systems 5 of 9 https://foivos.zakkak.net
  7. Re-using the same compiler at compile-time and run-time Old VM

    javac MyCompiler.java MyCompiler.class MyCompiler.java MyVM.java Old VM My VM + Compiler HelloWorld.class Hello World!!! Managed Runtime Systems 5 of 9 https://foivos.zakkak.net
  8. Re-using the same compiler at compile-time and run-time Old VM

    javac MyCompiler.java MyCompiler.class MyCompiler.java MyVM.java Old VM My VM + Compiler HelloWorld.class Hello World!!! Managed Runtime Systems 5 of 9 https://foivos.zakkak.net
  9. Re-using the same compiler at compile-time and run-time Old VM

    javac MyCompiler.java MyCompiler.class MyCompiler.java MyVM.java Old VM My VM + Compiler HelloWorld.class Hello World!!! Managed Runtime Systems 5 of 9 https://foivos.zakkak.net
  10. Difficulties Needs access to unsafe parts of the language How

    to avoid GC being run during GC Managed Runtime Systems 6 of 9 https://foivos.zakkak.net
  11. Examples of Java in Java VMs Jikes Research VM (aka

    JikesRVM) Maxine VM Managed Runtime Systems 7 of 9 https://foivos.zakkak.net
  12. Jikes RVM Originally known as Jalapeño Adopted by the academia

    Features the Memory Management Toolkit (MMTk) Relies on a magic layer for its implementation on different platforms 2 JIT compilers, no interpreter No 64bit port Managed Runtime Systems 8 of 9 https://foivos.zakkak.net
  13. Maxine VM Predecessor of the Graal Compiler, a JIT compiler

    for Java written in Java Modular design (GC, Compilers, Memory layout, Monitors, etc.) Template based compilation More next time! Managed Runtime Systems 9 of 9 https://foivos.zakkak.net