JavaScript Visualized: A Script's Life
summary
Starts at HTML fetch, decodes bytes to tokens, parses into an AST and hands it to V8's Ignition bytecode interpreter which emits register-based bytecode (uses r0, r2 and an accumulator and a0 points to a shape table). Example: object {x:10,y:20,z:30} runs ops to produce 1100. Inline caches record shapes and feedback vector types; repeated calls trigger the Turbofan optimizer to emit machine code, but differing shapes cause deopt back to bytecode and extra overhead.
AI-written summary · about
chapters (6)
- 0:00Introduction to V8
- 0:37Parsing JavaScript
- 2:03Bytecode Generation
- 5:03Shapes and Inline Caching
- 7:33Machine Code Optimization
- 10:06Summary and Resources
related talks
25mJavaScript engines how do they even?
17mV8 engine, JS Code Interpretation, and Execution
23mJoin the super secret V8 club & become a JavaScriptbender
33mJavaScript: The V8 Engine optimization tips (...)
32mV8 by example: A journey through the compilation pipeline
17mDemystifying (JavaScript) engines
29mJavaScript Engines: How Do They Even?
29mJavaScript in JavaScript: Inception
