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

Unified Diff: src/runtime/runtime-collections.cc

Issue 1312413002: Move runtime helper for JSSet and JSMap onto objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-typedarray.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-collections.cc
diff --git a/src/runtime/runtime-collections.cc b/src/runtime/runtime-collections.cc
index 3450fca0e2541f13b96442d6781aee80e4ad5138..0dfa1ee30464acef28d31d2f28d6613dbb55c1d7 100644
--- a/src/runtime/runtime-collections.cc
+++ b/src/runtime/runtime-collections.cc
@@ -45,17 +45,11 @@ RUNTIME_FUNCTION(Runtime_GenericHash) {
}
-void Runtime::JSSetInitialize(Isolate* isolate, Handle<JSSet> set) {
- Handle<OrderedHashSet> table = isolate->factory()->NewOrderedHashSet();
- set->set_table(*table);
-}
-
-
RUNTIME_FUNCTION(Runtime_SetInitialize) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSSet, holder, 0);
- Runtime::JSSetInitialize(isolate, holder);
+ JSSet::Initialize(holder, isolate);
return *holder;
}
@@ -82,18 +76,11 @@ 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);
- Runtime::JSSetClear(isolate, holder);
+ JSSet::Clear(holder);
return isolate->heap()->undefined_value();
}
@@ -153,17 +140,11 @@ RUNTIME_FUNCTION(Runtime_SetIteratorDetails) {
}
-void Runtime::JSMapInitialize(Isolate* isolate, Handle<JSMap> map) {
- Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap();
- map->set_table(*table);
-}
-
-
RUNTIME_FUNCTION(Runtime_MapInitialize) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0);
- Runtime::JSMapInitialize(isolate, holder);
+ JSMap::Initialize(holder, isolate);
return *holder;
}
@@ -179,18 +160,11 @@ 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);
- Runtime::JSMapClear(isolate, holder);
+ JSMap::Clear(holder);
return isolate->heap()->undefined_value();
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-typedarray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698