Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b5980d315589223566316cb2953766abbf40497d
      
https://github.com/WebKit/WebKit/commit/b5980d315589223566316cb2953766abbf40497d
  Author: Yijia Huang <[email protected]>
  Date:   2026-01-27 (Tue, 27 Jan 2026)

  Changed paths:
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/runtime/VMManager.cpp
    M Source/JavaScriptCore/runtime/VMManager.h
    M Source/JavaScriptCore/runtime/VMTraps.h
    M Source/JavaScriptCore/shell/CMakeLists.txt
    A Source/JavaScriptCore/wasm/debugger/tests/ExecutionHandlerIdleStopTest.cpp
    A Source/JavaScriptCore/wasm/debugger/tests/ExecutionHandlerIdleStopTest.h
    M Source/JavaScriptCore/wasm/debugger/testwasmdebugger.cpp

  Log Message:
  -----------
  [JSC][WASM][Debugger] Use RunLoop dispatch to handle Stop-The-World for idle 
VMs
rdar://168561224
https://bugs.webkit.org/show_bug.cgi?id=305908

Reviewed by Keith Miller.

Enable LLDB to interrupt and stop idle websites where WASM/JavaScript code
hasn't executed yet, improving the debugging experience for event-driven
web applications.

The Problem:
When LLDB sends an interrupt request, VMManager sets trap bits and expects
VMs to check their traps and call notifyVMStop(). However, idle VMs (not
executing code) never check traps - they're just processing RunLoop events.
Previously, the debugger would wait indefinitely for idle VMs to stop,
eventually timing out.

The Solution:
When requesting Stop-The-World, dispatch a callback to each VM's RunLoop.
This ensures that both active and idle VMs can be stopped:
- Active VMs: Check traps during execution and call notifyVMStop()
- Idle VMs: RunLoop processes the dispatched callback and calls notifyVMStop()
This ensures exactly one notifyVMStop() call per VM regardless of timing.

Test Coverage:
Added ExecutionHandlerIdleStopTest with test scenarios including pure
idle VM interrupt/resume loops to stress-test the RunLoop dispatch mechanism.

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



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

Reply via email to