Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
dart::ClassTable Class Reference

#include <class_table.h>

Inheritance diagram for dart::ClassTable:
dart::MallocAllocated

Classes

struct  ArrayTraits
 

Public Member Functions

 ClassTable (ClassTableAllocator *allocator)
 
 ~ClassTable ()
 
ClassTableClone () const
 
ClassPtr At (intptr_t cid) const
 
int32_t SizeAt (intptr_t index) const
 
void SetAt (intptr_t index, ClassPtr raw_cls)
 
void UpdateClassSize (intptr_t cid, ClassPtr raw_cls)
 
bool IsValidIndex (intptr_t cid) const
 
bool HasValidClassAt (intptr_t cid) const
 
UnboxedFieldBitmap GetUnboxedFieldsMapAt (intptr_t cid) const
 
void SetUnboxedFieldsMapAt (intptr_t cid, UnboxedFieldBitmap map)
 
bool ShouldTraceAllocationFor (intptr_t cid)
 
void SetTraceAllocationFor (intptr_t cid, bool trace)
 
void SetCollectInstancesFor (intptr_t cid, bool trace)
 
bool CollectInstancesFor (intptr_t cid)
 
void UpdateCachedAllocationTracingStateTablePointer ()
 
void PopulateUserVisibleNames ()
 
const char * UserVisibleNameFor (intptr_t cid)
 
void SetUserVisibleNameFor (intptr_t cid, const char *name)
 
intptr_t NumCids () const
 
intptr_t Capacity () const
 
intptr_t NumTopLevelCids () const
 
void Register (const Class &cls)
 
void AllocateIndex (intptr_t index)
 
void RegisterTopLevel (const Class &cls)
 
void UnregisterTopLevel (intptr_t index)
 
void Remap (intptr_t *old_to_new_cids)
 
void VisitObjectPointers (ObjectPointerVisitor *visitor)
 
void CopySizesFromClassObjects ()
 
void Validate ()
 
void Print ()
 
void AllocationProfilePrintJSON (JSONStream *stream, bool internal)
 
void PrintToJSONObject (JSONObject *object)
 
void FreeOldTables ()
 
- Public Member Functions inherited from dart::MallocAllocated
 MallocAllocated ()
 
void * operator new (size_t size)
 
void * operator new[] (size_t size)
 
void operator delete (void *pointer)
 
void operator delete[] (void *pointer)
 

Static Public Member Functions

static intptr_t allocation_tracing_state_table_offset ()
 
static bool IsTopLevelCid (intptr_t cid)
 
static intptr_t IndexFromTopLevelCid (intptr_t cid)
 
static intptr_t CidFromTopLevelIndex (intptr_t index)
 

Friends

class ClassTableAllocator
 
class Dart
 
class IsolateGroup
 
IsolateCreateWithinExistingIsolateGroup (IsolateGroup *group, const char *name, char **error)
 

Detailed Description

Definition at line 354 of file class_table.h.

Constructor & Destructor Documentation

◆ ClassTable()

dart::ClassTable::ClassTable ( ClassTableAllocator allocator)
explicit

Definition at line 22 of file class_table.cc.

