[Webkit-unassigned] [Bug 170316] WebAssembly: Ref count Signature and SignatureInformation should not care about VM

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 31 12:03:50 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=170316

--- Comment #8 from Saam Barati <sbarati at apple.com> ---
Comment on attachment 305943
  --> https://bugs.webkit.org/attachment.cgi?id=305943
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=305943&action=review

>>>> Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:412
>>>> +auto B3IRGenerator::addArguments(const RefPtr<Signature>& signature) -> PartialResult
>>> 
>>> style: Revert this or use Signature& here. It's an anti-pattern to use a ref to a container class when the function isn't going hold any reference anyway.
>> 
>> I don't agree. I made "const RefPtr<Signature>&" precisely because the function doesn't need to ref it.
> 
> I misread your comment. Anyways, I still don't agree. We use this pattern all over the place in JSC.

Also, I think the const RefPtr<Signature>& does communicate something to us here. It says somebody calling us is ensuring the proper lifetime. I think it's an information regression to use Signature*. I can see an argument for using Signature&, but I like knowing when something is ref counted.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170331/f719a4d1/attachment.html>


More information about the webkit-unassigned mailing list