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.
Created attachment 373413 [details] Patch
Comment on attachment 373413 [details] Patch Clearing flags on attachment: 373413 Committed r247110: <https://trac.webkit.org/changeset/247110>
All reviewed patches have been landed. Closing bug.
<rdar://problem/52614048>