Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 4f340855e907380dc0fa7ceda43a18219fa13227..17c96214cad00aa4d722d237b5179fdb915ab37d 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -1551,6 +1551,17 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetDelete) { |
} |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_SetClear) { |
+ HandleScope scope(isolate); |
+ ASSERT(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSSet, holder, 0); |
+ Handle<OrderedHashSet> table(OrderedHashSet::cast(holder->table())); |
+ table = OrderedHashSet::Clear(table); |
+ holder->set_table(*table); |
+ return isolate->heap()->undefined_value(); |
+} |
+ |
+ |
RUNTIME_FUNCTION(MaybeObject*, Runtime_SetGetSize) { |
HandleScope scope(isolate); |
ASSERT(args.length() == 1); |
@@ -1560,6 +1571,37 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetGetSize) { |
} |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_SetCreateIterator) { |
+ HandleScope scope(isolate); |
+ ASSERT(args.length() == 2); |
+ CONVERT_ARG_HANDLE_CHECKED(JSSet, holder, 0); |
+ CONVERT_SMI_ARG_CHECKED(kind, 1) |
+ ASSERT(kind == JSSetIterator::kKindValues |
+ || kind == JSSetIterator::kKindEntries); |
+ Handle<OrderedHashSet> table(OrderedHashSet::cast(holder->table())); |
+ Handle<JSSetIterator> iterator = JSSetIterator::Create(table, kind); |
+ return *iterator; |
+} |
+ |
+ |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_SetIteratorNext) { |
+ HandleScope scope(isolate); |
+ ASSERT(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0); |
+ Handle<JSObject> result = JSSetIterator::Next(holder); |
+ return *result; |
+} |
+ |
+ |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_SetIteratorClose) { |
+ HandleScope scope(isolate); |
+ ASSERT(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0); |
+ holder->Close(); |
+ return isolate->heap()->undefined_value(); |
+} |
+ |
+ |
RUNTIME_FUNCTION(MaybeObject*, Runtime_MapInitialize) { |
HandleScope scope(isolate); |
ASSERT(args.length() == 1); |
@@ -1606,6 +1648,17 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_MapDelete) { |
} |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_MapClear) { |
+ HandleScope scope(isolate); |
+ ASSERT(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0); |
+ Handle<OrderedHashMap> table(OrderedHashMap::cast(holder->table())); |
+ table = OrderedHashMap::Clear(table); |
+ holder->set_table(*table); |
+ return isolate->heap()->undefined_value(); |
+} |
+ |
+ |
RUNTIME_FUNCTION(MaybeObject*, Runtime_MapSet) { |
HandleScope scope(isolate); |
ASSERT(args.length() == 3); |
@@ -1628,6 +1681,38 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_MapGetSize) { |
} |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_MapCreateIterator) { |
+ HandleScope scope(isolate); |
+ ASSERT(args.length() == 2); |
+ CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0); |
+ CONVERT_SMI_ARG_CHECKED(kind, 1) |
+ ASSERT(kind == JSMapIterator::kKindKeys |
+ || kind == JSMapIterator::kKindValues |
+ || kind == JSMapIterator::kKindEntries); |
+ Handle<OrderedHashMap> table(OrderedHashMap::cast(holder->table())); |
+ Handle<JSMapIterator> iterator = JSMapIterator::Create(table, kind); |
+ return *iterator; |
+} |
+ |
+ |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_MapIteratorNext) { |
+ HandleScope scope(isolate); |
+ ASSERT(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0); |
+ Handle<JSObject> result = JSMapIterator::Next(holder); |
+ return *result; |
+} |
+ |
+ |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_MapIteratorClose) { |
+ HandleScope scope(isolate); |
+ ASSERT(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0); |
+ holder->Close(); |
+ return isolate->heap()->undefined_value(); |
+} |
+ |
+ |
static JSWeakCollection* WeakCollectionInitialize(Isolate* isolate, |
Handle<JSWeakCollection> weak_collection) { |
ASSERT(weak_collection->map()->inobject_properties() == 0); |