Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1837781c8a2a49b3ad065d4ac46a638aacdda804
      
https://github.com/WebKit/WebKit/commit/1837781c8a2a49b3ad065d4ac46a638aacdda804
  Author: Yijia Huang <[email protected]>
  Date:   2026-02-21 (Sat, 21 Feb 2026)

  Changed paths:
    M Source/JavaScriptCore/bytecode/CodeBlock.cpp
    M Source/JavaScriptCore/bytecode/CodeBlock.h
    M Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
    M Source/JavaScriptCore/jit/JITOperations.cpp
    M Source/JavaScriptCore/jit/JITToDFGDeferredCompilationCallback.cpp
    M Source/JavaScriptCore/profiler/ProfilerJettisonReason.h
    M Source/JavaScriptCore/runtime/OptionsList.h

  Log Message:
  -----------
  [JSC] Implement Quick DFG Tier-Up for proven-stable functions
https://bugs.webkit.org/show_bug.cgi?id=308315
rdar://170810503

Reviewed by Yusuke Suzuki, Dan Hecht, and Keith Miller.

This patch introduces a Quick DFG Tier-Up mechanism that tracks DFG compilation
stability across invocations using UnlinkedCodeBlock state. Functions with 
proven
DFG stability from previous iterations use an aggressive threshold,
while unstable or unproven functions use the standard threshold.

State tracking uses WTF::TriState with three states:
- Indeterminate: Initial state, no DFG history yet
- True: Proven stable (first DFG compilation succeeded)
- False: Proven unstable (compilation or speculation failed)

Valid state transitions (once False, always False):
- Indeterminate -> True: First DFG compilation succeeds
- Indeterminate -> False: First DFG compilation fails
- True -> False: DFG jettison due to speculation failure or recompilation fails
- False -> False: Remains unstable (no recovery possible)

We focus on pure stable functions - once a function proves unstable at any
point, we treat it conservatively in future runs to avoid wasted
compilation attempts.

The patch distinguishes between speculation failures (OSR exits, watchpoint
invalidations, failed OSR entry) and external events (GC, debugger, old age).
Only speculation failures mark functions as Unstable, ensuring that transient
external events don't unnecessarily penalize otherwise-stable code.

To disable the optimization, set --quickDFGTierUpThresholdFactor=1.0

Canonical link: https://commits.webkit.org/307998@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to