18 : count_(0), size_(0), skip_(
skip), expected_parent_(expected_parent) {}
20 virtual Direction
VisitObject(ObjectGraph::StackIterator* it) {
23 EXPECT(it->MoveToParent());
24 EXPECT_EQ(expected_parent_, it->Get());
32 int count()
const {
return count_; }
33 int size()
const {
return size_; }
43 auto heap = thread->isolate_group()->heap();
58 intptr_t a_size =
a.ptr()->untag()->HeapSize();
59 intptr_t b_size =
b.ptr()->untag()->HeapSize();
61 intptr_t d_size =
d.ptr()->untag()->HeapSize();
70 ObjectGraph graph(thread);
76 graph.IterateObjectsFrom(
a, &with);
78 graph.IterateObjectsFrom(
a, &without);
81 EXPECT_EQ(b_size + c_size, with.
size() - without.
size());
87 graph.IterateObjects(&with);
89 graph.IterateObjects(&without);
91 EXPECT_EQ(b_size + c_size, with.
size() - without.
size());
94 EXPECT_EQ(a_size + b_size + c_size + d_size,
95 graph.SizeRetainedByInstance(
a));
102 ObjectGraph graph(thread);
107 intptr_t null_length =
108 graph.RetainingPath(&c, Object::null_array()).length;
109 intptr_t empty_length =
110 graph.RetainingPath(&c, Object::empty_array()).length;
112 intptr_t one_length = graph.RetainingPath(&c,
path).length;
113 EXPECT_EQ(null_length, empty_length);
114 EXPECT_EQ(null_length, one_length);
115 EXPECT_LE(3, null_length);
121 heap->CollectAllGarbage();
122 intptr_t
length = graph.RetainingPath(&c,
path).length;
125 expected_c ^=
path.At(0);
128 offset_from_parent ^=
path.At(1);
131 expected_b ^=
path.At(2);
133 offset_from_parent ^=
path.At(3);
136 expected_a ^=
path.At(4);
150 ObjectGraph graph(thread);
155 EXPECT_STREQ(
result.gc_root_type,
"local handle");
164 EXPECT_STREQ(
result.gc_root_type,
"weak persistent handle");
172 EXPECT_STREQ(
result.gc_root_type,
"persistent handle");
178 persistent_handle =
nullptr;
181 EXPECT_STREQ(
result.gc_root_type,
"weak persistent handle");
187 weak_persistent_handle =
nullptr;
190 EXPECT_STREQ(
result.gc_root_type,
"local handle");
static bool skip(SkStream *stream, size_t amount)
static Dart_Handle NewHandle(Thread *thread, ObjectPtr raw)
static intptr_t element_offset(intptr_t index)
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
CounterVisitor(ObjectPtr skip, ObjectPtr expected_parent)
virtual Direction VisitObject(ObjectGraph::StackIterator *it)
UntaggedObject * untag() const
intptr_t HeapSize() const
struct _Dart_Handle * Dart_Handle
Dart_Handle Dart_PersistentHandle
struct _Dart_WeakPersistentHandle * Dart_WeakPersistentHandle
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
#define HANDLESCOPE(thread)
Visitor(Ts...) -> Visitor< Ts... >
DART_EXPORT Dart_WeakPersistentHandle Dart_NewWeakPersistentHandle(Dart_Handle object, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback)
DART_EXPORT void Dart_DeletePersistentHandle(Dart_PersistentHandle object)
DART_EXPORT void Dart_DeleteWeakPersistentHandle(Dart_WeakPersistentHandle object)
ISOLATE_UNIT_TEST_CASE(StackAllocatedDestruction)
static void WeakHandleFinalizer(void *isolate_callback_data, void *peer)
DART_EXPORT Dart_PersistentHandle Dart_NewPersistentHandle(Dart_Handle object)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path