[webkit-reviews] review granted: [Bug 193434] [WHLSL] Implement the loop checker : [Attachment 359135] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jan 15 12:33:31 PST 2019
Saam Barati <sbarati at apple.com> has granted Myles C. Maxfield
<mmaxfield at apple.com>'s request for review:
Bug 193434: [WHLSL] Implement the loop checker
https://bugs.webkit.org/show_bug.cgi?id=193434
Attachment 359135: Patch
https://bugs.webkit.org/attachment.cgi?id=359135&action=review
--- Comment #5 from Saam Barati <sbarati at apple.com> ---
Comment on attachment 359135
--> https://bugs.webkit.org/attachment.cgi?id=359135
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=359135&action=review
LGTM
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:44
> +class LoopChecker : public Visitor {
I feel like a comment explaining what this does would be helpful.
"findHighZombies" is not the most intuitive name.
>> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:53
>> + if (m_loopDepth || m_switchDepth) {
>
> Not sure this part is necessary: I don't think we allow function definitions
within the bodies of other functions anyway.
Perhaps an assert?
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:54
> + setError();
I haven't reviewed other changes, so this is just a general comment, but don't
we want error messages here?
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:64
> + ++m_loopDepth;
style: Maybe use:
SetForScope scope(m_loopDepth, m_loopDepth + 1) ?
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:72
> + ++m_loopDepth;
ditto
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:82
> + WTF::visit(WTF::makeVisitor([&](AST::VariableDeclarationsStatement&
variableDeclarationsStatement) {
style: maybe auto&?
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:84
> + }, [&](UniqueRef<AST::Expression>& expression) {
style: maybe auto&?
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:92
> + ++m_loopDepth;
ditto about SetForScope
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:102
> + ++m_switchDepth;
ditto SetForScope
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:149
> +}
> +
> +}
Should we add the `// namespace X` comments here?
More information about the webkit-reviews
mailing list