Optimize Array.join and Array.reverse for high speed array types
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jun 2015 04:32:24 +0000 (04:32 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jun 2015 04:32:24 +0000 (04:32 +0000)
commitb08ada5e8028b79151d0bf20ab1e305646924459
treeacb6f19179117bbf150c5ae997806dfc0358366f
parentb9bcbdc969206fc6a40f4a9f34b04a02cf70ccd2
Optimize Array.join and Array.reverse for high speed array types
https://bugs.webkit.org/show_bug.cgi?id=146275

Reviewed by Mark Lam.

This seems to yield another 17% speed improvement in the array
test from the Peacekeeper benchmark.

* runtime/ArrayPrototype.cpp:
(JSC::isHole): Added. Helper to check for holes.
(JSC::containsHole): Ditto.
(JSC::arrayProtoFuncJoin): Added special cases for the various types
of arrays that could be in a butterfly.
(JSC::arrayProtoFuncReverse): Ditto.

* runtime/JSStringJoiner.h: Made appendEmptyString public so we can
call it from the new parts of Array.join.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185942 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/ArrayPrototype.cpp
Source/JavaScriptCore/runtime/JSStringJoiner.h