Bug 199389 - [WHLSL] the initializer in VariableDeclaration should be a std::unique_ptr, not Optional<UniqueRef<..>>
Summary: [WHLSL] the initializer in VariableDeclaration should be a std::unique_ptr, n...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Robin Morisset
URL:
Keywords: InRadar
Depends on:
Blocks: 199695
  Show dependency treegraph
 
Reported: 2019-07-01 16:58 PDT by Robin Morisset
Modified: 2019-07-10 18:17 PDT (History)
9 users (show)

See Also:


Attachments
Patch (30.87 KB, patch)
2019-07-01 17:01 PDT, Robin Morisset
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Morisset 2019-07-01 16:58:04 PDT
Optional<UniqueRef<..>> is not only semantically weird (UniqueRef is basically a unique_ptr that promises not to be null), but also inefficient, wasting 8 bytes for the boolean in Optional.
It is a pattern that appears throughout the AST. In this patch I start by removing it in a fairly simple spot: the initializer for VariableDeclaration.
Comment 1 Robin Morisset 2019-07-01 17:01:45 PDT
Created attachment 373279 [details]
Patch
Comment 2 Robin Morisset 2019-07-02 10:47:51 PDT
Thanks for the review!
Comment 3 WebKit Commit Bot 2019-07-02 11:13:23 PDT
Comment on attachment 373279 [details]
Patch

Clearing flags on attachment: 373279

Committed r247062: <https://trac.webkit.org/changeset/247062>
Comment 4 WebKit Commit Bot 2019-07-02 11:13:25 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2019-07-02 11:14:21 PDT
<rdar://problem/52534524>