"매 Apple WebKit 의 JavaScript 엔진 — 4-tier JIT pipeline (LLInt → Baseline → DFG → FTL/B3)". Safari, iOS WebView, React Native (Hermes 도입 전), Bun runtime의 core. 매 V8 대비 startup 빠름, peak performance 비슷 — 매 mobile-first 최적화.
매 핵심
매 4-Tier JIT Pipeline
LLInt (Low-Level Interpreter): 매 첫 실행, profiling 시작.
Baseline JIT: 매 hot 코드 → simple machine code, type feedback 수집.
DFG (Data Flow Graph): 매 speculative optimization, OSR exit 가능.
FTL (Faster Than Light) / B3 backend: 매 최상위 tier, LLVM-style IR.
매 GC
Riptide: 매 generational + concurrent mark-and-sweep.
Eden GC: 매 young objects, frequent.
Full GC: 매 entire heap, infrequent.
매 응용
Safari / WKWebView (iOS, macOS).
Bun runtime — 매 Node.js 대안, JSC 채택 (V8 X).
React Native (legacy iOS, Hermes 이전).
GNOME / GTK WebKitGTK.
💻 패턴
Bun runtime — JSC embed
// bun runs JS via JSC (not V8)
// startup: ~10ms vs Node ~30ms
import{serve}from"bun";serve({port:3000,fetch(req){returnnewResponse("Hello from JSC");},});
// JSC structure (V8의 hidden class 와 동일 개념)
functionPoint(x,y){this.x=x;// structure transition T0 → T1
this.y=y;// T1 → T2
}// T2 가 stable → inline cache hit
Type feedback (monomorphic 유지)
functionadd(a,b){returna+b;}add(1,2);// int+int → DFG int specialization
add(1.5,2.5);// float+float → polymorphic, slower
// 매 monomorphic 유지 — 매 동일 type 만 호출
OffHeap typed array (Bun)
// JSC 의 ArrayBuffer 는 GC 외부 — large data 적합
constbuf=newArrayBuffer(1024*1024*100);// 100MB
constview=newUint8Array(buf);// 매 GC pressure X
WeakRef (JSC 1.16+)
constcache=newWeakRef(largeObject);// 매 GC 가 collect 가능 — memory pressure 시 free
constref=cache.deref();if(ref){/* still alive */}
매 결정 기준
상황
Approach
iOS native app + JS
JSC (WKWebView 또는 JavaScriptCore.framework)
Cross-platform server
V8 (Node.js) — 매 ecosystem 큼
Fast startup CLI
Bun (JSC) — 매 startup 압도적
RN new architecture
Hermes — 매 mobile 최적화
기본값: server는 V8/Node, mobile WebView는 JSC, fast CLI는 Bun.