Reviewers: adamk, danno,

Message:
Danno,

Since the MapIterator.prototype.next and SetIterator.prototype.next always needs
to generate a new array if the iterator kind is entries, and since we do not
know the kind we need on the JS side I ended up keeping the original Next()
method.

Description:
Optimize Map/Set.prototype.forEach

Instead of using an iterator result object and an entries array
(for Map) we introduce a new runtime function that uses an array
as an out param.

On the Map ForEach test this leads to a 2.5x performance
improvement. On the overall Map and Set tests this leads to a 18%
and 13% improvement respectively.


BUG=None
LOG=Y

Please review this at https://codereview.chromium.org/355663002/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+181, -69 lines):
  M src/collection.js
  M src/objects.h
  M src/objects.cc
  M src/objects-inl.h
  M src/runtime.h
  M src/runtime.cc
  A + test/mjsunit/runtime-gen/mapiteratornextforeach.js
  A + test/mjsunit/runtime-gen/setiteratornextforeach.js
  M tools/generate-runtime-tests.py


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to