#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) { … }
void VerifyWeakCellChain(Isolate* isolate, Tagged<Object> list_head, int n_args,
...) { … }
void VerifyWeakCellKeyChain(Isolate* isolate,
Tagged<SimpleNumberDictionary> key_map,
Tagged<Object> unregister_token, int n_args, ...) { … }
Handle<JSWeakRef> MakeWeakRefAndKeepDuringJob(Isolate* isolate) { … }
}
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) { … }
}
}