- Lexer: reads the source code, creates tokens from keywords and identifies variables and values;
- Parser: analyzes the “grammar” (e.g. the recognition of variable/function declarations) based on these tokens and creates syntax (parse) trees to do so;
- Interpreter: V8 doesn’t use standard interpretation (translating every line of source code into machine code line by line), but uses
- (edited) A full compiler which produces native machine code as quickly as possible. It produces the “base code”, doesn’t use bytecode, and does not focus on any optimization;
- JIT (just-in-time) compilation to increase performance by optimizing hot functions. Edit: V8 doesn’t seem to use bytecode at all;
Additionally, V8 adds performance optimization by:
- Apply tagging to efficiently represent numbers when types change;
I hope that this has brought closer insight in contribution to what has already been said.