5 #ifndef V8_OBJECTS_JS_WEAK_REFS_H_ 6 #define V8_OBJECTS_JS_WEAK_REFS_H_ 8 #include "src/objects/js-objects.h" 9 #include "src/objects/microtask.h" 12 #include "src/objects/object-macros.h" 27 DECL_ACCESSORS2(native_context,
Context)
28 DECL_ACCESSORS(cleanup,
Object)
29 DECL_ACCESSORS(active_cells,
Object)
30 DECL_ACCESSORS(cleared_cells,
Object)
33 DECL_ACCESSORS(next,
Object)
35 DECL_INT_ACCESSORS(flags)
38 inline void AddWeakCell(
JSWeakCell* weak_cell);
41 inline bool NeedsCleanup()
const;
43 inline bool scheduled_for_cleanup()
const;
44 inline void set_scheduled_for_cleanup(
bool scheduled_for_cleanup);
54 static const int kNativeContextOffset = JSObject::kHeaderSize;
55 static const int kCleanupOffset = kNativeContextOffset + kPointerSize;
56 static const int kActiveCellsOffset = kCleanupOffset + kPointerSize;
57 static const int kClearedCellsOffset = kActiveCellsOffset + kPointerSize;
58 static const int kNextOffset = kClearedCellsOffset + kPointerSize;
59 static const int kFlagsOffset = kNextOffset + kPointerSize;
60 static const int kSize = kFlagsOffset + kPointerSize;
76 DECL_ACCESSORS(factory,
Object)
77 DECL_ACCESSORS(target,
Object)
78 DECL_ACCESSORS(holdings,
Object)
81 DECL_ACCESSORS(prev,
Object)
82 DECL_ACCESSORS(next,
Object)
84 static const int kFactoryOffset = JSObject::kHeaderSize;
85 static const int kTargetOffset = kFactoryOffset + kPointerSize;
86 static const int kHoldingsOffset = kTargetOffset + kPointerSize;
87 static const int kPrevOffset = kHoldingsOffset + kPointerSize;
88 static const int kNextOffset = kPrevOffset + kPointerSize;
89 static const int kSize = kNextOffset + kPointerSize;
100 gc_notify_updated_slot);
102 inline void Clear(
Isolate* isolate);
112 DISALLOW_IMPLICIT_CONSTRUCTORS(
JSWeakRef);
123 static const int kFactoryOffset = Microtask::kHeaderSize;
124 static const int kSize = kFactoryOffset + kPointerSize;
138 static const int kFactoryOffset = JSObject::kHeaderSize;
139 static const int kSize = kFactoryOffset + kPointerSize;
148 #include "src/objects/object-macros-undef.h" 150 #endif // V8_OBJECTS_JS_WEAK_REFS_H_