23 : allocator_(allocator),
24 classes_(allocator),
25 top_level_classes_(allocator) {
26 if (Dart::vm_isolate() == nullptr) {
27 classes_.SetNumCidsAndCapacity(kNumPredefinedCids, kInitialCapacity);
28 } else {
29 // Duplicate the class table from the VM isolate.
30 ClassTable* vm_class_table = Dart::vm_isolate_group()->class_table();
31 classes_.SetNumCidsAndCapacity(kNumPredefinedCids,
32 vm_class_table->classes_.capacity());
33
34 const auto copy_info_for_cid = [&](intptr_t cid) {
35 classes_.At<kClassIndex>(cid) = vm_class_table->At(cid);
36 classes_.At<kSizeIndex>(cid) = vm_class_table->SizeAt(cid);
37 };
38
39 // The following cids don't have a corresponding class object in Dart code.
40 // We therefore need to initialize them eagerly.
41 COMPILE_ASSERT(kFirstInternalOnlyCid == kObjectCid + 1);
42 for (intptr_t i = kObjectCid; i <= kLastInternalOnlyCid; i++) {
43 copy_info_for_cid(i);
44 }
45 copy_info_for_cid(kTypeArgumentsCid);
46 copy_info_for_cid(kFreeListElement);
47 copy_info_for_cid(kForwardingCorpse);
48 copy_info_for_cid(kDynamicCid);
49 copy_info_for_cid(kVoidCid);
50 }
52}
void UpdateCachedAllocationTracingStateTablePointer()
Definition: class_table.h:423
ClassTable(ClassTableAllocator *allocator)
Definition: class_table.cc:22
static IsolateGroup * vm_isolate_group()
Definition: dart.h:69
static Isolate * vm_isolate()
Definition: dart.h:68
ClassTable * class_table() const
Definition: isolate.h:496
@ kForwardingCorpse
Definition: class_id.h:225
@ kNumPredefinedCids
Definition: class_id.h:257
@ kVoidCid
Definition: class_id.h:254
@ kDynamicCid
Definition: class_id.h:253
@ kFreeListElement
Definition: class_id.h:224
constexpr intptr_t kFirstInternalOnlyCid
Definition: class_id.h:288
const intptr_t cid
COMPILE_ASSERT(kUnreachableReference==WeakTable::kNoValue)
constexpr intptr_t kLastInternalOnlyCid
Definition: class_id.h:289

◆ ~ClassTable()

dart::ClassTable::~ClassTable ( )

Definition at line 54 of file class_table.cc.

54 {
55#if !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
56 for (intptr_t i = 1; i < classes_.num_cids(); i++) {
57 const char* name = UserVisibleNameFor(i);
58 if (name != nullptr) {
59 free(const_cast<char*>(name));
60 }
61 }
62#endif // !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
63}
const char * UserVisibleNameFor(intptr_t cid)
Definition: class_table.h:434
const char *const name

Member Function Documentation

◆ AllocateIndex()

void dart::ClassTable::AllocateIndex ( intptr_t  index)

Definition at line 102 of file class_table.cc.

102 {
103 bool did_grow = false;
104 if (IsTopLevelCid(index)) {
105 top_level_classes_.AllocateIndex(IndexFromTopLevelCid(index), &did_grow);
106 return;
107 }
108
109 classes_.AllocateIndex(index, &did_grow);
110 if (did_grow) {
113 }
114}
void AllocateIndex(intptr_t index, bool *did_grow)
Definition: class_table.h:176
static intptr_t IndexFromTopLevelCid(intptr_t cid)
Definition: class_table.h:498
static bool IsTopLevelCid(intptr_t cid)
Definition: class_table.h:496
void set_cached_class_table_table(ClassPtr *cached_class_table_table)
Definition: isolate.h:393
static IsolateGroup * Current()
Definition: isolate.h:539

◆ allocation_tracing_state_table_offset()

static intptr_t dart::ClassTable::allocation_tracing_state_table_offset ( )
inlinestatic

Definition at line 483 of file class_table.h.

483 {
484 static_assert(sizeof(cached_allocation_tracing_state_table_) == kWordSize);
485 return OFFSET_OF(ClassTable, cached_allocation_tracing_state_table_);
486 }
constexpr intptr_t kWordSize
Definition: globals.h:509
#define OFFSET_OF(type, field)
Definition: globals.h:138

◆ AllocationProfilePrintJSON()

void dart::ClassTable::AllocationProfilePrintJSON ( JSONStream stream,
bool  internal 
)

Definition at line 305 of file class_table.cc.

