Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::ObjectSet Class Reference

#include <object_set.h>

Inheritance diagram for dart::ObjectSet:
dart::ZoneAllocated

Public Member Functions

 ObjectSet (Zone *zone)
 
void AddRegion (uword start, uword end)
 
void SortRegions ()
 
bool Contains (ObjectPtr raw_obj) const
 
void Add (ObjectPtr raw_obj)
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Detailed Description

Definition at line 47 of file object_set.h.

Constructor & Destructor Documentation

◆ ObjectSet()

dart::ObjectSet::ObjectSet ( Zone zone)
inlineexplicit

Definition at line 49 of file object_set.h.

49: zone_(zone), sorted_(true), regions_() {}

Member Function Documentation

◆ Add()

void dart::ObjectSet::Add ( ObjectPtr  raw_obj)
inline

Definition at line 75 of file object_set.h.

75 {
76 uword raw_addr = UntaggedObject::ToAddr(raw_obj);
77 ObjectSetRegion* region;
78 if (FindRegion(raw_addr, &region)) {
79 return region->AddObject(raw_addr);
80 }
81 FATAL("Address not in any heap region");
82 }
static uword ToAddr(const UntaggedObject *raw_obj)
Definition: raw_object.h:522
#define FATAL(error)
ClipOpAndAA opAA SkRegion region
Definition: SkRecords.h:238
uintptr_t uword
Definition: globals.h:501

◆ AddRegion()

void dart::ObjectSet::AddRegion ( uword  start,
uword  end 
)
inline

Definition at line 51 of file object_set.h.

51 {
52 if (start == end) {
53 return; // Ignore empty regions, such as semispaces in the vm-isolate.
54 }
55 ASSERT(start < end);
56 ObjectSetRegion* region = new (zone_) ObjectSetRegion(zone_, start, end);
57 regions_.Add(region);
58 sorted_ = false;
59 }
#define ASSERT(E)

◆ Contains()

bool dart::ObjectSet::Contains ( ObjectPtr  raw_obj) const
inline

Definition at line 66 of file object_set.h.

66 {
67 uword raw_addr = UntaggedObject::ToAddr(raw_obj);
68 ObjectSetRegion* region;
69 if (FindRegion(raw_addr, &region)) {
70 return region->ContainsObject(raw_addr);
71 }
72 return false;
73 }

◆ SortRegions()

void dart::ObjectSet::SortRegions ( )
inline

Definition at line 61 of file object_set.h.

61 {
62 regions_.Sort(CompareRegions);
63 sorted_ = true;
64 }

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