Photo by Yosuke Ota on Unsplash

On this page

This glossary closes the series that starts with JavaScript under the hood. Terms are grouped by the layer they belong to, alphabetically within each group. Where an engine-specific name is used, the engine is named.

Engines and hosts

Agent — The specification’s name for one thread of JavaScript execution: a call stack, a queue of jobs, and a heap. The main thread of a page is one agent; each worker is another. See JavaScript under the hood.

Engine — The program that implements ECMA-262: it parses, compiles, and executes JavaScript and manages its heap. Examples are V8, SpiderMonkey, and JavaScriptCore.

Host — The environment that embeds an engine and supplies APIs outside the language, such as the DOM, fetch, timers, and fs, together with the event loop. Browsers and Node are hosts.

Runtime — An engine combined with a host, as a whole: what you program against. Node, Deno, and Bun are runtimes.

Compilation

Abstract syntax tree (AST) — The tree the parser builds from source code, representing its structure. Compilers work from it. See From source code to machine code.

Bytecode — Compact instructions for the engine’s interpreter, generated from the AST. In V8 it is produced and run by Ignition.

Code cache — Stored bytecode that lets a later load of the same script skip compilation. Chrome keeps one alongside the HTTP cache; Node enables one with module.enableCompileCache().

Deoptimization — Discarding optimized machine code whose assumptions no longer hold and continuing the same execution in bytecode. Eager when a check fails inside the code, lazy when a change elsewhere invalidates it.

Feedback vector — Per-function storage where the interpreter and baseline code record the types, shapes, and call targets each operation has seen. The optimizing compilers read it.

Ignition, Sparkplug, Maglev, TurboFan — V8’s four tiers: the bytecode interpreter, the baseline compiler, the mid-tier optimizing compiler, and the top-tier optimizing compiler.

Just-in-time (JIT) compilation — Compiling code to machine code while the program runs, based on how it actually behaves, instead of ahead of time.

Lazy parsing — Checking the syntax of a function that has not been called yet without building its AST or bytecode, and compiling it fully on the first call.

On-stack replacement (OSR) — Switching a function that is still running, usually in a long loop, from bytecode to optimized code in the middle of its execution.

Tier-up — Moving a function to a more optimized compiler tier after it has run often enough.

Objects and property access

Dictionary mode — An object whose properties are stored in a per-object hash table instead of a shared layout, usually after delete or many dynamically added keys. Slower to access. See Hidden classes and inline caches.

Elements kind — V8’s classification of how an array’s indexed values are stored, such as PACKED_SMI_ELEMENTS, PACKED_DOUBLE_ELEMENTS, PACKED_ELEMENTS, and their HOLEY_ variants. It only moves toward more general kinds.

Field representation — How a property’s value is stored for a given shape: small integer, double, heap object reference, or any value. Storing a different kind of value generalizes it for every object of that shape.

Hidden class — Internal metadata shared by objects with the same properties added in the same order, recording each property’s offset. V8 calls it a map, SpiderMonkey a shape, JavaScriptCore a structure.

Inline cache (IC) — Per-access-site memory of the shapes seen and where the property was found. Monomorphic with one shape, polymorphic with a few (up to four in V8), megamorphic beyond that.

Smi — Small integer: an integer V8 stores directly in a pointer-sized slot instead of allocating a heap number.

Transition — The step from one hidden class to the next when a property is added. Transitions form a tree that objects built the same way follow together.

Execution

Call stack — The stack of execution contexts for calls that have started and not finished; the specification calls it the execution context stack. See Execution contexts and the call stack.

Closure — A function together with the environment record it was created in, which it keeps reachable after the outer function has returned.

Environment record — The specification’s storage for the bindings of one scope: a block, a function, a module, or the global scope. Each has a reference to its outer record.

Execution context — The specification’s record of running or resumable code: its evaluation state, function, realm, script or module, and environments.

Hoisting — Informal name for creating a scope’s declarations before its first statement runs: functions fully, var as undefined, and let, const, and class as uninitialized.

Realm — One global object and one set of built-ins. Each window, iframe, and worker has its own, so objects from another realm fail instanceof checks against this realm’s constructors.

Stack frame — The engine’s machine-level record of one call: return address, arguments, and locals. Inlined calls have no frame of their own but still appear in stack traces.

Stack overflow — Exhausting the fixed-size call stack, usually through unbounded recursion, which throws RangeError: Maximum call stack size exceeded.

