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

#include <handles.h>

Inheritance diagram for dart::VMHandles:
dart::Handles< kVMHandleSizeInWords, kVMHandlesPerChunk, kOffsetOfRawPtr >

Public Member Functions

 VMHandles ()
 
 ~VMHandles ()
 
void VisitObjectPointers (ObjectPointerVisitor *visitor)
 
- Public Member Functions inherited from dart::Handles< kVMHandleSizeInWords, kVMHandlesPerChunk, kOffsetOfRawPtr >
 Handles ()
 
 ~Handles ()
 
void VisitObjectPointers (ObjectPointerVisitor *visitor)
 
void VisitScopedHandles (ObjectPointerVisitor *visitor)
 
void VisitUnvisitedScopedHandles (ObjectPointerVisitor *visitor)
 
void Visit (HandleVisitor *visitor)
 
void Reset ()
 
uword AllocateScopedHandle ()
 
bool IsEmpty () const
 
intptr_t ZoneHandlesCapacityInBytes () const
 
intptr_t ScopedHandlesCapacityInBytes () const
 

Static Public Member Functions

static uword AllocateHandle (Zone *zone)
 
static uword AllocateZoneHandle (Zone *zone)
 
static int ScopedHandleCount ()
 
static int ZoneHandleCount ()
 
- Static Public Member Functions inherited from dart::Handles< kVMHandleSizeInWords, kVMHandlesPerChunk, kOffsetOfRawPtr >
static uword AllocateHandle (Zone *zone)
 
static uword AllocateZoneHandle (Zone *zone)
 

Static Public Attributes

static constexpr int kOffsetOfRawPtrInHandle = kOffsetOfRawPtr
 

Friends

class ApiZone
 
class ApiNativeScope
 

Additional Inherited Members

- Protected Member Functions inherited from dart::Handles< kVMHandleSizeInWords, kVMHandlesPerChunk, kOffsetOfRawPtr >
int CountScopedHandles () const
 
int CountZoneHandles () const
 
bool IsValidScopedHandle (uword handle) const
 
bool IsValidZoneHandle (uword handle) const
 

Detailed Description

Definition at line 242 of file handles.h.

Constructor & Destructor Documentation

◆ VMHandles()

dart::VMHandles::VMHandles ( )
inline

Definition at line 248 of file handles.h.

249 : Handles<kVMHandleSizeInWords, kVMHandlesPerChunk, kOffsetOfRawPtr>() {
250#if defined(DEBUG)
251 if (FLAG_trace_handles) {
252 OS::PrintErr("*** Starting a new VM handle block 0x%" Px "\n",
253 reinterpret_cast<intptr_t>(this));
254 }
255#endif
256 }
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
#define Px
Definition: globals.h:410

◆ ~VMHandles()

dart::VMHandles::~VMHandles ( )
inline

Definition at line 257 of file handles.h.

257 {
258#if defined(DEBUG)
259 if (FLAG_trace_handles) {
260 OS::PrintErr("*** Handle Counts for 0x(%" Px
261 "):Zone = %d,Scoped = %d\n",
262 reinterpret_cast<intptr_t>(this), CountZoneHandles(),
264 OS::PrintErr("*** Deleting VM handle block 0x%" Px "\n",
265 reinterpret_cast<intptr_t>(this));
266 }
267#endif
268 }

Member Function Documentation

◆ AllocateHandle()

uword dart::VMHandles::AllocateHandle ( Zone zone)
static

Definition at line 32 of file handles.cc.

32 {
33 DEBUG_ASSERT(!IsCurrentApiNativeScope(zone));
36#if defined(DEBUG)
37 *reinterpret_cast<uword*>(handle + kOffsetOfIsZoneHandle * kWordSize) = 0;
38#endif
39 return handle;
40}
#define DEBUG_ASSERT(cond)
Definition: assert.h:321
static uword AllocateHandle(Zone *zone)
Definition: handles.cc:32
static constexpr int kVMHandleSizeInWords
Definition: handles.h:238
static constexpr int kVMHandlesPerChunk
Definition: handles.h:240
uintptr_t uword
Definition: globals.h:501
static constexpr int kOffsetOfRawPtr
Definition: handles.h:241
constexpr intptr_t kWordSize
Definition: globals.h:509

◆ AllocateZoneHandle()

uword dart::VMHandles::AllocateZoneHandle ( Zone zone)
static

Definition at line 42 of file handles.cc.

42 {
43 DEBUG_ASSERT(!IsCurrentApiNativeScope(zone));
46#if defined(DEBUG)
47 *reinterpret_cast<uword*>(handle + kOffsetOfIsZoneHandle * kWordSize) = 1;
48#endif
49 return handle;
50}
static uword AllocateZoneHandle(Zone *zone)
Definition: handles.cc:42

◆ ScopedHandleCount()

int dart::VMHandles::ScopedHandleCount ( )
static

Definition at line 59 of file handles.cc.

59 {
60 Thread* thread = Thread::Current();
61 ASSERT(thread->zone() != nullptr);
62 VMHandles* handles = thread->zone()->handles();
63 return handles->CountScopedHandles();
64}
static Thread * Current()
Definition: thread.h:362
#define ASSERT(E)

◆ VisitObjectPointers()

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

Definition at line 20 of file handles.cc.

20 {
23}
void VisitObjectPointers(ObjectPointerVisitor *visitor)
Definition: handles.cc:20

◆ ZoneHandleCount()

int dart::VMHandles::ZoneHandleCount ( )
static

Definition at line 66 of file handles.cc.

66 {
67 Thread* thread = Thread::Current();
68 ASSERT(thread->zone() != nullptr);
69 VMHandles* handles = thread->zone()->handles();
70 return handles->CountZoneHandles();
71}

Friends And Related Function Documentation

◆ ApiNativeScope

friend class ApiNativeScope
friend

Definition at line 292 of file handles.h.

◆ ApiZone

friend class ApiZone
friend

Definition at line 291 of file handles.h.

Member Data Documentation

◆ kOffsetOfRawPtrInHandle

constexpr int dart::VMHandles::kOffsetOfRawPtrInHandle = kOffsetOfRawPtr
staticconstexpr

Definition at line 246 of file handles.h.


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