Bug 295796
| Summary: | CLoop::execute frame size is unreasonably large in debug builds, causing a testapi failure | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Vassili Bykov <v_bykov> |
| Component: | New Bugs | Assignee: | Vassili Bykov <v_bykov> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P3 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Vassili Bykov
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/155633380>
Vassili Bykov
Pull request: https://github.com/WebKit/WebKit/pull/47904
EWS
Committed 297283@main (a1bd6d04e39c): <https://commits.webkit.org/297283@main>
Reviewed commits have been landed. Closing PR #47904 and removing active labels.