Bug 199462

Summary: [WHLSL] "Semantic" should be held by a unique_ptr, not an Optional
Product: WebKit Reporter: Robin Morisset <rmorisset>
Component: WebGPUAssignee: Robin Morisset <rmorisset>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Robin Morisset
Reported 2019-07-03 13:48:18 PDT
Most StructureElement, FunctionDeclaration and (especially) VariableDeclaration don't have a 'Semantic' field. Using an Optional<Semantic> to represent this is a major memory waste, as Semantic is 56 bytes, so Optional<Semantic> is 64 bytes! Putting one level of indirection through a unique_ptr thus saves 56 bytes for each VariableDeclaration (and FunctionDeclaration and StructureElement) that does not have a Semantic, at the low cost of one pointer dereference when accessing the field for those that have one.
Attachments
Patch (41.46 KB, patch)
2019-07-03 13:51 PDT, Robin Morisset
no flags
Robin Morisset
Comment 1 2019-07-03 13:51:56 PDT
WebKit Commit Bot
Comment 2 2019-07-03 15:11:42 PDT
Comment on attachment 373413 [details] Patch Clearing flags on attachment: 373413 Committed r247110: <https://trac.webkit.org/changeset/247110>
WebKit Commit Bot
Comment 3 2019-07-03 15:11:43 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 4 2019-07-03 15:12:19 PDT
Note You need to log in before you can comment on or make changes to this bug.