employee of @Aeneas, ex-employee of SAP C++, JavaScript, Scala/Java/Kotlin, sometimes Rust Huge compliers, runtimes and formal verification fan Sometimes making WASM bulk operations and GC in ChakraCore • • • • • 2
is valid by specification The easiest implementation detail in VM ;) Bytecode executor Executes bytecode if no optimizations required Collects execution profiling data • • • • • • 19
why JS is so fast Makes simple optimizations like constant propagation/folding, etc Makes strong optimizations like escape analysis and methods inlining Provides speculative optimizations like branch prediction, etc • • • • • 20
Allows direct offheap allocations Sometimes it is a secret door to black magic Classloader Contains in VMs with staticly typed target language Loads and stores metainformation about data structures Big plus : allows effective allocation strategies • • • • • • • • 24
and one (or more) JIT They make very desperate optimizations about type predictions Deoptimize bytecode if type predictions turns out to be wrong • • • 27
JIT is the reason why JS gains big speedup a few years ago It is good to know a weak sides of your low-level code executor Knowledge is power! • • • • 32