305 {
306 Isolate* isolate = Isolate::Current();
307 ASSERT(isolate != nullptr);
308 auto isolate_group = isolate->group();
309 Heap* heap = isolate_group->heap();
310 ASSERT(heap != nullptr);
311 JSONObject obj(stream);
312 obj.AddProperty("type", "AllocationProfile");
313 if (isolate_group->last_allocationprofile_accumulator_reset_timestamp() !=
314 0) {
315 obj.AddPropertyF(
316 "dateLastAccumulatorReset", "%" Pd64 "",
317 isolate_group->last_allocationprofile_accumulator_reset_timestamp());
318 }
319 if (isolate_group->last_allocationprofile_gc_timestamp() != 0) {
320 obj.AddPropertyF("dateLastServiceGC", "%" Pd64 "",
321 isolate_group->last_allocationprofile_gc_timestamp());
322 }
323
324 if (internal) {
325 JSONObject heaps(&obj, "_heaps");
326 {
327 heap->PrintToJSONObject(Heap::kNew, &heaps);
328 }
329 {
330 heap->PrintToJSONObject(Heap::kOld, &heaps);
331 }
332 }
333
334 {
335 JSONObject memory(&obj, "memoryUsage");
336 {
337 heap->PrintMemoryUsageJSON(&memory);
338 }
339 }
340
341 Thread* thread = Thread::Current();
342 CountObjectsVisitor visitor(thread, NumCids());
343 {
344 HeapIterationScope iter(thread);
345 iter.IterateObjects(&visitor);
346 isolate->group()->VisitWeakPersistentHandles(&visitor);
347 }
348
349 {
350 JSONArray arr(&obj, "members");
351 Class& cls = Class::Handle();
352 for (intptr_t i = 3; i < classes_.num_cids(); i++) {
353 if (!HasValidClassAt(i)) continue;
354
355 cls = At(i);
356 if (cls.IsNull()) continue;
357
358 JSONObject obj(&arr);
359 obj.AddProperty("type", "ClassHeapStats");
360 obj.AddProperty("class", cls);
361 intptr_t count = visitor.new_count_[i] + visitor.old_count_[i];
362 intptr_t size = visitor.new_size_[i] + visitor.old_size_[i];
363 obj.AddProperty64("instancesAccumulated", count);
364 obj.AddProperty64("accumulatedSize", size);
365 obj.AddProperty64("instancesCurrent", count);
366 obj.AddProperty64("bytesCurrent", size);
367
368 if (internal) {
369 {
370 JSONArray new_stats(&obj, "_new");
371 new_stats.AddValue(visitor.new_count_[i]);
372 new_stats.AddValue(visitor.new_size_[i]);
373 new_stats.AddValue(visitor.new_external_size_[i]);
374 }
375 {
376 JSONArray old_stats(&obj, "_old");
377 old_stats.AddValue(visitor.old_count_[i]);
378 old_stats.AddValue(visitor.old_size_[i]);
379 old_stats.AddValue(visitor.old_external_size_[i]);
380 }
381 }
382 }
383 }
384}
int count
Definition: FontMgrTest.cpp:50
ClassPtr At(intptr_t cid) const
Definition: class_table.h:362
intptr_t NumCids() const
Definition: class_table.h:447
bool HasValidClassAt(intptr_t cid) const
Definition: class_table.h:386
@ kNew
Definition: heap.h:38
@ kOld
Definition: heap.h:39
static Isolate * Current()
Definition: isolate.h:986
static Object & Handle()
Definition: object.h:407
static Thread * Current()
Definition: thread.h:362
#define ASSERT(E)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
#define Pd64
Definition: globals.h:416

◆ At()

ClassPtr dart::ClassTable::At ( intptr_t  cid) const
inline

Definition at line 362 of file class_table.h.

362 {
363 if (IsTopLevelCid(cid)) {
364 return top_level_classes_.At<kClassIndex>(IndexFromTopLevelCid(cid));
365 }
366 return classes_.At<kClassIndex>(cid);
367 }
T & At(intptr_t index)
Definition: class_table.h:236

