Title: [246520] trunk/Source/WebCore
Revision
246520
Author
[email protected]
Date
2019-06-17 16:07:32 -0700 (Mon, 17 Jun 2019)

Log Message

[WHLSL] Remove backtracking from parseAttributeBlock
https://bugs.webkit.org/show_bug.cgi?id=198934

Reviewed by Myles C. Maxfield.

No functional change intended.

Tested by running LayoutTests/webgpu/whlsl-compute.html

* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parseAttributeBlock):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (246519 => 246520)


--- trunk/Source/WebCore/ChangeLog	2019-06-17 22:27:26 UTC (rev 246519)
+++ trunk/Source/WebCore/ChangeLog	2019-06-17 23:07:32 UTC (rev 246520)
@@ -1,3 +1,17 @@
+2019-06-17  Robin Morisset  <[email protected]>
+
+        [WHLSL] Remove backtracking from parseAttributeBlock
+        https://bugs.webkit.org/show_bug.cgi?id=198934
+
+        Reviewed by Myles C. Maxfield.
+
+        No functional change intended.
+
+        Tested by running LayoutTests/webgpu/whlsl-compute.html
+
+        * Modules/webgpu/WHLSL/WHLSLParser.cpp:
+        (WebCore::WHLSL::Parser::parseAttributeBlock):
+
 2019-06-17  Saam Barati  <[email protected]>
 
         [WHLSL] Make .length work

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp (246519 => 246520)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp	2019-06-17 22:27:26 UTC (rev 246519)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp	2019-06-17 23:07:32 UTC (rev 246520)
@@ -854,19 +854,12 @@
     AST::AttributeBlock result;
 
     while (true) {
-        auto numThreadsFunctionAttribute = backtrackingScope<Expected<AST::NumThreadsFunctionAttribute, Error>>([&]() {
-            return parseNumThreadsFunctionAttribute();
-        });
-        if (numThreadsFunctionAttribute) {
-            result.append(WTFMove(*numThreadsFunctionAttribute));
-            continue;
-        }
-
-        break;
+        if (tryType(Lexer::Token::Type::RightSquareBracket))
+            break;
+        PARSE(numThreadsFunctionAttribute, NumThreadsFunctionAttribute);
+        result.append(WTFMove(*numThreadsFunctionAttribute));
     }
 
-    CONSUME_TYPE(rightSquareBracket, RightSquareBracket);
-
     return WTFMove(result);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to