Bug 251883 - WTF::ThreadSafeWeakPtrControlBlock::strongDeref() should use constexpr
Summary: WTF::ThreadSafeWeakPtrControlBlock::strongDeref() should use constexpr
Status: CLOSED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-02-07 13:31 PST by David Kilzer (:ddkilzer)
Modified: 2023-02-08 08:18 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2023-02-07 13:31:23 PST
WTF::ThreadSafeWeakPtrControlBlock::strongDeref() should use constexpr.

While working on another patch, I realized that WTF::ThreadSafeWeakPtrControlBlock::strongDeref() could use constexpr instead of a switch statement.

The switch statement is kept in Debug builds in case an enum value is added to DestructionThread.
Comment 1 Radar WebKit Bug Importer 2023-02-07 13:35:27 PST
<rdar://problem/105143972>
Comment 2 David Kilzer (:ddkilzer) 2023-02-07 13:37:28 PST
Pull request: https://github.com/WebKit/WebKit/pull/9779
Comment 3 David Kilzer (:ddkilzer) 2023-02-08 08:18:49 PST
Alex notes that the switch statement is already optimized out, so the constexpr isn't needed.