Ignore:
Timestamp:
Apr 14, 2014, 9:19:58 AM (11 years ago)
Author:
[email protected]
Message:

Array.prototype.concat should allocate output storage only once.
<https://webkit.org/b/131609>

Do a first pass across 'this' and any arguments to compute the
final size of the resulting array from Array.prototype.concat.
This avoids having to grow the output incrementally as we go.

This also includes two other micro-optimizations:

  • Mark getProperty() with ALWAYS_INLINE.
  • Use JSArray::length() instead of taking the generic property lookup path when we know an argument is an Array.

My MBP says ~3% progression on Dromaeo/jslib-traverse-jquery.

Reviewed by Darin Adler.

  • runtime/ArrayPrototype.cpp:

(JSC::getProperty):
(JSC::arrayProtoFuncConcat):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r167220 r167249  
     12014-04-14  Andreas Kling  <[email protected]>
     2
     3        Array.prototype.concat should allocate output storage only once.
     4        <https://webkit.org/b/131609>
     5
     6        Do a first pass across 'this' and any arguments to compute the
     7        final size of the resulting array from Array.prototype.concat.
     8        This avoids having to grow the output incrementally as we go.
     9
     10        This also includes two other micro-optimizations:
     11
     12        - Mark getProperty() with ALWAYS_INLINE.
     13
     14        - Use JSArray::length() instead of taking the generic property
     15          lookup path when we know an argument is an Array.
     16
     17        My MBP says ~3% progression on Dromaeo/jslib-traverse-jquery.
     18
     19        Reviewed by Darin Adler.
     20
     21        * runtime/ArrayPrototype.cpp:
     22        (JSC::getProperty):
     23        (JSC::arrayProtoFuncConcat):
     24
    1252014-04-14  Benjamin Poulain  <[email protected]>
    226
Note: See TracChangeset for help on using the changeset viewer.