V8 Internals Documentation
This directory contains deep-dive documentation into V8 internals, generated from source code analysis. For general documentation, see v8.dev/docs.
Table of Contents
General
Heap and Memory
- Heap Overview: General overview of V8's paged heap and object layout.
- Garbage Collection: Overview of V8's generational GC.
- Marking and Sweeping: Deep dive into Major GC phases.
- Roots: How V8 manages root objects and static roots.
- Handles: V8's mechanism for safe heap object references (Indirect vs Direct).
- Heap Compaction: How V8 resolves memory fragmentation in the Old Generation.
- Pointer Compression: Technique to reduce memory footprint on 64-bit architectures.
- Pointer Tagging: How V8 encodes type information in pointers (Smis vs HeapObjects).
- Zone Allocator: Region-based memory manager for fast allocation and batch deallocation.
Object Model
Sandbox
- Architecture: V8's in-process sandbox to protect memory outside of it.
Torque
Builtins
- Architecture: How V8 implements standard library and runtime helpers (Torque, CSA, C++, ASM).
- Torque Tutorial: Introduction to writing Torque builtins.
Code Generation
RegExp
WebAssembly
- Architecture: V8's WebAssembly implementation, including Liftoff and Turboshaft tiers.
Snapshots
- Architecture: V8's snapshot and serializer system for fast startup.
Execution - Runtime
Compiler
Sparkplug
Maglev
TurboFan
Turboshaft
Common
Parsing