GitHub PushEvent at 2014-04-16 00:45:12
Repository: v8
Actor: v8
Payload: {"shas":[["ce042b1f5da35148f8d8db6a36bdbaa5ed1fce41","4a537d0618f1e69f7fb821738d3179cad3033f70@chromium.org","ES6: Add support for Map/Set forEach\n\nThis implements MapIterator and SetIterator which matches\nthe same constructs in the ES6 spec. However, these 2\niterators are not exposed to user code yet. They are only\nused internally to implement Map.prototype.forEach and\nSet.prototype.forEach.\n\nEach iterator has a reference to the OrderedHashTable where\nit directly accesses the hash table's entries.\n\nThe OrderedHashTable has a reference to the newest iterator\nand each iterator has a reference to the next and previous\niterator, effectively creating a double linked list.\n\nWhen the OrderedHashTable is mutated (or replaced) all the\niterators are updated.\n\nWhen the iterator iterates passed the end of the data table\nit closes itself. Closed iterators no longer have a\nreference to the OrderedHashTable and they are removed from\nthe double linked list. In the case of Map/Set forEach, we\nmanually call Close on the iterator in case an exception was\nthrown so that the iterator never reached the end.\n\nAt this point the OrderedHashTable keeps all the non finished\niterators alive but since the only thing we currently expose\nis forEach there are no unfinished iterators outside a forEach\ncall. Once we expose the iterators to user code we will need\nto make the references from the OrderedHashTable to the\niterators weak and have some mechanism to close an iterator\nwhen it is garbage collected.\n\nBUG=1793,2323\nLOG=Y\nR=adamk@chromium.org, mstarzinger@chromium.org\n\nReview URL: https://codereview.chromium.org/236143002\n\nPatch from Erik Arvidsson <arv@chromium.org>.\n\ngit-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@20781 ce2b1a6d-e550-0410-aec6-3dcde31c8c00","adamk@chromium.org",false]],"size":1,"ref":"refs/heads/master","head":"ce042b1f5da35148f8d8db6a36bdbaa5ed1fce41"}