v8/test/mjsunit/harmony
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
..
regress Revert 20313 - "Ship promises and weak collections" 2014-03-31 12:40:32 +00:00
array-find.js Make sure files end with exactly one new line and police this in presubmit. 2013-11-22 13:50:39 +00:00
array-findindex.js Make sure files end with exactly one new line and police this in presubmit. 2013-11-22 13:50:39 +00:00
array-iterator.js Update Array Iterator to use numeric indexes 2013-08-06 13:10:07 +00:00
block-conflicts.js
block-const-assign.js
block-early-errors.js
block-for.js
block-lazy-compile.js
block-leave.js
block-let-crankshaft.js Turn on parallel recompilation for tests that assert optimization status. 2013-07-22 09:16:33 +00:00
block-let-declaration.js Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode 2014-03-11 14:39:08 +00:00
block-let-semantics.js
block-scoping.js
collections.js ES6: Add support for Map/Set forEach 2014-04-17 17:45:32 +00:00
dataview-accessors.js Fix data view accessors to throw execptions on offsets bigger than size_t. 2013-11-18 15:16:22 +00:00
debug-blockscopes.js
debug-evaluate-blockscopes.js
debug-function-scopes.js
generators-iteration.js Closed generator returns a completed object instead of throwing a error 2014-01-14 15:19:34 +00:00
generators-objects.js Refactor optimized in hydrogen only runtime functions. 2014-03-25 14:26:55 +00:00
generators-parsing.js Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode 2014-03-11 14:39:08 +00:00
generators-runtime.js GeneratorFunction() makes generator instances 2013-06-12 12:52:16 +00:00
iteration-semantics.js Harmony promises 2013-11-27 17:21:40 +00:00
iteration-syntax.js For-of statements do not permit initializers. 2013-06-12 12:37:44 +00:00
microtask-delivery.js Revert 20313 - "Ship promises and weak collections" 2014-03-31 12:40:32 +00:00
module-linking.js Get rid of static module allocation, do it in code. 2012-11-22 10:25:22 +00:00
module-parsing.js
module-recompile.js
module-resolution.js
numeric-literals-off.js Add support for explicit octal and binary integer literals 2013-07-19 09:57:35 +00:00
numeric-literals.js Add support for explicit octal and binary integer literals 2013-07-19 09:57:35 +00:00
private.js Revert 20313 - "Ship promises and weak collections" 2014-03-31 12:40:32 +00:00
proxies-example-membrane.js Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode 2014-03-11 14:39:08 +00:00
proxies-for.js Proxies: Make 'with' work, plus minor other fixes 2013-07-19 14:07:23 +00:00
proxies-function.js Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode 2014-03-11 14:39:08 +00:00
proxies-hash.js Revert 20313 - "Ship promises and weak collections" 2014-03-31 12:40:32 +00:00
proxies-json.js
proxies-symbols.js ES6 symbols: prevent reflection, proxy, and observe APIs from leaking symbols 2013-03-22 17:27:44 +00:00
proxies-with.js Proxies: Make 'with' work, plus minor other fixes 2013-07-19 14:07:23 +00:00
proxies.js Rename A64 port to ARM64 port 2014-03-21 09:28:26 +00:00
set-prototype-of.js Move all Harmony-only tests to harmony/ 2014-02-28 14:26:32 +00:00
string-contains.js Make String.prototype.contains throw when passing a regular expression 2014-04-07 10:24:01 +00:00
string-endswith.js Make String.prototype.{starts,ends}With throw when passing a regular expression 2014-01-28 10:31:05 +00:00
string-repeat.js Make sure files end with exactly one new line and police this in presubmit. 2013-11-22 13:50:39 +00:00
string-startswith.js Make String.prototype.{starts,ends}With throw when passing a regular expression 2014-01-28 10:31:05 +00:00
symbols.js Revert 20313 - "Ship promises and weak collections" 2014-03-31 12:40:32 +00:00
typedarrays.js Inline internal getters for typed arrays & friends. 2014-03-28 15:25:24 +00:00
typeof.js