JavaScript Engines: The Good Parts™
summary
Modern engines V8, ChakraCore, SpiderMonkey and JSC are compared by concrete internals: V8 uses Ignition plus a tiered optimiser, ChakraCore and others use similarly named tiers, JSC uses three optimising compilers, and engines implement hidden classes (maps/shapes) to deduplicate property metadata. Inline caches record a seen shape and offset so property access becomes a cheap shape check, arrays use packed elements with implicit attributes, and calling Object.defineProperty on an element forces a slow dictionary backing (the infamous kitten penalty).
AI-written summary · about
chapters (13)
- 0:00Start
- 1:36How Javascript Engines Work
- 2:16Spidermonkey
- 3:53Optimizing Compiler Pipeline
- 6:38Javascript Engines Implement the Javascript Object Model
- 8:01Array Indices
- 10:04Optimize Object Property Access Based on these Shapes
- 12:59Transition Chains
- 15:06Transition Trees
- 15:56Treatment for Object Literals
- 17:37Inline Caches
- 18:46Inline Cache
- 22:45Recap
related talks
21mDemystifying Javascript Engines
29mJavaScript Engines: How Do They Even?
17mDemystifying (JavaScript) engines
18mDemystifying JS Engines
28mThe Past, Present and Future of JavaScript Engines
25mJavaScript engines how do they even?
41mVirtual Machines 101
30mHow a JavaScript engine works: learn to write optimizable JS