◆ Capacity()

intptr_t dart::ClassTable::Capacity ( ) const
inline

Definition at line 448 of file class_table.h.

448{ return classes_.capacity(); }

◆ CidFromTopLevelIndex()

static intptr_t dart::ClassTable::CidFromTopLevelIndex ( intptr_t  index)
inlinestatic

Definition at line 503 of file class_table.h.

503 {
504 return kTopLevelCidOffset + index;
505 }

◆ Clone()

ClassTable * dart::ClassTable::Clone ( ) const
inline

Definition at line 360 of file class_table.h.

360{ return new ClassTable(*this); }

◆ CollectInstancesFor()

bool dart::ClassTable::CollectInstancesFor ( intptr_t  cid)
inline

Definition at line 418 of file class_table.h.

418 {
419 auto& slot = classes_.At<kAllocationTracingStateIndex>(cid);
420 return (slot & kCollectInstancesBit) != 0;
421 }

◆ CopySizesFromClassObjects()

void dart::ClassTable::CopySizesFromClassObjects ( )

Definition at line 146 of file class_table.cc.

146 {
147 ASSERT(kIllegalCid == 0);
148 for (intptr_t i = 1; i < classes_.num_cids(); i++) {
149 UpdateClassSize(i, classes_.At<kClassIndex>(i));
150 }
151}
void UpdateClassSize(intptr_t cid, ClassPtr raw_cls)
Definition: class_table.cc:164
@ kIllegalCid
Definition: class_id.h:214

◆ FreeOldTables()

void dart::ClassTable::FreeOldTables ( )

◆ GetUnboxedFieldsMapAt()

UnboxedFieldBitmap dart::ClassTable::GetUnboxedFieldsMapAt ( intptr_t  cid) const
inline

Definition at line 388 of file class_table.h.

388 {
390 return classes_.At<kUnboxedFieldBitmapIndex>(cid);
391 }
bool IsValidIndex(intptr_t cid) const
Definition: class_table.h:379

◆ HasValidClassAt()

bool dart::ClassTable::HasValidClassAt ( intptr_t  cid) const
inline

Definition at line 386 of file class_table.h.

386{ return At(cid) != nullptr; }

◆ IndexFromTopLevelCid()

static intptr_t dart::ClassTable::IndexFromTopLevelCid ( intptr_t  cid)
inlinestatic

Definition at line 498 of file class_table.h.

498 {
500 return cid - kTopLevelCidOffset;
501 }

◆ IsTopLevelCid()

static bool dart::ClassTable::IsTopLevelCid ( intptr_t  cid)
inlinestatic

Definition at line 496 of file class_table.h.

496{ return cid >= kTopLevelCidOffset; }

◆ IsValidIndex()

bool dart::ClassTable::IsValidIndex ( intptr_t  cid) const
inline

Definition at line 379 of file class_table.h.

379 {
380 if (IsTopLevelCid(cid)) {
381 return top_level_classes_.IsValidIndex(IndexFromTopLevelCid(cid));
382 }
383 return classes_.IsValidIndex(cid);
384 }
bool IsValidIndex(intptr_t index) const
Definition: class_table.h:193

◆ NumCids()

intptr_t dart::ClassTable::NumCids ( ) const
inline

Definition at line 447 of file class_table.h.

447{ return classes_.num_cids(); }

◆ NumTopLevelCids()

intptr_t dart::ClassTable::NumTopLevelCids ( ) const
inline

Definition at line 450 of file class_table.h.

450{ return top_level_classes_.num_cids(); }
intptr_t num_cids() const
Definition: class_table.h:249

◆ PopulateUserVisibleNames()

void dart::ClassTable::PopulateUserVisibleNames ( )

Definition at line 278 of file class_table.cc.

