Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8f7132dd0edc7900ce7a7d3c9614cb30229bb72d
https://github.com/WebKit/WebKit/commit/8f7132dd0edc7900ce7a7d3c9614cb30229bb72d
Author: Sosuke Suzuki <[email protected]>
Date: 2026-05-03 (Sun, 03 May 2026)
Changed paths:
A JSTests/modules/async-gather-diamond.js
A JSTests/modules/async-gather-diamond/A.js
A JSTests/modules/async-gather-diamond/B.js
A JSTests/modules/async-gather-diamond/C.js
A JSTests/modules/async-gather-diamond/leaf.js
A JSTests/modules/async-gather-diamond/log.js
M Source/JavaScriptCore/runtime/CyclicModuleRecord.cpp
Log Message:
-----------
[JSC] Make `GatherAvailableAncestors` O(N) instead of O(N^2)
https://bugs.webkit.org/show_bug.cgi?id=313753
Reviewed by Yusuke Suzuki.
The spec's "execList does not contain m" check [1] was implemented with
Vector::contains, making each gather call O(N^2) over a sync-parent
cascade. Replace it with "m.[[PendingAsyncDependencies]] != 0", which
is equivalent within a single gather call (spec step 1.a.iv guarantees
one direction; the other follows from pending only being driven to 0
inside step 1.a.v + 1.a.vi.1, with no concurrent mutation). V8 DCHECKs
the same invariant [2].
Both directions are verified by ASSERT.
[1]: https://tc39.es/ecma262/#sec-gather-available-ancestors
[2]:
https://github.com/v8/v8/blob/82ed9d774565c1c6192d0e83e2ee9ad1360670c6/src/objects/source-text-module.cc#L814-L820
* JSTests/modules/async-gather-diamond.js: Added.
* JSTests/modules/async-gather-diamond/A.js: Added.
* JSTests/modules/async-gather-diamond/B.js: Added.
* JSTests/modules/async-gather-diamond/C.js: Added.
* JSTests/modules/async-gather-diamond/leaf.js: Added.
* JSTests/modules/async-gather-diamond/log.js: Added.
* Source/JavaScriptCore/runtime/CyclicModuleRecord.cpp:
(JSC::gatherAvailableAncestors):
Canonical link: https://commits.webkit.org/312498@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications