v8/test
adamk@chromium.org 3308cb5857 ES6: Add support for Map/Set forEach
This implements MapIterator and SetIterator which matches
the same constructs in the ES6 spec. However, these 2
iterators are not exposed to user code yet. They are only
used internally to implement Map.prototype.forEach and
Set.prototype.forEach.

Each iterator has a reference to the OrderedHashTable where
it directly accesses the hash table's entries.

The OrderedHashTable has a reference to the newest iterator
and each iterator has a reference to the next and previous
iterator, effectively creating a double linked list.

When the OrderedHashTable is mutated (or replaced) all the
iterators are updated.

When the iterator iterates passed the end of the data table
it closes itself. Closed iterators no longer have a
reference to the OrderedHashTable and they are removed from
the double linked list. In the case of Map/Set forEach, we
manually call Close on the iterator in case an exception was
thrown so that the iterator never reached the end.

At this point the OrderedHashTable keeps all the non finished
iterators alive but since the only thing we currently expose
is forEach there are no unfinished iterators outside a forEach
call. Once we expose the iterators to user code we will need
to make the references from the OrderedHashTable to the
iterators weak and have some mechanism to close an iterator
when it is garbage collected.

BUG=1793, 2323
LOG=Y
R=adamk@chromium.org
TBR=mstarzinger@chromium.org

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20857 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-17 17:45:32 +00:00
..
benchmarks Merge experimental/a64 to bleeding_edge. 2014-02-12 09:19:30 +00:00
cctest ES6: Add support for Map/Set forEach 2014-04-17 17:45:32 +00:00
intl Store i18n meta data in hidden symbols instead of js accessible properties 2014-04-01 10:56:16 +00:00
message Clean up some A64 specific code in common code that was introduced by A64 merge 2014-02-12 13:27:13 +00:00
mjsunit ES6: Add support for Map/Set forEach 2014-04-17 17:45:32 +00:00
mozilla MIPS: Add big-endian support for MIPS. 2014-04-15 16:39:21 +00:00
preparser Merge experimental/a64 to bleeding_edge. 2014-02-12 09:19:30 +00:00
promises-aplus Add Promises/A+ Compliance Test Suite. 2014-03-17 10:03:01 +00:00
test262 MIPS: Add big-endian support for MIPS. 2014-04-15 16:39:21 +00:00
webkit Make stray 'return' an early error 2014-04-02 12:38:01 +00:00