Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3a9af61361977e1f775f847136d0cf239182c526
https://github.com/WebKit/WebKit/commit/3a9af61361977e1f775f847136d0cf239182c526
Author: Yusuke Suzuki <[email protected]>
Date: 2023-05-05 (Fri, 05 May 2023)
Changed paths:
A JSTests/stress/JSON-parse-should-cache-array-lengths-complex.js
A JSTests/stress/json-parse-256-complex.js
A JSTests/stress/json-parse-array-prototype-is-array-assert-complex.js
A JSTests/stress/json-parse-big-object-complex.js
A JSTests/stress/json-parse-empty-objects-complex.js
A JSTests/stress/json-parse-empty-objects.js
A JSTests/stress/json-parse-on-frozen-object-complex.js
A JSTests/stress/json-parse-reviver-array-proxy-complex.js
A JSTests/stress/json-parse-reviver-revoked-proxy-complex.js
A JSTests/stress/json-parse-syntax-complex.js
A JSTests/stress/json-parse-very-nested-complex.js
A JSTests/stress/json-parse-very-nested.js
A LayoutTests/js/JSON-parse-reviver-complex-expected.txt
A LayoutTests/js/JSON-parse-reviver-complex.html
M LayoutTests/js/JSON-parse-reviver.html
A LayoutTests/js/dom/JSON-parse-complex-expected.txt
A LayoutTests/js/dom/JSON-parse-complex.html
M LayoutTests/js/dom/JSON-parse.html
M Source/JavaScriptCore/runtime/LiteralParser.cpp
M Source/JavaScriptCore/runtime/LiteralParser.h
M Source/JavaScriptCore/runtime/OptionsList.h
M Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
Log Message:
-----------
[JSC] JSON.parse should use simple recursion until it hits soft-recursion
threshold
https://bugs.webkit.org/show_bug.cgi?id=256349
rdar://108930906
Reviewed by Alexey Shvayka and Alexey Proskuryakov.
Let's do super simple JSON.parse until it hits soft-recursion threshold. Our
existing code
handles JSON.parse without recursion, this is great, but it is very
complicated. And most of
JSON can be parsed with recursion with the current stack capacity. Let's start
with super
simple recursion path, and check soft stack limit carefully. And if we hit,
then stop the
recursion and fallback to our generic code. Good thing is that JSON's leaf
object creation
is isolated, so we can start this generic code at any time. We can repeatedly
enter and exit
this.
ToT
Patched
vanilla-es2015-babel-webpack-todomvc-json-parse
63.0883+-0.1159 ^
58.6921+-0.1383 ^ definitely 1.0749x faster
flight-todomvc-json-parse 28.3211+-0.0977 ^
25.8927+-0.1618 ^ definitely 1.0938x faster
vanilla-es2015-todomvc-json-parse 63.1916+-0.2224 ^
58.8631+-0.2339 ^ definitely 1.0735x faster
vanilla-todomvc-json-parse 46.7609+-0.1348 ^
43.9075+-0.1779 ^ definitely 1.0650x faster
* Source/JavaScriptCore/runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::tryJSONPParse):
(JSC::LiteralParser<CharType>::Lexer::next):
(JSC::LiteralParser<CharType>::parseRecursivelyEntry):
(JSC::LiteralParser<CharType>::parseRecursively):
(JSC::LiteralParser<CharType>::parse):
* Source/JavaScriptCore/runtime/LiteralParser.h:
(JSC::LiteralParser::tryLiteralParse):
Canonical link: https://commits.webkit.org/263744@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes