| // Copyright 2019 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. |
| |
| extern class JSFinalizationGroup extends JSObject { |
| native_context: NativeContext; |
| cleanup: Object; |
| active_cells: Undefined|WeakCell; |
| cleared_cells: Undefined|WeakCell; |
| key_map: Object; |
| next: Undefined|JSFinalizationGroup; |
| flags: Smi; |
| } |
| |
| @generateCppClass |
| extern class JSFinalizationGroupCleanupIterator extends JSObject { |
| finalization_group: JSFinalizationGroup; |
| } |
| |
| @generateCppClass |
| extern class WeakCell extends HeapObject { |
| finalization_group: Undefined|JSFinalizationGroup; |
| target: Undefined|JSReceiver; |
| unregister_token: Object; |
| holdings: Object; |
| |
| // For storing doubly linked lists of WeakCells in JSFinalizationGroup's |
| // "active_cells" and "cleared_cells" lists. |
| prev: Undefined|WeakCell; |
| next: Undefined|WeakCell; |
| |
| // For storing doubly linked lists of WeakCells per key in |
| // JSFinalizationGroup's key-based hashmap. The key is the identity hash of |
| // unregister_token. WeakCell also needs to know its token, so that we can |
| // remove its corresponding key from the key_map when we remove the last |
| // WeakCell associated with it or when the unregister_token dies. The |
| // unregister token is stored above, after target, as both are weak. |
| key_list_prev: Undefined|WeakCell; |
| key_list_next: Undefined|WeakCell; |
| } |
| |
| @generateCppClass |
| extern class JSWeakRef extends JSObject { |
| target: Undefined|JSReceiver; |
| } |