1. The Anatomy of Modern JavaScript Execution
When your browser loads a .js bundle, JavaScript does not execute as simple interpreted text. Under the hood, Google's V8 engine (which powers Chrome, Node.js, Electron, and Bun/Deno) executes a sophisticated multi-tier pipeline:
[ JavaScript Source Code ]
β
βΌ
[ Scanner & Tokenizer ] ββββΆ [ Abstract Syntax Tree (AST) ]
β
βΌ
[ Ignition Bytecode Interpreter ]
β
ββββββββββββββββ΄βββββββββββββββ
β Dynamic Profiler (Type Feedback) β
ββββββββββββββββ¬βββββββββββββββ
βΌ
[ TurboFan Optimizing Compiler ]
β
βΌ
[ Highly Optimized Machine Code ]
2. Parsing and AST Generation
The Scanner breaks raw source code into atomic tokens (let, identifier, operator, literal). The Parser turns these tokens into an Abstract Syntax Tree (AST).
During this phase, Scope Analysis occurs where variable declarations (let, const, var) are registered in Lexical Environment records.
3. Ignition Bytecode & TurboFan JIT Optimization
Ignition compiles AST into compact bytecode. As functions run hot, TurboFan generates high-speed machine code directly for CPU execution with monomorphic inline caching.