Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fb30bac88bb45e0804e337122dc8bbf8f2fa0d00
      
https://github.com/WebKit/WebKit/commit/fb30bac88bb45e0804e337122dc8bbf8f2fa0d00
  Author: Yijia Huang <[email protected]>
  Date:   2026-07-08 (Wed, 08 Jul 2026)

  Changed paths:
    M JSTests/wasm/debugger/tests/tests.py
    M Source/JavaScriptCore/runtime/StopTheWorldCallback.h
    M Source/JavaScriptCore/runtime/VM.h
    M Source/JavaScriptCore/runtime/VMManager.cpp
    M Source/JavaScriptCore/runtime/VMManager.h
    M Source/JavaScriptCore/runtime/VMTraps.h
    M Source/JavaScriptCore/runtime/WaiterListManager.cpp
    M Source/JavaScriptCore/wasm/debugger/WasmExecutionHandler.cpp
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Modules/filesystem/WorkerFileSystemStorageConnection.cpp
    M Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/bindings/js/SerializedScriptValue.cpp
    M Source/WebCore/workers/WorkerGlobalScope.cpp
    M Source/WebCore/workers/WorkerNotificationClient.cpp
    R Source/WebCore/workers/WorkerSTWParticipation.cpp
    R Source/WebCore/workers/WorkerSTWParticipation.h

  Log Message:
  -----------
  [JSC][WASM][Debugger] Replace polling-based STW participation with 
VMBlockingScope
https://bugs.webkit.org/show_bug.cgi?id=316687
rdar://179141754

Reviewed by Mark Lam.

Worker threads blocked in Atomics.wait/memory.atomic.wait or WebCore synchronous
operations (SubtleCrypto, IndexedDB, WebSocket, FileSystem, Notification) 
previously
polled NeedStopTheWorld every 50ms to cooperate with the WASM debugger's
Stop-The-World protocol.

Replace with VMBlockingScope RAII: entering a blocking op increments
m_numberOfBlockedVMs, making the STW trigger (stopped + blocked == active)
fire without polling. On unblock, the VM atomically transitions to the
stopped counter and proceeds through normal STW participation.

Design assumption: the main thread VM is never OS-blocked while entered,
ensuring m_numberOfStoppedVMs > 0 when the condition fires so a VM is
always available to service the callback.

Tests:
* JSTests/wasm/debugger/tests/tests.py:
(MemoryAtomicWaitTestCase.execute):
(MemoryAtomicWaitNoTimeoutTestCase.execute):

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



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

Reply via email to