"매 multi-tier JIT + generational GC 의 JavaScript runtime". 매 Google (2008) 의 Chrome 용 의 open-source 의 release 의 Node.js + Electron + Deno 의 ecosystem 의 substrate. 매 2026 년 의 V8 13.x 의 Maglev (mid-tier) + Turboshaft (top-tier) + sandbox + pointer-compression 의 modern stack.
매 핵심
매 execution pipeline (4-tier)
Ignition — bytecode interpreter. 매 startup fast.
Sparkplug — non-optimizing baseline JIT. 매 cheap compile.
Maglev — mid-tier optimizing JIT (V8 11.7+). 매 quick optimize.
TurboFan / Turboshaft — top-tier optimizing JIT. 매 peak perf.
node --trace-opt --trace-deopt app.js
# Watch which functions get Turboshaft-optimized vs deoptimize
Hidden class / inline cache friendly
// GOOD — same shape every time → same hidden class → IC monomorphic
functionPoint(x,y){this.x=x;this.y=y;}constpoints=[newPoint(1,2),newPoint(3,4)];// BAD — shape changes → IC megamorphic → slow
constp1={x:1,y:2};constp2={x:1,y:2,z:3};// different shape
Snapshot for fast startup
// Build a snapshot blob with pre-loaded JS, then restore it
v8::SnapshotCreatorcreator;{autoisolate=creator.GetIsolate();v8::HandleScopehscope(isolate);autoctx=v8::Context::New(isolate);v8::Context::Scopescope(ctx);// run init JS...
creator.SetDefaultContext(ctx);}autoblob=creator.CreateBlob(v8::SnapshotCreator::FunctionCodeHandling::kClear);// Save blob.data, load with v8::Isolate::CreateParams::snapshot_blob
Isolate-per-request (Cloudflare Workers model)
// Conceptual — V8 isolates as multi-tenant unit
classWorkerRunner{asyncrun(script,request){constisolate=newV8Isolate({memoryLimit:128_000_000});constctx=isolate.createContext();ctx.global.fetch=fetch;try{returnawaitctx.eval(script).fetch(request);}finally{isolate.dispose();}}}
Force GC + heap snapshot
node --expose-gc --inspect app.js
# In code: global.gc(); v8.writeHeapSnapshot('s.heapsnapshot');
언제: 매 perf debugging 의 deopt 의 reading. 매 hidden class 의 explanation. 매 flag selection.
언제 X: 매 V8 internal API 의 frequent change. 매 LLM 의 outdated 의 risk → release notes 의 verify.
❌ 안티패턴
Polymorphic shapes: 매 IC megamorphic 의 cause. 매 hidden class consistent 의 keep.
Try/catch in hot loop (pre-V8 6): 매 modern V8 의 OK 지만 의 still 의 cost.
delete on hot object: 매 hidden class transition 의 trigger.
Naive eval: 매 deopt + security risk.
🧪 검증 / 중복
Verified (V8 official docs, V8 blog 2026, Node.js v22+ docs).