Index: src/runtime/runtime-collections.cc |
diff --git a/src/runtime/runtime-collections.cc b/src/runtime/runtime-collections.cc |
index 94113fd69fb5457441b611e3410d27b156463c37..1ba1e34356caf5d93e425c7f3b0e6c337b655107 100644 |
--- a/src/runtime/runtime-collections.cc |
+++ b/src/runtime/runtime-collections.cc |
@@ -82,13 +82,18 @@ RUNTIME_FUNCTION(Runtime_SetShrink) { |
} |
+void Runtime::JSSetClear(Isolate* isolate, Handle<JSSet> set) { |
+ Handle<OrderedHashSet> table(OrderedHashSet::cast(set->table())); |
+ table = OrderedHashSet::Clear(table); |
+ set->set_table(*table); |
+} |
+ |
+ |
RUNTIME_FUNCTION(Runtime_SetClear) { |
HandleScope scope(isolate); |
DCHECK(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); |
+ Runtime::JSSetClear(isolate, holder); |
return isolate->heap()->undefined_value(); |
} |
@@ -174,13 +179,18 @@ RUNTIME_FUNCTION(Runtime_MapShrink) { |
} |
+void Runtime::JSMapClear(Isolate* isolate, Handle<JSMap> map) { |
+ Handle<OrderedHashMap> table(OrderedHashMap::cast(map->table())); |
+ table = OrderedHashMap::Clear(table); |
+ map->set_table(*table); |
+} |
+ |
+ |
RUNTIME_FUNCTION(Runtime_MapClear) { |
HandleScope scope(isolate); |
DCHECK(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); |
+ Runtime::JSMapClear(isolate, holder); |
return isolate->heap()->undefined_value(); |
} |