v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
runtime-weak-refs.cc
Go to the documentation of this file.
1// Copyright 2020 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
8
9namespace v8 {
10namespace internal {
11
13 Runtime_JSFinalizationRegistryRegisterWeakCellWithUnregisterToken) {
14 HandleScope scope(isolate);
15 DCHECK_EQ(2, args.length());
16 DirectHandle<JSFinalizationRegistry> finalization_registry =
18 DirectHandle<WeakCell> weak_cell = args.at<WeakCell>(1);
19
21 finalization_registry, weak_cell, isolate);
22
23 return ReadOnlyRoots(isolate).undefined_value();
24}
25
26RUNTIME_FUNCTION(Runtime_JSWeakRefAddToKeptObjects) {
27 HandleScope scope(isolate);
28 DCHECK_EQ(1, args.length());
31
32 isolate->heap()->KeepDuringJob(object);
33
34 return ReadOnlyRoots(isolate).undefined_value();
35}
36
37} // namespace internal
38} // namespace v8
static void RegisterWeakCellWithUnregisterToken(DirectHandle< JSFinalizationRegistry > finalization_registry, DirectHandle< WeakCell > weak_cell, Isolate *isolate)
static bool CanBeHeldWeakly(Tagged< Object > obj)
#define RUNTIME_FUNCTION(Name)
Definition arguments.h:162
base::Vector< const DirectHandle< Object > > args
Definition execution.cc:74
#define DCHECK(condition)
Definition logging.h:482
#define DCHECK_EQ(v1, v2)
Definition logging.h:485