278 {
279 Class& cls = Class::Handle();
280 for (intptr_t i = 0; i < classes_.num_cids(); ++i) {
281 if (HasValidClassAt(i) && UserVisibleNameFor(i) == nullptr) {
282 cls = At(i);
283 cls.SetUserVisibleNameInClassTable();
284 }
285 }
286}

◆ Print()

void dart::ClassTable::Print ( )

Definition at line 197 of file class_table.cc.

197 {
198 Class& cls = Class::Handle();
199 String& name = String::Handle();
200
201 for (intptr_t i = 1; i < classes_.num_cids(); i++) {
202 if (!HasValidClassAt(i)) {
203 continue;
204 }
205 cls = At(i);
206 if (cls.ptr() != nullptr) {
207 name = cls.Name();
208 OS::PrintErr("%" Pd ": %s\n", i, name.ToCString());
209 }
210 }
211}
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
#define Pd
Definition: globals.h:408

◆ PrintToJSONObject()

void dart::ClassTable::PrintToJSONObject ( JSONObject object)

Definition at line 291 of file class_table.cc.

291 {
292 Class& cls = Class::Handle();
293 object->AddProperty("type", "ClassList");
294 {
295 JSONArray members(object, "classes");
296 for (intptr_t i = ClassId::kObjectCid; i < classes_.num_cids(); i++) {
297 if (HasValidClassAt(i)) {
298 cls = At(i);
299 members.AddValue(cls);
300 }
301 }
302 }
303}

◆ Register()

void dart::ClassTable::Register ( const Class cls)

Definition at line 65 of file class_table.cc.

65 {
66 ASSERT(Thread::Current()->IsDartMutatorThread());
67 ASSERT(cls.id() == kIllegalCid || cls.id() < kNumPredefinedCids);
68 bool did_grow = false;
69 const classid_t cid =
70 cls.id() != kIllegalCid ? cls.id() : classes_.AddRow(&did_grow);
72
73 const intptr_t instance_size =
74 cls.is_abstract() ? 0 : Class::host_instance_size(cls.ptr());
75
76 cls.set_id(cid);
77 classes_.At<kClassIndex>(cid) = cls.ptr();
78 classes_.At<kSizeIndex>(cid) = static_cast<int32_t>(instance_size);
79#if !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
80 classes_.At<kClassNameIndex>(cid) = nullptr;
81#endif // !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
82
83 if (did_grow) {
85 classes_.GetColumn<kClassIndex>());
87 } else {
88 std::atomic_thread_fence(std::memory_order_release);
89 }
90}
intptr_t host_instance_size() const
Definition: object.h:1143
int32_t classid_t
Definition: globals.h:524

◆ RegisterTopLevel()

void dart::ClassTable::RegisterTopLevel ( const Class cls)

Definition at line 92 of file class_table.cc.

92 {
93 ASSERT(Thread::Current()->IsDartMutatorThread());
94 ASSERT(cls.id() == kIllegalCid);
95
96 bool did_grow = false;
97 const intptr_t index = top_level_classes_.AddRow(&did_grow);
98 cls.set_id(ClassTable::CidFromTopLevelIndex(index));
99 top_level_classes_.At<kClassIndex>(index) = cls.ptr();
100}
intptr_t AddRow(bool *did_grow)
Definition: class_table.h:181
static intptr_t CidFromTopLevelIndex(intptr_t index)
Definition: class_table.h:503

◆ Remap()

void dart::ClassTable::Remap ( intptr_t *  old_to_new_cids)

Definition at line 122 of file class_table.cc.

122 {
123 ASSERT(Thread::Current()->OwnsSafepoint());
124 classes_.Remap(old_to_new_cid);
125}

◆ SetAt()

void dart::ClassTable::SetAt ( intptr_t  index,
ClassPtr  raw_cls 
)

Definition at line 153 of file class_table.cc.

