/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/src/runtime/runtime-weak-refs.cc
38 строк
1 KB
Michaël Zasso
deps: update V8 to 13.6.233.8
02 май 2025, 16:06
Не верифицирован
02 май 2025, 16:06
918fe04
Код
Авторство
О чём код?
// Copyright 2020 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/execution/arguments-inl.h" #include "src/objects/js-weak-refs-inl.h" #include "src/runtime/runtime-utils.h" namespace v8 { namespace internal { RUNTIME_FUNCTION( Runtime_JSFinalizationRegistryRegisterWeakCellWithUnregisterToken) { HandleScope scope(isolate); DCHECK_EQ(2, args.length()); DirectHandle<JSFinalizationRegistry> finalization_registry = args.at<JSFinalizationRegistry>(0); DirectHandle<WeakCell> weak_cell = args.at<WeakCell>(1); JSFinalizationRegistry::RegisterWeakCellWithUnregisterToken( finalization_registry, weak_cell, isolate); return ReadOnlyRoots(isolate).undefined_value(); } RUNTIME_FUNCTION(Runtime_JSWeakRefAddToKeptObjects) { HandleScope scope(isolate); DCHECK_EQ(1, args.length()); DirectHandle<HeapObject> object = args.at<HeapObject>(0); DCHECK(Object::CanBeHeldWeakly(*object)); isolate->heap()->KeepDuringJob(object); return ReadOnlyRoots(isolate).undefined_value(); } } // namespace internal } // namespace v8