Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 228685d7d2a31dc419f5ca00554e163bac349ea5
      
https://github.com/WebKit/WebKit/commit/228685d7d2a31dc419f5ca00554e163bac349ea5
  Author: Keith Miller <[email protected]>
  Date:   2026-07-07 (Tue, 07 Jul 2026)

  Changed paths:
    A JSTests/wasm/stress/stack-trace-streaming-name-section.js
    M Source/JavaScriptCore/wasm/WasmCallee.cpp
    M Source/JavaScriptCore/wasm/WasmCallee.h
    M Source/JavaScriptCore/wasm/WasmIPIntPlan.cpp

  Log Message:
  -----------
  No names in Error's stacktrace for instantiateStreaming modules
https://bugs.webkit.org/show_bug.cgi?id=318710
rdar://181523735

Reviewed by Marcus Plutowski.

The "name" custom section typically follows the code section, so during
streaming an IPIntCallee resolved its name before that section was parsed
and fell back to the numeric function index. Resolve names in
IPIntPlan::didCompleteCompilation() instead, which both the streaming and
non-streaming paths reach after the whole module is parsed and before the
callees are registered. To support this, Callee::m_indexOrName is no
longer const and now has a setIndexOrName() setter. The setter asserts the
callee is not yet registered in the CalleeRegistry to ensure we don't race
setting the name at runtime.

Test: JSTests/wasm/stress/stack-trace-streaming-name-section.js

* JSTests/wasm/stress/stack-trace-streaming-name-section.js: Added.
(makeImportObject.return.env.abort):
(makeImportObject.return.env.enlargeMemory):
(makeImportObject.return.env.getTotalMemory):
(makeImportObject.return.env.abortOnCannotGrowMemory):
(makeImportObject.return.env._emscripten_memcpy_big):
(makeImportObject.return.env.___lock):
(makeImportObject.return.env._abort):
(makeImportObject.return.env.___setErrNo):
(makeImportObject.return.env.___syscall6):
(makeImportObject.return.env.___syscall140):
(makeImportObject.return.env.___syscall146):
(makeImportObject.return.env.___syscall54):
(makeImportObject.return.env.___unlock):
(makeImportObject):
(async main):
(main.catch):
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::Callee::setIndexOrName):
* Source/JavaScriptCore/wasm/WasmCallee.h:
* Source/JavaScriptCore/wasm/WasmIPIntPlan.cpp:
(JSC::Wasm::IPIntPlan::compileFunction):
(JSC::Wasm::IPIntPlan::didCompleteCompilation):

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



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

Reply via email to