Bug 262498

Summary: Use StringView in CSSParserToken and simplify its code
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: CSSAssignee: Chris Dumez <cdumez>
Status: REOPENED ---    
Severity: Normal CC: commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 263153    
Bug Blocks:    

Description Chris Dumez 2023-10-02 12:50:43 PDT
Use StringView in CSSParserToken and simplify its code.

Previously, CSSParserToken wasn't using StringView internally for better bit packing, as the size of this object matters a lot.
Instead, do better bit packing in StringView so that CSSParserToken can use it without increasing its size (24 bits on my macBookPro M1).

To better bit-pack StringView, we rely on PackedPtr to fit the is8Bit flag in the same word as the character pointer.

This is performance neutral on Speedometer.
Comment 1 Chris Dumez 2023-10-02 12:53:51 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18508
Comment 2 EWS 2023-10-02 20:09:40 PDT
Committed 268760@main (855b9cf6ef5a): <https://commits.webkit.org/268760@main>

Reviewed commits have been landed. Closing PR #18508 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-10-02 20:10:15 PDT
<rdar://problem/116381450>
Comment 4 WebKit Commit Bot 2023-10-13 19:22:07 PDT
Re-opened since this is blocked by bug 263153