[webkit-changes] [WebKit/WebKit] 7dcd9c: Enhance genericTypedArrayViewProtoFuncSortImpl to ...
Commit Queue
noreply at github.com
Sun Dec 3 23:30:10 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7dcd9cb1553ae285bbac270e2ddfd93c55988595
https://github.com/WebKit/WebKit/commit/7dcd9cb1553ae285bbac270e2ddfd93c55988595
Author: Mark Lam <mark.lam at apple.com>
Date: 2023-12-03 (Sun, 03 Dec 2023)
Changed paths:
A JSTests/stress/typedarray-sort-out-of-memory.js
M Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h
M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h
M Source/WTF/wtf/Vector.h
Log Message:
-----------
Enhance genericTypedArrayViewProtoFuncSortImpl to also handle an OutOfMemory case.
https://bugs.webkit.org/show_bug.cgi?id=265743
rdar://119042412
Reviewed by Yusuke Suzuki.
1. Add a Vector::tryGrow implementation.
2. Make JSGenericTypedArrayView<Adaptor>::sort return a SortResult.
3. Make clients of sort also check for the OutOfMemory error case, and throw an
OutOfMemoryError.
* JSTests/stress/typedarray-sort-out-of-memory.js: Added.
(catch):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h:
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::sort):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncSortImpl):
* Source/WTF/wtf/Vector.h:
(WTF::Vector::grow):
(WTF::Vector::tryGrow):
(WTF::Malloc>::growImpl):
(WTF::Malloc>::grow): Deleted.
Canonical link: https://commits.webkit.org/271457@main
More information about the webkit-changes
mailing list