just in time compilation, mix of both interpretation and compilation

start with interpretation and compile on the go

optimisations

  1. Inlining
  2. Copy Elision
  3. Inline caching

Just in time compilation

V8

Interpreter - Ignition Compiler - TurboFan

Ignition

  1. How
    1. reducing memory usage,
    2. reducing startup time, and
    3. reducing complexity.

TurboFan

Further reading

  1. https://www.infoq.com/news/2021/06/v8-sparkplug-compiler/#:~:text=The%20old%20V8%20architecture%20included,generate%20machine%20code%20from%20that.
  2. https://www.digitalocean.com/community/tutorials/js-v8-engine
  3. https://blog.logrocket.com/how-javascript-works-optimizing-the-v8-compiler-for-efficiency/

Source Code -> Byte Code -> Machine Code

Questions

  1. Can we say that REPL is interpreter? or vice versa?

    All notes