153 {
154 if (IsTopLevelCid(cid)) {
155 top_level_classes_.At<kClassIndex>(IndexFromTopLevelCid(cid)) = raw_cls;
156 return;
157 }
158
159 // This is called by snapshot reader and class finalizer.
160 UpdateClassSize(cid, raw_cls);
161 classes_.At<kClassIndex>(cid) = raw_cls;
162}

◆ SetCollectInstancesFor()

void dart::ClassTable::SetCollectInstancesFor ( intptr_t  cid,
bool  trace 
)
inline

Definition at line 409 of file class_table.h.

409 {
410 auto& slot = classes_.At<kAllocationTracingStateIndex>(cid);
411 if (trace) {
412 slot |= kCollectInstancesBit;
413 } else {
414 slot &= ~kCollectInstancesBit;
415 }
416 }

◆ SetTraceAllocationFor()

void dart::ClassTable::SetTraceAllocationFor ( intptr_t  cid,
bool  trace 
)
inline

Definition at line 404 of file class_table.h.

404 {
405 classes_.At<kAllocationTracingStateIndex>(cid) =
406 trace ? kTraceAllocationBit : kTracingDisabled;
407 }

◆ SetUnboxedFieldsMapAt()

void dart::ClassTable::SetUnboxedFieldsMapAt ( intptr_t  cid,
UnboxedFieldBitmap  map 
)
inline

Definition at line 393 of file class_table.h.

393 {
395 classes_.At<kUnboxedFieldBitmapIndex>(cid) = map;
396 }
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
Definition: SkVx.h:680

◆ SetUserVisibleNameFor()

void dart::ClassTable::SetUserVisibleNameFor ( intptr_t  cid,
const char *  name 
)
inline

Definition at line 441 of file class_table.h.

441 {
442 ASSERT(classes_.At<kClassNameIndex>(cid) == nullptr);
443 classes_.At<kClassNameIndex>(cid) = name;
444 }

◆ ShouldTraceAllocationFor()

bool dart::ClassTable::ShouldTraceAllocationFor ( intptr_t  cid)
inline

Definition at line 399 of file class_table.h.

399 {
400 return !IsTopLevelCid(cid) &&
401 (classes_.At<kAllocationTracingStateIndex>(cid) != kTracingDisabled);
402 }

◆ SizeAt()

int32_t dart::ClassTable::SizeAt ( intptr_t  index) const
inline

Definition at line 369 of file class_table.h.

369 {
370 if (IsTopLevelCid(index)) {
371 return 0;
372 }
373 return classes_.At<kSizeIndex>(index);
374 }

◆ UnregisterTopLevel()

void dart::ClassTable::UnregisterTopLevel ( intptr_t  index)

Definition at line 116 of file class_table.cc.

116 {
118 const intptr_t tlc_index = IndexFromTopLevelCid(cid);
119 top_level_classes_.At<kClassIndex>(tlc_index) = nullptr;
120}

◆ UpdateCachedAllocationTracingStateTablePointer()

void dart::ClassTable::UpdateCachedAllocationTracingStateTablePointer ( )
inline

Definition at line 423 of file class_table.h.

423 {
424 cached_allocation_tracing_state_table_.store(
425 classes_.GetColumn<kAllocationTracingStateIndex>());
426 }

◆ UpdateClassSize()

void dart::ClassTable::UpdateClassSize ( intptr_t  cid,
ClassPtr  raw_cls 
)

Definition at line 164 of file class_table.cc.

