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

#include <handles.h>

Inheritance diagram for dart::HandleScope:
dart::StackResource

Public Member Functions

 HandleScope (ThreadState *thread)
 
 ~HandleScope ()
 
- Public Member Functions inherited from dart::StackResource
 StackResource (ThreadState *thread)
 
virtual ~StackResource ()
 
ThreadStatethread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from dart::StackResource
static void Unwind (ThreadState *thread)
 
static void UnwindAbove (ThreadState *thread, StackResource *new_top)
 

Detailed Description

Definition at line 304 of file handles.h.

Constructor & Destructor Documentation

◆ HandleScope()

dart::HandleScope::HandleScope ( ThreadState thread)
explicit

Definition at line 85 of file handles.cc.

86 Initialize();
87}
ThreadState * thread() const
Definition: allocation.h:33
StackResource(ThreadState *thread)
Definition: allocation.h:25

◆ ~HandleScope()

dart::HandleScope::~HandleScope ( )

Definition at line 89 of file handles.cc.

89 {
90 ASSERT(thread()->zone() != nullptr);
91 VMHandles* handles = thread()->zone()->handles();
92 ASSERT(handles != nullptr);
93#if defined(DEBUG)
94 VMHandles::HandlesBlock* last = handles->scoped_blocks_;
95#endif
96 handles->scoped_blocks_ = saved_handle_block_;
97 handles->scoped_blocks_->set_next_handle_slot(saved_handle_slot_);
98#if defined(DEBUG)
99 VMHandles::HandlesBlock* block = handles->scoped_blocks_;
100 for (;;) {
101 block->ZapFreeHandles();
102 if (block == last) break;
103 block = block->next_block();
104 }
105 ASSERT(thread()->top_handle_scope() == this);
107#endif
108}
Zone * zone() const
Definition: thread_state.h:37
void set_top_handle_scope(HandleScope *handle_scope)
Definition: thread_state.h:65
VMHandles * handles()
Definition: zone.h:73
#define ASSERT(E)

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