Temporal dead zone (TDZ) — The time between entering a scope and executing a let, const, or class declaration, during which accessing that binding throws a ReferenceError.

Scheduling

Event loop — The host’s loop that picks a task, runs it, runs all microtasks, and, in browsers, renders when it is time. See The event loop, tasks, and microtasks.

Interaction to Next Paint (INP) — A Core Web Vital that measures the delay from a user’s input to the next painted frame. Long tasks are its main cause. See Breaking up long tasks.

Long task — A task that occupies the main thread for more than 50 ms, delaying input handling and rendering.

Microtask — A job that runs as soon as the current task or callback finishes and the stack is empty: promise reactions, await continuations, queueMicrotask callbacks, and MutationObserver callbacks.

Microtask checkpoint — The step that runs microtasks until the queue is empty, including ones queued during the checkpoint.

Phase — One stage of Node’s libuv event loop, such as timers, poll, or check, each with its own callback queue.

Rendering opportunity — A point in the browser’s event loop, roughly once per display refresh, where it may run requestAnimationFrame callbacks, style, layout, and paint.

Run to completion — The guarantee that a task’s code runs until the call stack is empty before anything else runs on that thread.

Task — A unit of work the event loop runs, such as evaluating a script, dispatching an event, or running a timer callback. Sometimes called a macrotask.

Task source — The category a task comes from, such as timers, user interaction, or networking. Tasks from one source run in order; the browser chooses between sources.

Yielding — Ending the current task on purpose so the event loop can handle input and render, then continuing in a later task, for example with scheduler.yield().

Memory

Detached DOM node — An element removed from the document but still referenced from JavaScript, so it and its subtree cannot be collected. See Finding memory leaks.

Garbage collection — Automatic reclaiming of heap memory occupied by objects that are no longer reachable from any root. See Memory management and garbage collection.

Generational collection — Dividing the heap into a young generation, collected often and cheaply, and an old generation for objects that survived, collected rarely.

Heap — The memory where the engine allocates objects, strings, closures’ environments, and other values that are not encoded directly in a slot.

Heap snapshot — A record of every reachable object on the heap, its size, and the references between objects, used to find leaks.

Mark-Compact — V8’s collector for the old generation: mark live objects from the roots, sweep the rest into free lists, and move live objects to reduce fragmentation.

Retained size — The memory that would be freed if an object became unreachable, including everything only it keeps alive. Shallow size is the object’s own memory.

Retainer — An object holding a reference that keeps another object alive. Following retainers from a leaked object leads to the root that keeps it.

Root — A starting point for reachability: globals, values on the call stack, and references held by the host, such as listeners and timers.

Scavenger — V8’s copying collector for the young generation. It copies surviving objects and frees the rest of the space at once.

Weak reference — A reference that does not keep its target alive, as in WeakMap, WeakSet, and WeakRef.

Write barrier — Code the engine runs on each pointer store into a heap object, so the collector can track old-to-young references and stay correct while marking concurrently.

Threads and isolation

Atomics — Operations on shared memory that complete indivisibly across threads, plus wait and notify for coordinating them. See Concurrency with workers.

Cross-origin isolation — A page state, enabled by the Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers, that browsers require before allowing SharedArrayBuffer.

Service worker — A worker registered for an origin that intercepts network requests for its pages. The browser starts and stops it as needed.

SharedArrayBuffer — Memory that several agents can read and write at the same time, instead of receiving copies.

Structured clone — The algorithm that deep-copies data for postMessage and structuredClone(). It supports Map, Set, Date, binary data, and cycles, but not functions, DOM nodes, or prototypes.

Thread pool (libuv) — Native threads in Node, four by default, that run file system, DNS lookup, compression, and some crypto work so the event loop stays free.

Transferable — An object, such as an ArrayBuffer, MessagePort, or OffscreenCanvas, whose ownership can move to another agent without copying. The sender’s copy becomes unusable.

Worker — An additional agent with its own thread, heap, and event loop, communicating through messages. Browsers have dedicated and shared workers; Node has worker_threads.

Worklet — A lightweight script that runs inside a browser pipeline, such as audio processing or custom painting, rather than as a general-purpose thread.

That completes the Under the Hood series. Continue with JavaScript syntax at a glance.

Search articles

Type a word to search published articles.

Open the search page