Skip to Content
V8-wasm

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:

MetricResultNotes
Overall Octane 2.0 Score12,493Measured in Helium with full multi-tier JIT enabled
Share of Native arm64 d823.7%Running V8's entire JIT pipeline compiled to WebAssembly inside a browser tab
Peak Sub-Benchmark Ratio61.6% (Crypto)Tight integer arithmetic kernels running through TurboFan/Turboshaft

Observed Progression

  • Initial --jitless and uniform 31-parameter ABI: Every bytecode dispatch and return_call paid a memory-to-memory PrepareTailCall copy loop, flat br_table loops blocked host Turboshaft optimizations, and mutable imported globals (__stack_pointer) forced repeated address reloads.
  • Rounds 4–5a (12,493 in Helium, 1,694 default / 2,537 --no-sparkplug on CLI): Added non-null typed call_ref dispatch, batched 64-function slabs (CodeDispatch::BatchScope), Chrome 154 metadata.code.branch_hint metadata, 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,851 CLI — 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-sparkplug remain opt-in), eliminated lazy 28-local i64 bank allocation on integer/Smi overflow checks, compacted kWasmCmpZero, reused kHostStackLocal across prologue charging and PushHostStackAvailable(), and fused TurboFan/Maglev prologue and epilogue __stack_pointer updates to single global.set writes.

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:

BenchmarkRound 6 (Flat Maglev)Round 6 (Structured Maglev)Structured Gain
Overall Octane 2.04,4704,851+8.5% (2.86× vs. R4+5a default 1,694)
NavierStokes1,65410,8336.55× (30.3% of same-moment native 35,764)
Gameboy3,7154,737+27.5%
MandreelLatency5,0205,817+15.9%
SplayLatency5,3355,983+12.1%
DeltaBlue11,80212,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:

SuiteResultCoverage
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 Total2,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 kMaxBuiltinRegisterParams and kMaxTFSBuiltinRegisterParams to 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) to ReleaseHostFrame + direct Wasm return_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/EnterFrame from 16 __stack_pointer accesses down to 3 (storing frame slots relative to local fp).
  • Fused LeaveFrame from 6 accesses down to 1 global.set and 0 global.get.
  • Fused MaglevAssembler::Prologue / OSRPrologue with Wasm memory.fill for 4+ tagged slots, and BaselineCompiler::PrologueFillFrame with unrolled constant-offset stores (<= 16 registers) or native Wasm loop (> 16).
  • Rewrote PushArray and AllocateSpaceAndShiftExistingArguments to use Claim + bulk Wasm memory.copy.
  • Trimmed EntryFrameConstants::kNextExitFrameFPOffset to -3 * kSystemPointerSize, removing 3 dummy zero pushes per JS entry.
  • Passed CallDescriptor return masks into Liftoff MaterializeCallResults and DropStackSlotsAndRet, cutting 12-15 host memory ops per void or single-i32 Wasm 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 and CallSelf recursion), restoring host Turboshaft loop unrolling, cross-block value numbering, and late load elimination.
  • Eliminated lazy i64 register bank materialization on TurboFan and Maglev integer/Smi overflow checks by computing the wrapped i32 result into w15 and the 0/1 overflow bit on the operand stack into w14/branch, and compacted kWasmCmpZero (i32.eqz / bare operand when a canonical 0/1 boolean is not required).
  • Reused kHostStackLocal from BeginRestartFrameCatch in prologue host-stack charging and PushHostStackAvailable(), and fused prologue/epilogue __stack_pointer adjustments into single global.set writes across TurboFan and Maglev.
  • Disabled Sparkplug by default on V8_TARGET_ARCH_WASM via a weak flag implication (explicit --sparkplug and --always-sparkplug still opt in cleanly) so functions tier directly from Ignition into structured Maglev and TurboFan.
  • Emitted Chrome 154 metadata.code.branch_hint metadata on Smi, Map, overflow, write-barrier, and Maglev eager-deopt guards.
  • Enabled native Wasm select (kWord32Select, kFloat32Select, kFloat64Select) and f64.min/f64.max in instruction-selector-wasm.cc.
  • Branched around the TruncateDoubleToI slow path (f64.abs(x) < 2^63), replacing f64.div(2^32) (~15 cycles) with bit-exact f64.mul(0x1p-32) in the cold else arm.
  • Rewrote hot Irregexp scans (SkipUntilBitInTable, CheckNotBackReference, CheckNotBackReferenceIgnoreCase) as native Wasm loop/br_if with hoisted bitmap addresses.

4. Batched Code Slabs and Zero-Reflection Install

  • Added CodeDispatch::BatchScope packing up to 64 compiled functions into one WebAssembly.Module slab, amortizing OS VirtualMemory / far-jump-table allocation and unlocking Chrome 154 same-instance speculative inlining.
  • Replaced per-install WebAssembly.Module.imports() reflection with a WeakMap-keyed per-thread import cache and lock-free published_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.

On this page