[WHLSL] Implement the recursion checker
Created attachment 359138 [details] Patch
Comment on attachment 359138 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359138&action=review > Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:62 > + void visit(AST::FunctionDefinition& functionDefinition) override > + { > + auto addResult = m_visitingSet.add(&functionDefinition); > + if (!addResult.isNewEntry) { > + setError(); > + return; > + } > + > + Visitor::visit(functionDefinition); > + > + auto success = m_visitingSet.remove(&functionDefinition); > + ASSERT_UNUSED(success, success); > + } > + > + void visit(AST::CallExpression& callExpression) override > + { > + ASSERT(callExpression.function()); > + Visitor::visit(*callExpression.function()); > + } These can be private.
Comment on attachment 359138 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359138&action=review > Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:42 > + RecursionChecker() = default; > + > + virtual ~RecursionChecker() = default; These can be omitted because this is what will be generated if you don’t write anything.
Comment on attachment 359138 [details] Patch Attachment 359138 [details] did not pass mac-debug-ews (mac): Output: https://webkit-queues.webkit.org/results/10755536 New failing tests: compositing/backing/animate-into-view.html
Created attachment 359143 [details] Archive of layout-test-results from ews115 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-highsierra Platform: Mac OS X 10.13.6
Created attachment 359225 [details] Patch
Comment on attachment 359225 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359225&action=review > Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:53 > + auto success = m_visitingSet.remove(&functionDefinition); Each AST node representing a call to a function “foo” points to the same memory location?
Comment on attachment 359225 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359225&action=review >> Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:53 >> + auto success = m_visitingSet.remove(&functionDefinition); > > Each AST node representing a call to a function “foo” points to the same memory location? Yes. Each function definition is a single object in the AST, and all calls to it have a .function() that points to it.
Committed r240096: <https://trac.webkit.org/changeset/240096>
<rdar://problem/47335051>