chromium/v8/test/cctest/test-js-weak-refs.cc

// Copyright 2018 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/isolate.h"
#include "src/handles/handles-inl.h"
#include "src/heap/factory-inl.h"
#include "src/heap/heap-inl.h"
#include "src/objects/js-objects.h"
#include "src/objects/js-weak-refs-inl.h"
#include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-utils.h"

namespace v8 {
namespace internal {

namespace {

Handle<JSFinalizationRegistry> ConstructJSFinalizationRegistry(
    Isolate* isolate) {}

Handle<JSWeakRef> ConstructJSWeakRef(DirectHandle<JSReceiver> target,
                                     Isolate* isolate) {}

Handle<JSObject> CreateKey(const char* key_prop_value, Isolate* isolate) {}

Handle<WeakCell> FinalizationRegistryRegister(
    Handle<JSFinalizationRegistry> finalization_registry,
    Handle<JSObject> target, Handle<Object> held_value,
    Handle<Object> unregister_token, Isolate* isolate) {}

Handle<WeakCell> FinalizationRegistryRegister(
    Handle<JSFinalizationRegistry> finalization_registry,
    Handle<JSObject> target, Isolate* isolate) {}

void NullifyWeakCell(DirectHandle<WeakCell> weak_cell, Isolate* isolate) {}

Tagged<Object> PopClearedCellHoldings(
    DirectHandle<JSFinalizationRegistry> finalization_registry,
    Isolate* isolate) {}

// Usage: VerifyWeakCellChain(isolate, list_head, n, cell1, cell2, ..., celln);
// verifies that list_head == cell1 and cell1, cell2, ..., celln. form a list.
void VerifyWeakCellChain(Isolate* isolate, Tagged<Object> list_head, int n_args,
                         ...) {}

// Like VerifyWeakCellChain but verifies the chain created with key_list_prev
// and key_list_next instead of prev and next.
void VerifyWeakCellKeyChain(Isolate* isolate,
                            Tagged<SimpleNumberDictionary> key_map,
                            Tagged<Object> unregister_token, int n_args, ...) {}

Handle<JSWeakRef> MakeWeakRefAndKeepDuringJob(Isolate* isolate) {}

}  // namespace

TEST(TestRegister) {}

TEST(TestRegisterWithKey) {}

TEST(TestWeakCellNullify1) {}

TEST(TestWeakCellNullify2) {}

TEST(TestJSFinalizationRegistryPopClearedCellHoldings1) {}

TEST(TestJSFinalizationRegistryPopClearedCellHoldings2) {}

TEST(TestUnregisterActiveCells) {}

TEST(TestUnregisterActiveAndClearedCells) {}

TEST(TestWeakCellUnregisterTwice) {}

TEST(TestWeakCellUnregisterPopped) {}

TEST(TestWeakCellUnregisterNonexistentKey) {}

TEST(TestJSWeakRef) {}

TEST(TestJSWeakRefIncrementalMarking) {}

TEST(TestJSWeakRefKeepDuringJob) {}

TEST(TestJSWeakRefKeepDuringJobIncrementalMarking) {}

TEST(TestRemoveUnregisterToken) {}

TEST(JSWeakRefScavengedInWorklist) {}

TEST(JSWeakRefTenuredInWorklist) {}

TEST(UnregisterTokenHeapVerifier) {}

TEST(UnregisteredAndUnclearedCellHeapVerifier) {}

}  // namespace internal
}  // namespace v8