Go to file
adamk@chromium.org 7c300d1f83 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
TBR=mstarzinger@chromium.org

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20823 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-16 21:12:27 +00:00
benchmarks Fix bug in nextWeaker function of deltablue benchmark. 2013-10-25 13:21:46 +00:00
build ARM64: Fix native builds 2014-04-16 13:25:15 +00:00
include Removed GetDefaultIsolate{Debugger,ForLocking,StackGuard}. 2014-04-15 07:47:33 +00:00
samples New Compilation API, part 1, try 2 2014-03-14 10:20:33 +00:00
src ES6: Add support for Map/Set forEach 2014-04-16 21:12:27 +00:00
test ES6: Add support for Map/Set forEach 2014-04-16 21:12:27 +00:00
tools MIPS: Add big-endian support for MIPS. 2014-04-15 16:39:21 +00:00
.clang-format Change clang-format config to allow for two empty lines between functions 2013-12-03 10:39:21 +00:00
.gitignore Add support for GNU GLOBAL. 2014-04-08 06:19:05 +00:00
AUTHORS Add ARM contributors to AUTHORS. 2014-02-12 11:54:34 +00:00
ChangeLog Reset change log and version to current trunk. 2014-04-15 12:05:45 +00:00
codereview.settings Add settings for try server. 2013-12-17 12:24:25 +00:00
DEPS Roll ICU 239289:258359 and add support for external ICU data tables 2014-03-25 12:05:33 +00:00
LICENSE Update LICENSE date. 2014-02-18 10:50:22 +00:00
LICENSE.strongtalk Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
LICENSE.v8 Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
LICENSE.valgrind Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
Makefile MIPS: Add big-endian support for MIPS. 2014-04-15 16:39:21 +00:00
Makefile.android Fix android_arm64 target for experimental ndk 2014-04-10 21:28:40 +00:00
Makefile.nacl Fix standalone Android and NaCl Makefiles to support arm_version=7 and optdebug 2013-12-16 15:50:34 +00:00
OWNERS Add rmcilroy@chromium.org to src/OWNERS. 2014-04-11 08:55:18 +00:00
PRESUBMIT.py Update tryserver configuration with new linux and arm bots. 2014-04-01 13:43:32 +00:00
WATCHLISTS Add myself to a watchlist for the public API. 2013-10-10 11:37:48 +00:00