Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bff3814d76f74308c64bd502b0630afa08c8d59b
https://github.com/WebKit/WebKit/commit/bff3814d76f74308c64bd502b0630afa08c8d59b
Author: Carlos Alberto Lopez Perez <[email protected]>
Date: 2026-08-03 (Mon, 03 Aug 2026)
Changed paths:
M JSTests/wasm/stress/type-index-abstract-heap-types-concrete-vs-abstract.js
M JSTests/wasm/stress/type-index-abstract-heap-types-globals-and-tables.js
M JSTests/wasm/stress/type-index-abstract-heap-types-nulls-and-casts.js
M JSTests/wasm/stress/type-index-abstract-heap-types-subtype-validation.js
M Source/JavaScriptCore/runtime/VM.cpp
Log Message:
-----------
[JSC][Linux] Don't re-read /proc/self/maps when handling checkpoint OSR side
state
https://bugs.webkit.org/show_bug.cgi?id=320559
Reviewed by Yusuke Suzuki and Justin Michaud.
VM::pushCheckpointOSRSideState() has an ASSERT_ENABLED block that checks
that the side state stack remains ordered. To do so, it needs the current
thread stack bounds.
It obtained them using StackBounds::currentThreadStackBounds(), which does
not cache the result. On Linux, this calls pthread_getattr_np(), which glibc
implements for the main thread by opening and parsing /proc/self/maps.
Each call makes the kernel generate a list of the process memory mappings
and then makes glibc parse that list.
While running wasm/stress/type-index-abstract-heap-types-nulls-and-casts.js
in wasm-eager mode, profiling showed about ~45% of samples in kernel code
generating /proc/self/maps and another ~30% in libc parsing it. The test
opened /proc/self/maps hundreds of times through repeated calls to
VM::pushCheckpointOSRSideState().
Thread::m_stack is initialized using StackBounds::currentThreadStackBounds()
and cached for the lifetime of the thread. Thread::currentSingleton().stack()
therefore provides the cached bounds without repeating the OS query.
logSanitizeStack() in the same file already uses this cached value.
Switch both call sites in VM.cpp to the cached bounds. This keeps the
relevant stack consistency assertions checks without asking the operating
system to recalculate information that the thread already stores.
popAllCheckpointOSRSideStateUntil() is not assertion-only: it uses the
bounds as part of its normal operation. This change therefore also avoids
the same cost in release builds.
With this change, on a Release+Asserts WPE build, `run-jsc-stress-tests \
--filter wasm.yaml/wasm/stress/type-index-abstract-heap-types` completes
in about five minutes. Previously, it could take around one hour, and the
tests would usually time out.
* JSTests/wasm/stress/type-index-abstract-heap-types-concrete-vs-abstract.js:
* JSTests/wasm/stress/type-index-abstract-heap-types-globals-and-tables.js:
* JSTests/wasm/stress/type-index-abstract-heap-types-nulls-and-casts.js:
* JSTests/wasm/stress/type-index-abstract-heap-types-subtype-validation.js:
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::pushCheckpointOSRSideState):
(JSC::VM::popAllCheckpointOSRSideStateUntil):
Canonical link: https://commits.webkit.org/318487@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications