Summary: | [WHLSL] The recursion checker should not have quadratic complexity | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Robin Morisset <rmorisset> | ||||||||
Component: | WebGPU | Assignee: | Robin Morisset <rmorisset> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | commit-queue, saam, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=199835 | ||||||||||
Attachments: |
|
Description
Robin Morisset
2019-07-10 15:58:38 PDT
Created attachment 373878 [details]
Patch
Comment on attachment 373878 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373878&action=review > Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:47 > + void visit(Program& program) override > + { > + for (auto& functionDefinition : program.functionDefinitions()) > + checkErrorAndVisit(functionDefinition); > + } Nice. We should probably do this in more phases. > Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:62 > + auto addResult2 = m_finishedVisiting.add(&functionDefinition); > + ASSERT_UNUSED(addResult2, addResult2); this probably doesn't compile on debug builds. You want addResult2.isNewEntry. Also, can you just give it its own scope instead of calling it addResult2? Or perhaps limit scope to above addResult? Created attachment 373880 [details]
Patch
Created attachment 373881 [details]
Patch
Comment on attachment 373881 [details] Patch Clearing flags on attachment: 373881 Committed r247339: <https://trac.webkit.org/changeset/247339> All reviewed patches have been landed. Closing bug. |