JSArray::sortNumeric should handle ArrayWithUndecided
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Apr 2015 21:14:09 +0000 (21:14 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Apr 2015 21:14:09 +0000 (21:14 +0000)
commit93d3225fd710103db5e296241e2b0574412eef57
tree351d05d75b767abba7214235d0e0cc98e971da23
parent89832cce39a40e4ba474e0cf291e2c7f857389c5
JSArray::sortNumeric should handle ArrayWithUndecided
https://bugs.webkit.org/show_bug.cgi?id=143535

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

ArrayWithUndecided is what you get if you haven't stored anything into the array yet. We need to handle it.

* runtime/JSArray.cpp:
(JSC::JSArray::sortNumeric):
* tests/stress/sort-array-with-undecided.js: Added.

LayoutTests:

Upload the original test that first spotted this. Shortened it a bit so that it runs fast enough.

* js/regress/script-tests/sorting-benchmark.js: Added.
(log):
(bottom_up_merge_sort):
(aMinusB):
(verify):
(benchmark):
(makeArrays):
* js/regress/sorting-benchmark-expected.txt: Added.
* js/regress/sorting-benchmark.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/regress/script-tests/sorting-benchmark.js [new file with mode: 0644]
LayoutTests/js/regress/sorting-benchmark-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/sorting-benchmark.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSArray.cpp
Source/JavaScriptCore/tests/stress/sort-array-with-undecided.js [new file with mode: 0644]