Language virtual machines are now everywhere, from server to mobile applications through web pages. The main ones are developed and maintained by large industrial groups (Oracle and the JVM, Microsoft and .Net, Google and V8, etc.). The talk introduces the different components of a virtual machine (Interpreter, JIT compiler, Memory Manager) and the key challenges to build a good one. Then, the talk details the current and incoming research going-on I am doing performing this topic.
Challenges of High-performance Language Virtual Machines
1. Challenges of High-
performance Language
Virtual Machines
Clément Béra
Pharo Consortium engineer
RMoD - Inria Lille Nord Europe
2. About Me
Working on Language Virtual Machines for 5+ years
2
Before 2012 Master Mines de Douai
2012 Inria engineer
2014 Ph.D
2017 Pharo consortium engineer
2018 + Post-Doc & Applying for CR position
14. Who?
+ a few research teams around the world
but… not really in France
14
Java VM Oracle, IBM
.Net (C# VM) Microsoft
Javascript VM Google, Mozilla, Apple, Microsoft
Android VM Google
15. Architecture
15
Ch. 1: Fast execution speed
Interpreter & JIT compiler
Execution Stack Management
Ch. 2: Efficient memory
management
Garbage Collector
Foreign Function Interface
Call to dynamic libraries
Platform
OS integration
File Management
Native UIs
Ch. 3: Stability
17. Challenge 1: Fast
execution speed
Language VM executes the Java, Smalltalk code
Execution is done by interpreter, quite slow
17
Speed-up: Just-In-Time compiler (JIT)
Detects frequently used code & recompiles
them at runtime to efficient machine code
24. Advanced debugging features
Changing memory layout
Add a field to object 2
Not enough space locally
24
Object 1
Object 2
Object 3
Pointer from
another object
Pointer from
an interpreter
variable
25. Forwarding objects
Forwarding object
Problem: read-barrier
Solution: partial read-barrier
(Maintain invariant, avoids 99% of checks)
25
Object 1
Fwd
Object 3
Pointer from
another object
Pointer from
an interpreter
variable
Object 2
29. Research: static analysis
29
Deoptimization uncommon
Symbolic execution of the same code
at different optimization levels
Symbolic
non
optimised
state
Symbolic
optimised
state
Symbolic
deoptimised
state
Deoptimization Symbolic
values
comparison
36. Future: Debugging
distributed applications
VM with advanced debugging features
Monitor the asynchronous communication,
Remote debugging
Challenge: Recreate the execution flow
Different hardware, execution models,
life-time, vocabulary
36
37. Conclusion & Questions
37
Language VMs are used everywhere
Complex architecture:
High execution speed, Low memory consumption,
High responsiveness, Cross-platform
Research on VM performance, stability
memory management, debugging