Bug 274723

Summary: Refactor LLInt::Data::performAssertions() into assertInvariants().
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Mark Lam 2024-05-25 20:51:48 PDT
The intent of LLInt::Data::performAssertions() was to assert some invariants that cannot be expressed as static_asserts, or did not have a convenient place to express the static_asserts because they are about constants used in the LLInt asm files.  These asserts need only be executed once.  At the time, I added a call to performAssertions() from the VM constructor.  The better place to call it would be from JSC::initialize(), which is only executed once per process.

Additionally, over time, we started using this function to assert other invariants.  Hence, we should rename it and put it in a place not associated with the LLInt specifically.

Lastly, replace all uses of the antiquated STATIC_ASSERT macro with static_assert.
Comment 1 Radar WebKit Bug Importer 2024-05-25 20:52:07 PDT
<rdar://problem/128746336>
Comment 2 Mark Lam 2024-05-25 21:00:17 PDT
Pull request: https://github.com/WebKit/WebKit/pull/29121
Comment 3 EWS 2024-05-25 22:39:55 PDT
Committed 279327@main (491e7dba5234): <https://commits.webkit.org/279327@main>

Reviewed commits have been landed. Closing PR #29121 and removing active labels.