Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: src/runtime.cc

Issue 289503002: ES6 Map/Set iterators/forEach improvements (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git rebase to fix merge conflict Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/harmony/collections.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 #include "accessors.h" 10 #include "accessors.h"
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 1593
1594 1594
1595 RUNTIME_FUNCTION(Runtime_SetIteratorNext) { 1595 RUNTIME_FUNCTION(Runtime_SetIteratorNext) {
1596 HandleScope scope(isolate); 1596 HandleScope scope(isolate);
1597 ASSERT(args.length() == 1); 1597 ASSERT(args.length() == 1);
1598 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0); 1598 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
1599 return *JSSetIterator::Next(holder); 1599 return *JSSetIterator::Next(holder);
1600 } 1600 }
1601 1601
1602 1602
1603 RUNTIME_FUNCTION(Runtime_SetIteratorClose) {
1604 HandleScope scope(isolate);
1605 ASSERT(args.length() == 1);
1606 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
1607 holder->Close();
1608 return isolate->heap()->undefined_value();
1609 }
1610
1611
1612 RUNTIME_FUNCTION(Runtime_MapInitialize) { 1603 RUNTIME_FUNCTION(Runtime_MapInitialize) {
1613 HandleScope scope(isolate); 1604 HandleScope scope(isolate);
1614 ASSERT(args.length() == 1); 1605 ASSERT(args.length() == 1);
1615 CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0); 1606 CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0);
1616 Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap(); 1607 Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap();
1617 holder->set_table(*table); 1608 holder->set_table(*table);
1618 return *holder; 1609 return *holder;
1619 } 1610 }
1620 1611
1621 1612
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 1693
1703 1694
1704 RUNTIME_FUNCTION(Runtime_MapIteratorNext) { 1695 RUNTIME_FUNCTION(Runtime_MapIteratorNext) {
1705 HandleScope scope(isolate); 1696 HandleScope scope(isolate);
1706 ASSERT(args.length() == 1); 1697 ASSERT(args.length() == 1);
1707 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0); 1698 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
1708 return *JSMapIterator::Next(holder); 1699 return *JSMapIterator::Next(holder);
1709 } 1700 }
1710 1701
1711 1702
1712 RUNTIME_FUNCTION(Runtime_MapIteratorClose) {
1713 HandleScope scope(isolate);
1714 ASSERT(args.length() == 1);
1715 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
1716 holder->Close();
1717 return isolate->heap()->undefined_value();
1718 }
1719
1720
1721 static Handle<JSWeakCollection> WeakCollectionInitialize( 1703 static Handle<JSWeakCollection> WeakCollectionInitialize(
1722 Isolate* isolate, 1704 Isolate* isolate,
1723 Handle<JSWeakCollection> weak_collection) { 1705 Handle<JSWeakCollection> weak_collection) {
1724 ASSERT(weak_collection->map()->inobject_properties() == 0); 1706 ASSERT(weak_collection->map()->inobject_properties() == 0);
1725 Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 0); 1707 Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 0);
1726 weak_collection->set_table(*table); 1708 weak_collection->set_table(*table);
1727 weak_collection->set_next(Smi::FromInt(0)); 1709 weak_collection->set_next(Smi::FromInt(0));
1728 return weak_collection; 1710 return weak_collection;
1729 } 1711 }
1730 1712
(...skipping 13491 matching lines...) Expand 10 before | Expand all | Expand 10 after
15222 } 15204 }
15223 return NULL; 15205 return NULL;
15224 } 15206 }
15225 15207
15226 15208
15227 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15209 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15228 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15210 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15229 } 15211 }
15230 15212
15231 } } // namespace v8::internal 15213 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/harmony/collections.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698