JIT Compilation (TD) - rust-js/rjs GitHub Wiki
rjs executes JavaScript code using JIT compilation. There are two levels of JIT compilation: fast and slow. Fast JIT compilation is basically a compiled version of the interpreter. Instead of executing byte code through a large switch statement, code is generated that executes all the steps the interpreter would execute. Slow JIT compilation is an optimized JIT compiler that uses runtime statistics to create an optimized version of the JavaScript code.
- JIT Compilation: Fast (TD)
- JIT Compilation: Slow (TD) (scheduled for a future release)
Global data
JIT compiled functions need access to some global data. For this purpose, a struct is kept with globally available information. This struct contains the following data:
[0] env: A pointer to theJsEnvinstance;[1] thrown: The in flight exception, if any.