Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Friends | List of all members
dart::ThreadState Class Referenceabstract

#include <thread_state.h>

Inheritance diagram for dart::ThreadState:
dart::BaseThread dart::Thread

Public Member Functions

 ThreadState (bool is_os_thread)
 
virtual ~ThreadState ()
 
OSThreados_thread () const
 
void set_os_thread (OSThread *os_thread)
 
Zonezone () const
 
bool ZoneIsOwnedByThread (Zone *zone) const
 
StackResourcetop_resource () const
 
void set_top_resource (StackResource *value)
 
LongJumpScopelong_jump_base () const
 
void set_long_jump_base (LongJumpScope *value)
 
bool IsValidZoneHandle (Dart_Handle object) const
 
intptr_t CountZoneHandles () const
 
bool IsValidScopedHandle (Dart_Handle object) const
 
intptr_t CountScopedHandles () const
 
virtual bool MayAllocateHandles ()=0
 
HandleScopetop_handle_scope () const
 
void set_top_handle_scope (HandleScope *handle_scope)
 
- Public Member Functions inherited from dart::BaseThread
bool is_os_thread () const
 

Static Public Member Functions

static ThreadStateCurrent ()
 
static intptr_t top_resource_offset ()
 

Friends

class ApiZone
 
class StackZone
 

Detailed Description

Definition at line 24 of file thread_state.h.

Constructor & Destructor Documentation

◆ ThreadState()

dart::ThreadState::ThreadState ( bool  is_os_thread)
explicit

Definition at line 12 of file thread_state.cc.

12: BaseThread(is_os_thread) {}
bool is_os_thread() const
Definition: os_thread.h:71

◆ ~ThreadState()

dart::ThreadState::~ThreadState ( )
virtual

Definition at line 14 of file thread_state.cc.

14{}

Member Function Documentation

◆ CountScopedHandles()

intptr_t dart::ThreadState::CountScopedHandles ( ) const

Definition at line 61 of file thread_state.cc.

61 {
62 intptr_t count = 0;
63 Zone* zone = this->zone();
64 while (zone != nullptr) {
66 zone = zone->previous();
67 }
68 ASSERT(count >= 0);
69 return count;
70}
int count
Definition: FontMgrTest.cpp:50
int CountScopedHandles() const
Definition: handles_impl.h:212
Zone * zone() const
Definition: thread_state.h:37
VMHandles * handles()
Definition: zone.h:73
Zone * previous() const
Definition: zone.h:77
#define ASSERT(E)

◆ CountZoneHandles()

intptr_t dart::ThreadState::CountZoneHandles ( ) const

Definition at line 39 of file thread_state.cc.

39 {
40 intptr_t count = 0;
41 Zone* zone = this->zone();
42 while (zone != nullptr) {
44 zone = zone->previous();
45 }
46 ASSERT(count >= 0);
47 return count;
48}
int CountZoneHandles() const
Definition: handles_impl.h:228

◆ Current()

static ThreadState * dart::ThreadState::Current ( )
inlinestatic

Definition at line 27 of file thread_state.h.

27{ return OSThread::CurrentVMThread(); }
static ThreadState * CurrentVMThread()
Definition: os_thread.h:188

◆ IsValidScopedHandle()

bool dart::ThreadState::IsValidScopedHandle ( Dart_Handle  object) const

Definition at line 50 of file thread_state.cc.

50 {
51 Zone* zone = this->zone();
52 while (zone != nullptr) {
53 if (zone->handles()->IsValidScopedHandle(reinterpret_cast<uword>(object))) {
54 return true;
55 }
56 zone = zone->previous();
57 }
58 return false;
59}
bool IsValidScopedHandle(uword handle) const
Definition: handles_impl.h:175
uintptr_t uword
Definition: globals.h:501

◆ IsValidZoneHandle()

bool dart::ThreadState::IsValidZoneHandle ( Dart_Handle  object) const

Definition at line 28 of file thread_state.cc.

28 {
29 Zone* zone = this->zone();
30 while (zone != nullptr) {
31 if (zone->handles()->IsValidZoneHandle(reinterpret_cast<uword>(object))) {
32 return true;
33 }
34 zone = zone->previous();
35 }
36 return false;
37}
bool IsValidZoneHandle(uword handle) const
Definition: handles_impl.h:188

◆ long_jump_base()

LongJumpScope * dart::ThreadState::long_jump_base ( ) const
inline

Definition at line 47 of file thread_state.h.

47{ return long_jump_base_; }

◆ MayAllocateHandles()

virtual bool dart::ThreadState::MayAllocateHandles ( )
pure virtual

Implemented in dart::Thread.

◆ os_thread()

OSThread * dart::ThreadState::os_thread ( ) const
inline

Definition at line 33 of file thread_state.h.

33{ return os_thread_; }

◆ set_long_jump_base()

void dart::ThreadState::set_long_jump_base ( LongJumpScope value)
inline

Definition at line 48 of file thread_state.h.

48{ long_jump_base_ = value; }
uint8_t value

◆ set_os_thread()

void dart::ThreadState::set_os_thread ( OSThread os_thread)
inline

Definition at line 34 of file thread_state.h.

34{ os_thread_ = os_thread; }
OSThread * os_thread() const
Definition: thread_state.h:33

◆ set_top_handle_scope()

void dart::ThreadState::set_top_handle_scope ( HandleScope handle_scope)
inline

Definition at line 65 of file thread_state.h.

65 {
66#if defined(DEBUG)
67 top_handle_scope_ = handle_scope;
68#endif
69 }

◆ set_top_resource()

void dart::ThreadState::set_top_resource ( StackResource value)
inline

Definition at line 42 of file thread_state.h.

42{ top_resource_ = value; }

◆ top_handle_scope()

HandleScope * dart::ThreadState::top_handle_scope ( ) const
inline

Definition at line 57 of file thread_state.h.

57 {
58#if defined(DEBUG)
59 return top_handle_scope_;
60#else
61 return 0;
62#endif
63 }

◆ top_resource()

StackResource * dart::ThreadState::top_resource ( ) const
inline

Definition at line 41 of file thread_state.h.

41{ return top_resource_; }

◆ top_resource_offset()

static intptr_t dart::ThreadState::top_resource_offset ( )
inlinestatic

Definition at line 43 of file thread_state.h.

43 {
44 return OFFSET_OF(ThreadState, top_resource_);
45 }
friend class ThreadState
Definition: os_thread.h:79
#define OFFSET_OF(type, field)
Definition: globals.h:138

◆ zone()

Zone * dart::ThreadState::zone ( ) const
inline

Definition at line 37 of file thread_state.h.

37{ return zone_; }

◆ ZoneIsOwnedByThread()

bool dart::ThreadState::ZoneIsOwnedByThread ( Zone zone) const

Definition at line 16 of file thread_state.cc.

16 {
17 ASSERT(zone != nullptr);
18 Zone* current = zone_;
19 while (current != nullptr) {
20 if (current == zone) {
21 return true;
22 }
23 current = current->previous();
24 }
25 return false;
26}

Friends And Related Function Documentation

◆ ApiZone

friend class ApiZone
friend

Definition at line 84 of file thread_state.h.

◆ StackZone

friend class StackZone
friend

Definition at line 85 of file thread_state.h.


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