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

Unified Diff: src/api.cc

Issue 1314053003: Move runtime helper for JSWeakCollection onto objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-runtime-helpers-1
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 | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 22b9dafa4b1a07c739cda5b7ddc80756ce8c74bc..744c7dc13b2c8463299b61de0dd89ffaa1946752 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2525,7 +2525,7 @@ Local<NativeWeakMap> NativeWeakMap::New(Isolate* v8_isolate) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_V8(isolate);
i::Handle<i::JSWeakMap> weakmap = isolate->factory()->NewJSWeakMap();
- i::Runtime::WeakCollectionInitialize(isolate, weakmap);
+ i::JSWeakCollection::Initialize(weakmap, isolate);
return Utils::NativeWeakMapToLocal(weakmap);
}
@@ -2548,7 +2548,7 @@ void NativeWeakMap::Set(Local<Value> v8_key, Local<Value> v8_value) {
return;
}
int32_t hash = i::Object::GetOrCreateHash(isolate, key)->value();
- i::Runtime::WeakCollectionSet(weak_collection, key, value, hash);
+ i::JSWeakCollection::Set(weak_collection, key, value, hash);
}
@@ -2611,7 +2611,8 @@ bool NativeWeakMap::Delete(Local<Value> v8_key) {
DCHECK(false);
return false;
}
- return i::Runtime::WeakCollectionDelete(weak_collection, key);
+ int32_t hash = i::Object::GetOrCreateHash(isolate, key)->value();
+ return i::JSWeakCollection::Delete(weak_collection, key, hash);
}
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698