[webkit-dev] Smart Pointer Analysis Tool for WebKit

Darin Adler darin at apple.com
Wed Sep 23 10:32:10 PDT 2020


> On Sep 16, 2020, at 11:32 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> Every data member to a ref counted object must use either Ref, RefPtr, or WeakPtr. webkit.NoUncountedMemberChecker <https://github.com/llvm/llvm-project/blob/master/clang/docs/analyzer/checkers.rst#id17>My only worry here is performance. Do we know yet if we can afford it?

The worst case here is Ref, which is much worse than a reference since we end up having to use -> instead of . everywhere and you can’t see that there is no null involved.
> Every ref counted base class, if it has a derived class, must define a virtual destructor. webkit.RefCntblBaseVirtualDtor <https://github.com/llvm/llvm-project/blob/master/clang/docs/analyzer/checkers.rst#id16>The style system has an optimization that intentionally violates this for performance reasons (StyleRuleBase).
> Every ref counted object passed to a non-trivial function as an argument (including "this" pointer) should be stored as a Ref or RefPtr in the caller’s local scope unless it's an argument to the caller itself by transitive property [1]. alpha.webkit.UncountedCallArgsChecker <https://github.com/llvm/llvm-project/blob/master/clang/docs/analyzer/checkers.rst#id21>What is a non-trivial function?
> Every ref counted object must be captured using Ref or RefPtr for lambda. webkit.UncountedLambdaCapturesChecker <https://github.com/llvm/llvm-project/blob/master/clang/docs/analyzer/checkers.rst#id18>Ref, RefPtr, or WeakPtr, right?

Same concern about Ref vs references.
> Local variables - we’re still working on this (https://reviews.llvm.org/D83259 <https://reviews.llvm.org/D83259>)
I am looking forward to learning more about the proposal here.

Same concern about Ref vs. references.

I really want to see before/after for some non-trivial source files with significant problems; where will this drive the most change and what will things look like after?

— Darin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20200923/17dfd9d5/attachment.htm>


More information about the webkit-dev mailing list