We should have more tests of tail calls
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Sep 2017 18:16:56 +0000 (18:16 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Sep 2017 18:16:56 +0000 (18:16 +0000)
commite693d46ae4a6a0ec035bbdaf4d4e553f2e1fd876
tree172802c475183c65d86d9313f652b9806cc647cb
parentfdecbd326994dca2ff120eb984db9fbb6def9939
We should have more tests of tail calls
https://bugs.webkit.org/show_bug.cgi?id=175754

Reviewed by Sam Weinig.

This introduces a new test suite called TailBench9000, which will have benchmarks written in
JavaScript that avoid all looping except by tail call. As a warmup, I wrote a mergesort
benchmark and I proted n-body to use tail calls instead of for loops.

* TailBench9000: Added.
* TailBench9000/merge-sort-run.js: Added.
* TailBench9000/merge-sort.js: Added.
(TEST_mergeSort.createRNG):
(TEST_mergeSort.):
(TEST_mergeSort.merge):
(TEST_mergeSort.mergeSorted):
(TEST_mergeSort.checkSorted.check):
(TEST_mergeSort.checkSorted):
(TEST_mergeSort.add):
(TEST_mergeSort.build):
(TEST_mergeSort.compare):
(TEST_mergeSort.checkSpectrum):
(TEST_mergeSort.buildArray):
(TEST_mergeSort):
* TailBench9000/n-body-run.js: Added.
* TailBench9000/n-body.js: Added.
(TEST_nBody.Body):
(TEST_nBody.Body.prototype.offsetMomentum):
(TEST_nBody.Jupiter):
(TEST_nBody.Saturn):
(TEST_nBody.Uranus):
(TEST_nBody.Neptune):
(TEST_nBody.Sun):
(TEST_nBody.NBodySystem):
(TEST_nBody.NBodySystem.prototype.advance):
(TEST_nBody.NBodySystem.prototype.energy):
(TEST_nBody):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PerformanceTests/ChangeLog
PerformanceTests/TailBench9000/merge-sort-run.js [new file with mode: 0644]
PerformanceTests/TailBench9000/merge-sort.js [new file with mode: 0644]
PerformanceTests/TailBench9000/n-body-run.js [new file with mode: 0644]
PerformanceTests/TailBench9000/n-body.js [new file with mode: 0644]