Bug 199460 - [WHLSL] Make the destructor of VariableDeclaration non-virtual
Summary: [WHLSL] Make the destructor of VariableDeclaration non-virtual
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:
 
Reported: 2019-07-03 13:16 PDT by Robin Morisset
Modified: 2019-07-03 18:07 PDT (History)
3 users (show)

See Also:


Attachments
Patch (11.19 KB, patch)
2019-07-03 17:15 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-03 13:16:49 PDT
Three steps:
- Remove WHLSL::AST::Value, inlining it into its children (it is trivial, it just has one field m_origin with a getter and nothing else)
- Mark WHLSL::AST::VariableDeclaration final
- Now that it inherits from nothing and nothing can inherit from it, there is no reason for it to have any virtual method, including its destructor.

This not only saves 8 bytes from every variable declaration (for the virtual table pointer), it also should make destructing the AST at the end of compilation a bit faster by removing the virtual destructor call.
Comment 1 Robin Morisset 2019-07-03 17:15:48 PDT
Created attachment 373441 [details]
Patch
Comment 2 WebKit Commit Bot 2019-07-03 18:06:41 PDT
Comment on attachment 373441 [details]
Patch

Clearing flags on attachment: 373441

Committed r247124: <https://trac.webkit.org/changeset/247124>
Comment 3 WebKit Commit Bot 2019-07-03 18:06:42 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2019-07-03 18:07:16 PDT
<rdar://problem/52622361>