RESOLVED FIXED295796
CLoop::execute frame size is unreasonably large in debug builds, causing a testapi failure
https://bugs.webkit.org/show_bug.cgi?id=295796
Summary CLoop::execute frame size is unreasonably large in debug builds, causing a te...
Vassili Bykov
Reported 2025-07-11 11:41:36 PDT
This issue is the cause of 'Sequoia F Debug on x86_64' failures in https://results.webkit.org/?suite=javascriptcore-tests&test=testapi. The failure is at the last line of 'TestAPI::proxyReturnedWithJSSubclassing()' in 'testapi.cpp'. That check fails, but the reason for the failure is not 'subclass.__proto__ == Superclass.prototype' evaluating to false. It fails with a stack overflow because evaluating that expression in this particular setup involving a proxy requires 3 nested calls to CLoop::execute. Compiled with -O0, the frame size of that function is around 250k, and there is not enough room on the stack to hold 3 of them. The reason for this frame bloat is the way 'std::bit_cast' is compiled with -O0. Every call site introduces a pointer-sized frame slot, and between the opcode table initialization and the interpreter code included from LLintAssembly.h there are over 15,000 such sites. Replacing these with 'static_cast' or 'reinterpret_cast' as appropriate reduces the frame size by more than half. A good chunk of the remaining frame space is occupied by 'UGPRPair' slots, which at -O0 are kept distinct by clang despite their very limited scopes. But getting rid of those would require deeper changes in CLoop's code generation.
Attachments
Radar WebKit Bug Importer
Comment 1 2025-07-11 11:41:49 PDT
Vassili Bykov
Comment 2 2025-07-11 12:02:16 PDT
EWS
Comment 3 2025-07-11 14:50:41 PDT
Committed 297283@main (a1bd6d04e39c): <https://commits.webkit.org/297283@main> Reviewed commits have been landed. Closing PR #47904 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.