Optimize Map/Set.prototype.forEach
authordanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 26 Jun 2014 00:40:45 +0000 (00:40 +0000)
committerdanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 26 Jun 2014 00:40:45 +0000 (00:40 +0000)
commit8313c523b357ab6b7caacc1db12b3f266c31ae07
tree8f293f2548c8f4f8c068a309413274d59eae9e20
parent53c540a03389e56e1e7592eaad0ae5651cf2d6db
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 perf 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
R=danno@chromium.org

Review URL: https://codereview.chromium.org/355663002

Patch from Erik Arvidsson <arv@chromium.org>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22027 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/collection-iterator.js
src/collection.js
src/factory.cc
src/factory.h
src/objects-inl.h
src/objects.cc
src/objects.h
src/runtime.cc
src/runtime.h
test/mjsunit/runtime-gen/mapiteratornext.js
test/mjsunit/runtime-gen/setiteratornext.js