• oliver@apple.com's avatar
    Convert for-of iteration to in-band signalling so we can trivially avoid... · 393e9af9
    oliver@apple.com authored
    Convert for-of iteration to in-band signalling so we can trivially avoid unnecessary object allocation
    Reviewed by Michael Saboff.
    Switch for-of enumeration to use in band signalling to determine the end
    of iteration.  This allows us to trivially remove an otherwise unnecessary
    object allocation, and paves the way for optimised thunks in future.
    We can re-add explicit .next() functions in future that would marshall
    the true iteration functions, but for now we'll ignore them.
    This results in a huge improvement in the performance of for-of (in the order
    of 2x) but there's still a long way to go in order to get the performance to
    a satisfactory level.
    * bytecompiler/NodesCodegen.cpp:
    * runtime/ArrayIteratorPrototype.cpp:
    * runtime/CommonIdentifiers.cpp:
    * runtime/CommonIdentifiers.h:
    * runtime/Identifier.cpp:
    * runtime/JSObject.h:
    * runtime/VM.cpp:
    * runtime/VM.h:
    Update tests to reflect our non-exposure of .next()
    * js/array-iterators-expected.txt:
    * js/script-tests/array-iterators.js:
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ArrayIteratorPrototype.cpp 5.34 KB