Benchmarks
Octane 2.0 results (12,493 in Helium), JIT verification baseline, and implemented optimizations
V8-wasm runs V8's full multi-tier JIT pipeline inside standard Chromium browsers (host V8 15.4) without custom browser flags. The numbers and engineering notes below reflect what is implemented and verified today.
Octane 2.0 Results
Measured in Helium (Chromium 154 host V8 on Apple Silicon) against native arm64 d8:
| Metric | Result | Notes |
|---|---|---|
| Overall Octane 2.0 Score | 12,493 | Measured in Helium with full multi-tier JIT enabled |
Share of Native arm64 d8 | 23.7% | Running V8's entire JIT pipeline compiled to WebAssembly inside a browser tab |
| Peak Sub-Benchmark Ratio | 61.6% (Crypto) | Tight integer arithmetic kernels running through TurboFan/Turboshaft |
Observed Progression
- Initial
--jitlessand uniform 31-parameter ABI: Every bytecode dispatch andreturn_callpaid a memory-to-memoryPrepareTailCallcopy loop, flatbr_tableloops blocked host Turboshaft optimizations, and mutable imported globals (__stack_pointer) forced repeated address reloads. - Rounds 4–5a (
12,493in Helium,1,694default /2,537--no-sparkplugon CLI): Added non-null typedcall_refdispatch, batched 64-function slabs (CodeDispatch::BatchScope), Chrome 154metadata.code.branch_hintmetadata, native Wasm loops in Irregexp, O(V+E)TryAnalyzeBlockGraph+ O(1)StructuredBranchDepth, narrow 7-parameter Bytecode-Handler ABI, and 23 lazily-declared GP registers (w16..w27). - Round 6 (
4,851CLI — 2.86× over Round 4+5a default, 5.37× over pre-Round-4 baseline): Added whole-function Maglev Structured CFG (1,434 / 2,034= 70.5% of Octane 2.0 Maglev compiles with 0 poisoned bailouts, including OSR hot loops), disabled Sparkplug by default via weak flag implication (--sparkplug/--always-sparkplugremain opt-in), eliminated lazy 28-locali64bank allocation on integer/Smi overflow checks, compactedkWasmCmpZero, reusedkHostStackLocalacross prologue charging andPushHostStackAvailable(), and fused TurboFan/Maglev prologue and epilogue__stack_pointerupdates to singleglobal.setwrites.
Round 6 Same-Moment CLI Octane 2.0 Comparison
Measured back-to-back on wasm/d8.cjs (17/17 zero crashes) with structured Maglev CFG enabled vs. disabled via the V8_WASM_NO_MAGLEV_STRUCTURED=1 kill switch:
| Benchmark | Round 6 (Flat Maglev) | Round 6 (Structured Maglev) | Structured Gain |
|---|---|---|---|
| Overall Octane 2.0 | 4,470 | 4,851 | +8.5% (2.86× vs. R4+5a default 1,694) |
| NavierStokes | 1,654 | 10,833 | 6.55× (30.3% of same-moment native 35,764) |
| Gameboy | 3,715 | 4,737 | +27.5% |
| MandreelLatency | 5,020 | 5,817 | +15.9% |
| SplayLatency | 5,335 | 5,983 | +12.1% |
| DeltaBlue | 11,802 | 12,500 | +5.9% |
Pure Maglev (--no-turbofan) head-to-head gains from structured CFG: NavierStokes +71% (3,217 → 5,486) and Box2D +59% (2,134 → 3,382).
Verification Baseline
Correctness across every tier is verified on wasm/d8.cjs with DCHECK_ALWAYS_ON=1:
| Suite | Result | Coverage |
|---|---|---|
mjsunit/baseline/* | 10 / 10 (100%) | Sparkplug baseline compiler and OSR |
mjsunit/regexp/* | 10 / 10 (100%) | Irregexp native-loop Wasm JIT |
mjsunit/wasm/deopt/* | 30 / 30 (100%) | Liftoff/TurboFan Wasm deopt (non-JSPI) |
mjsunit/maglev/* | 722 / 722 (100%) | Maglev SSA IR and eager/lazy deopt |
mjsunit/turbolev/* | 557 / 557 (100%) | Maglev-frontend to Turboshaft pipeline |
mjsunit/compiler/* | 991 / 991 (100%) | TurboFan/Turboshaft optimizing compiler |
| Combined JIT Total | 2,320 / 2,320 (100%) | All applicable wasm32 official V8 JIT tests |
Implemented Performance Optimizations
1. Narrow Call Shapes and 5-Register Builtin Linkage
- Replaced uniform 31-parameter dispatch with descriptor-driven narrow call shapes so hot Ignition, JS, and Torque/TFS calls fit inside host Liftoff's 5 GP + 6 FP (x64) / 6 GP + 8 FP (arm64) register budget.
- Raised
kMaxBuiltinRegisterParamsandkMaxTFSBuiltinRegisterParamsto 5 (w0,w1,w2,w3,w5), eliminating linear-memory argument spills on 4-5 argument builtins. - Switched OSR entries (
GenerateInterpreterDispatch) and builtin continuations (kArchTailCallAddress,kArchTailCallWasm,Generate_ContinueToBuiltinHelper) toReleaseHostFrame+ direct Wasmreturn_call.
2. Mutable Imported Global Reduction (__stack_pointer)
Host Turboshaft lowers every mutable imported global access to 4-5 memory loads because imported_mutable_globals_offsets[i] is not marked .Immutable(), causing every call to invalidate cached addresses.
- Fused
MacroAssembler::Prologue/EnterFramefrom 16__stack_pointeraccesses down to 3 (storing frame slots relative to localfp). - Fused
LeaveFramefrom 6 accesses down to 1global.setand 0global.get. - Fused
MaglevAssembler::Prologue/OSRProloguewith Wasmmemory.fillfor 4+ tagged slots, andBaselineCompiler::PrologueFillFramewith unrolled constant-offset stores (<= 16registers) or native Wasmloop(> 16). - Rewrote
PushArrayandAllocateSpaceAndShiftExistingArgumentsto useClaim+ bulk Wasmmemory.copy. - Trimmed
EntryFrameConstants::kNextExitFrameFPOffsetto-3 * kSystemPointerSize, removing 3 dummy zero pushes per JS entry. - Passed
CallDescriptorreturn masks into LiftoffMaterializeCallResultsandDropStackSlotsAndRet, cutting 12-15 host memory ops per void or single-i32Wasm call.
3. Structured CFG (TurboFan + Maglev), Native Wasm Ops, and Branch Hinting
- Replaced flat
loop { block*N; br_table }dispatch with an O(V+E) Stackifier structured CFG pass (TryAnalyzeBlockGraph+ O(1)StructuredBranchDepth) in both TurboFan and Maglev (70.5%of Octane 2.0 Maglev functions including OSR loops andCallSelfrecursion), restoring host Turboshaft loop unrolling, cross-block value numbering, and late load elimination. - Eliminated lazy
i64register bank materialization on TurboFan and Maglev integer/Smi overflow checks by computing the wrappedi32result intow15and the 0/1 overflow bit on the operand stack intow14/branch, and compactedkWasmCmpZero(i32.eqz/ bare operand when a canonical 0/1 boolean is not required). - Reused
kHostStackLocalfromBeginRestartFrameCatchin prologue host-stack charging andPushHostStackAvailable(), and fused prologue/epilogue__stack_pointeradjustments into singleglobal.setwrites across TurboFan and Maglev. - Disabled Sparkplug by default on
V8_TARGET_ARCH_WASMvia a weak flag implication (explicit--sparkplugand--always-sparkplugstill opt in cleanly) so functions tier directly from Ignition into structured Maglev and TurboFan. - Emitted Chrome 154
metadata.code.branch_hintmetadata on Smi, Map, overflow, write-barrier, and Maglev eager-deopt guards. - Enabled native Wasm
select(kWord32Select,kFloat32Select,kFloat64Select) andf64.min/f64.maxininstruction-selector-wasm.cc. - Branched around the
TruncateDoubleToIslow path (f64.abs(x) < 2^63), replacingf64.div(2^32)(~15 cycles) with bit-exactf64.mul(0x1p-32)in the coldelsearm. - Rewrote hot Irregexp scans (
SkipUntilBitInTable,CheckNotBackReference,CheckNotBackReferenceIgnoreCase) as native Wasmloop/br_ifwith hoisted bitmap addresses.
4. Batched Code Slabs and Zero-Reflection Install
- Added
CodeDispatch::BatchScopepacking up to 64 compiled functions into oneWebAssembly.Moduleslab, amortizing OSVirtualMemory/ far-jump-table allocation and unlocking Chrome 154 same-instance speculative inlining. - Replaced per-install
WebAssembly.Module.imports()reflection with aWeakMap-keyed per-thread import cache and lock-freepublished_epoch_idle acks. - Shared 3 outer out-of-line deopt stubs per TurboFan function instead of emitting ~80 bytes of inline deopt glue at every guard.