Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: ee14117b52dfe690f421ca4ca3d8aecc8d875b1c https://github.com/WebKit/WebKit/commit/ee14117b52dfe690f421ca4ca3d8aecc8d875b1c Author: Yusuke Suzuki <ysuz...@apple.com> Date: 2025-08-07 (Thu, 07 Aug 2025)
Changed paths: M JSTests/stress/destructuring-assignment-syntax.js M JSTests/test262/expectations.yaml M LayoutTests/js/parser-syntax-check-expected.txt M Source/JavaScriptCore/parser/Parser.cpp M Source/JavaScriptCore/parser/Parser.h M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm Log Message: ----------- [JSC] Remove ExpressionErrorClassifier https://bugs.webkit.org/show_bug.cgi?id=297037 rdar://157720923 Reviewed by Yijia Huang. ExpressionErrorClassifier in JS Parser is overly complicated and slow. We can handle backtracking much more efficiently and simply. This patch improves the parser code and removes ExpressionErrorClassifier to improve performance and simplify the code. We also fix semantic issue tested via test262. We should retry destructuring parsing even though we are not encountering `=` since we may fail in the object literal parsing before that. We also change Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm from '[' to {'. Because of the optimization, now we can handle this amount of array creation, and this test was expecting that we will hit stack overflow quickly. Changing it to `{` to keep the intent of the test. * JSTests/stress/destructuring-assignment-syntax.js: * JSTests/test262/expectations.yaml: * LayoutTests/js/parser-syntax-check-expected.txt: * Source/JavaScriptCore/parser/Parser.cpp: (JSC::Parser<LexerType>::Parser): (JSC::Parser<LexerType>::parseObjectRestAssignmentElement): (JSC::Parser<LexerType>::parseDestructuringPattern): (JSC::Parser<LexerType>::parseAssignmentExpression): (JSC::Parser<LexerType>::parseAwaitExpression): (JSC::Parser<LexerType>::parseProperty): (JSC::Parser<LexerType>::parseArrayLiteral): (JSC::Parser<LexerType>::parseMemberExpression): (JSC::Parser<LexerType>::parseAssignmentExpressionOrPropagateErrorClass): Deleted. * Source/JavaScriptCore/parser/Parser.h: (JSC::Parser::ExpressionErrorClassifier::ExpressionErrorClassifier): Deleted. (JSC::Parser::ExpressionErrorClassifier::~ExpressionErrorClassifier): Deleted. (JSC::Parser::ExpressionErrorClassifier::classifyExpressionError): Deleted. (JSC::Parser::ExpressionErrorClassifier::forceClassifyExpressionError): Deleted. (JSC::Parser::ExpressionErrorClassifier::reclassifyExpressionError): Deleted. (JSC::Parser::ExpressionErrorClassifier::propagateExpressionErrorClass): Deleted. (JSC::Parser::ExpressionErrorClassifier::indicatesPossiblePattern const): Deleted. (JSC::Parser::ExpressionErrorClassifier::indicatesPossibleAsyncArrowFunction const): Deleted. (JSC::Parser::classifyExpressionError): Deleted. (JSC::Parser::forceClassifyExpressionError): Deleted. (JSC::Parser::reclassifyExpressionError): Deleted. * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm: (ReturnTypes)): Canonical link: https://commits.webkit.org/298364@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes