inlining
An optimisation that copies a small function's body, or a property lookup, straight into the code that uses it, avoiding the cost of a call or a search.
In more detail
V8 remembers, at each place in the code that reads a property, which object shapes it has seen: this is an inline cache. When only one shape has been seen, TurboFan can inline the property's exact position.
Related terms
- hidden class — An internal record V8 keeps of an object's property names and their order, so it can find properties quickly.
- monomorphic — Describes a place in the code that always sees objects of one single shape, which lets TurboFan optimise it best.
- TurboFan — V8's optimising compiler, which turns hot functions into fast machine code based on the types it has seen.
Taught in
- V8 Engine & JIT Pipeline: Bytecode & Turbofan — Node.js Internals & Backend Services