164 {
165 ASSERT(IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
166 ASSERT(!IsTopLevelCid(cid)); // "top-level" classes don't get instantiated
167 const intptr_t size =
168 raw_cls == nullptr ? 0 : Class::host_instance_size(raw_cls);
169 classes_.At<kSizeIndex>(cid) = static_cast<int32_t>(size);
170}

◆ UserVisibleNameFor()

const char * dart::ClassTable::UserVisibleNameFor ( intptr_t  cid)
inline

Definition at line 434 of file class_table.h.

434 {
435 if (!classes_.IsValidIndex(cid)) {
436 return nullptr;
437 }
438 return classes_.At<kClassNameIndex>(cid);
439 }

◆ Validate()

void dart::ClassTable::Validate ( )

Definition at line 172 of file class_table.cc.

172 {
173 Class& cls = Class::Handle();
174 for (intptr_t cid = kNumPredefinedCids; cid < classes_.num_cids(); cid++) {
175 // Some of the class table entries maybe nullptr as we create some
176 // top level classes but do not add them to the list of anonymous
177 // classes in a library if there are no top level fields or functions.
178 // Since there are no references to these top level classes they are
179 // not written into a full snapshot and will not be recreated when
180 // we read back the full snapshot. These class slots end up with nullptr
181 // entries.
182 if (HasValidClassAt(cid)) {
183 cls = At(cid);
184 ASSERT(cls.IsClass());
185#if defined(DART_PRECOMPILER)
186 // Precompiler can drop classes and set their id() to kIllegalCid.
187 // It still leaves them in the class table so dropped program
188 // structure could still be accessed while writing debug info.
189 ASSERT((cls.id() == cid) || (cls.id() == kIllegalCid));
190#else
191 ASSERT(cls.id() == cid);
192#endif // defined(DART_PRECOMPILER)
193 }
194 }
195}

◆ VisitObjectPointers()

void dart::ClassTable::VisitObjectPointers ( ObjectPointerVisitor visitor)

Definition at line 127 of file class_table.cc.

127 {
128 ASSERT(visitor != nullptr);
129 visitor->set_gc_root_type("class table");
130
131 const auto visit = [&](ClassPtr* table, intptr_t num_cids) {
132 if (num_cids == 0) {
133 return;
134 }
135 ObjectPtr* from = reinterpret_cast<ObjectPtr*>(&table[0]);
136 ObjectPtr* to = reinterpret_cast<ObjectPtr*>(&table[num_cids - 1]);
137 visitor->VisitPointers(from, to);
138 };
139
140 visit(classes_.GetColumn<kClassIndex>(), classes_.num_cids());
141 visit(top_level_classes_.GetColumn<kClassIndex>(),
142 top_level_classes_.num_cids());
143 visitor->clear_gc_root_type();
144}
SI F table(const skcms_Curve *curve, F v)

Friends And Related Function Documentation

◆ ClassTableAllocator

friend class ClassTableAllocator
friend

Definition at line 508 of file class_table.h.

◆ CreateWithinExistingIsolateGroup

Isolate * CreateWithinExistingIsolateGroup ( IsolateGroup group,
const char *  name,
char **  error 
)
friend

Definition at line 1301 of file dart_api_impl.cc.

1303 {
1306
1307 auto spawning_group = group;
1308
1309 Isolate* isolate = reinterpret_cast<Isolate*>(
1310 CreateIsolate(spawning_group, /*is_new_group=*/false, name,
1311 /*isolate_data=*/nullptr, error));
1312 if (isolate == nullptr) return nullptr;
1313
1314 auto source = spawning_group->source();
1315 ASSERT(isolate->source() == source);
1316
1317 return isolate;
1318}
#define API_TIMELINE_DURATION(thread)
#define CHECK_NO_ISOLATE(isolate)
Definition: dart_api_impl.h:53
SkBitmap source
Definition: examples.cpp:28
const uint8_t uint32_t uint32_t GError ** error
static Dart_Isolate CreateIsolate(IsolateGroup *group, bool is_new_group, const char *name, void *isolate_data, char **error)

◆ Dart

friend class Dart
friend

Definition at line 509 of file class_table.h.

◆ IsolateGroup

friend class IsolateGroup
friend

Definition at line 513 of file class_table.h.


The documentation for this class was generated from the following files: