[webkit-reviews] review granted: [Bug 199835] [WHLSL] checkRecursiveType should not have quadratic complexity. : [Attachment 374246] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 16 15:43:32 PDT 2019


Myles C. Maxfield <mmaxfield at apple.com> has granted Robin Morisset
<rmorisset at apple.com>'s request for review:
Bug 199835: [WHLSL] checkRecursiveType should not have quadratic complexity.
https://bugs.webkit.org/show_bug.cgi?id=199835

Attachment 374246: Patch

https://bugs.webkit.org/attachment.cgi?id=374246&action=review




--- Comment #5 from Myles C. Maxfield <mmaxfield at apple.com> ---
Comment on attachment 374246
  --> https://bugs.webkit.org/attachment.cgi?id=374246
Patch

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

> Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:68
> +#define START_VISITING(t) \
> +do { \
> +    if (m_finishedVisiting.contains(t)) \
> +	   return; \
> +    auto resultStartedVisiting = m_startedVisiting.add(t); \
> +    if (!resultStartedVisiting.isNewEntry) { \
> +	   setError(); \
> +	   return; \
> +    } \
> +} while (false);
> +
> +#define END_VISITING(t) \
> +do { \
> +    auto resultFinishedVisiting = m_finishedVisiting.add(t); \
> +    ASSERT_UNUSED(resultFinishedVisiting,
resultFinishedVisiting.isNewEntry); \
> +} while (false);

Can we make this general so we can share it with RecursionChecker? And maybe
put it in ScopedSetAdder.h?

Also, can we use templates instead of preprocessor macros?


More information about the webkit-reviews mailing list