You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5eb574b
Browse filesBrowse the repository at this point in the historyBrowse files
[JSC] JSON.parse should build arrays without going through the generic array initialization
https://bugs.webkit.org/show_bug.cgi?id=329699
rdar://191501869
Reviewed by Sosuke Suzuki.
In this patch, we optimize materializeArray in JSON parser. It now allocates
the butterfly, fills the elements and the unused tail of the vector with plain
stores, and only then wraps it with JSArray::createWithButterfly, instead of
going through tryCreateUninitializedRestricted, ObjectInitializationScope and a
barriered copy. Butterfly::clearRange fills ranges of up to eight slots with
direct stores, and MarkedVector::append no longer takes its slow path for a
value that is not a cell once the buffer is out of line.
Tests: JSTests/stress/json-parse-array-vector-tail-no-double-shape.js
JSTests/stress/json-parse-array-vector-tail.js
* JSTests/stress/json-parse-array-vector-tail-no-double-shape.js: Added.
* JSTests/stress/json-parse-array-vector-tail.js: Added.
(shouldBe):
(checkTail):
(run):
* Source/JavaScriptCore/runtime/ButterflyInlines.h:
(JSC::Butterfly::clearRange):
* Source/JavaScriptCore/runtime/JSArray.cpp:
(JSC::JSArray::tryCreateUninitializedRestrictedButterfly):
* Source/JavaScriptCore/runtime/JSArrayInlines.h:
(JSC::JSArray::tryCreate):
* Source/JavaScriptCore/runtime/LiteralParser.cpp:
(JSC::reviverMode>::materializeArray):
* Source/JavaScriptCore/runtime/MarkedVector.cpp:
(JSC::MarkedVectorBase::slowAppend):
* Source/JavaScriptCore/runtime/MarkedVector.h:
(JSC::MarkedVector::append):
* Source/JavaScriptCore/runtime/Structure.h:
(JSC::Structure::outOfLineCapacity):
Canonical link: https://commits.webkit.org/325396@main
0 commit comments