| Index: src/runtime/runtime-collections.cc
|
| diff --git a/src/runtime/runtime-collections.cc b/src/runtime/runtime-collections.cc
|
| index 214ce1c4e6cf590b3d54fb237a8b51758c44a764..97c7a0b5e88c99b47c0f7498ac822ae3f79beddb 100644
|
| --- a/src/runtime/runtime-collections.cc
|
| +++ b/src/runtime/runtime-collections.cc
|
| @@ -325,5 +325,33 @@ RUNTIME_FUNCTION(Runtime_GetWeakSetValues) {
|
| CHECK(max_values >= 0);
|
| return *JSWeakCollection::GetEntries(holder, max_values);
|
| }
|
| +
|
| +RUNTIME_FUNCTION(Runtime_WeakRefInitialize) {
|
| + HandleScope scope(isolate);
|
| + DCHECK_EQ(3, args.length());
|
| + CONVERT_ARG_HANDLE_CHECKED(JSWeakRef, weak_ref, 0);
|
| + CONVERT_ARG_HANDLE_CHECKED(JSObject, target, 1);
|
| + CONVERT_ARG_HANDLE_CHECKED(JSFunction, executor, 2);
|
| + CONVERT_ARG_HANDLE_CHECKED(Object, holdings, 3);
|
| + JSWeakRef::Initialize(weak_ref, isolate, target, executor, holdings);
|
| + return *weak_ref;
|
| +}
|
| +
|
| +RUNTIME_FUNCTION(Runtime_WeakRefValue) {
|
| + HandleScope scope(isolate);
|
| + DCHECK_EQ(1, args.length());
|
| + CONVERT_ARG_HANDLE_CHECKED(JSWeakRef, weak_ref, 0);
|
| + Handle<Object> value = JSWeakRef::Value(weak_ref, isolate);
|
| + weak_ref->set_held(true);
|
| + return *value;
|
| +}
|
| +
|
| +RUNTIME_FUNCTION(Runtime_WeakRefClear) {
|
| + HandleScope scope(isolate);
|
| + DCHECK_EQ(1, args.length());
|
| + CONVERT_ARG_HANDLE_CHECKED(JSWeakRef, weak_ref, 0);
|
| + JSWeakRef::Clear(weak_ref, isolate);
|
| + return isolate->heap()->undefined_value();
|
| +}
|
| } // namespace internal
|
| } // namespace v8
|
|
|