5#ifndef V8_OBJECTS_JS_WEAK_REFS_H_
6#define V8_OBJECTS_JS_WEAK_REFS_H_
9#include "torque-generated/bit-fields.h"
20#include "torque-generated/src/objects/js-weak-refs-tq.inc"
25 :
public TorqueGeneratedJSFinalizationRegistry<JSFinalizationRegistry,
50 template <
typename GCNotifyUpdatedSlotCallback>
54 GCNotifyUpdatedSlotCallback gc_notify_updated_slot);
60 Isolate* isolate,
bool* key_map_may_need_shrink);
79 DEFINE_TORQUE_GENERATED_FINALIZATION_REGISTRY_FLAGS()
101 template <
typename GCNotifyUpdatedSlotCallback>
102 inline void Nullify(
Isolate* isolate,
103 GCNotifyUpdatedSlotCallback gc_notify_updated_slot);
105 inline void RemoveFromFinalizationRegistryCells(
Isolate* isolate);
110class JSWeakRef :
public TorqueGeneratedJSWeakRef<JSWeakRef, JSObject> {
static bool Unregister(DirectHandle< JSFinalizationRegistry > finalization_registry, DirectHandle< HeapObject > unregister_token, Isolate *isolate)
static void ShrinkKeyMap(Isolate *isolate, DirectHandle< JSFinalizationRegistry > finalization_registry)
V8_EXPORT_PRIVATE void RemoveCellFromUnregisterTokenMap(Isolate *isolate, Tagged< WeakCell > weak_cell)
static void RegisterWeakCellWithUnregisterToken(DirectHandle< JSFinalizationRegistry > finalization_registry, DirectHandle< WeakCell > weak_cell, Isolate *isolate)
bool NeedsCleanup() const
V8_EXPORT_PRIVATE Tagged< WeakCell > PopClearedCell(Isolate *isolate, bool *key_map_may_need_shrink)
bool RemoveUnregisterToken(Tagged< HeapObject > unregister_token, Isolate *isolate, RemoveUnregisterTokenMode removal_mode, GCNotifyUpdatedSlotCallback gc_notify_updated_slot)
static Maybe< bool > Cleanup(Isolate *isolate, DirectHandle< JSFinalizationRegistry > finalization_registry)
RemoveUnregisterTokenMode
@ kKeepMatchedCellsInRegistry
@ kRemoveMatchedCellsFromRegistry
#define DECL_BOOLEAN_ACCESSORS(name)
#define DECL_PRINTER(Name)
#define TQ_OBJECT_CONSTRUCTORS(Type)
#define EXPORT_DECL_VERIFIER(Name)
#define V8_EXPORT_PRIVATE