Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dart::ObjectPtr Class Reference

#include <tagged_pointer.h>

Public Member Functions

UntaggedObjectuntag () const
 
bool IsStringInstance () const
 
bool IsRawNull () const
 
bool IsDartInstance () const
 
bool IsFreeListElement () const
 
bool IsForwardingCorpse () const
 
bool IsPseudoObject () const
 
intptr_t GetClassId () const
 
intptr_t GetClassIdMayBeSmi () const
 
void Validate (IsolateGroup *isolate_group) const
 
bool operator== (const std::nullptr_t &other)
 
bool operator!= (const std::nullptr_t &other)
 
constexpr bool operator== (const std::nullptr_t &other) const
 
constexpr bool operator!= (const std::nullptr_t &other) const
 
 operator bool () const =delete
 
 operator int () const
 
 operator long () const
 
 operator long long () const
 
 operator unsigned int () const
 
 operator unsigned long () const
 
 operator unsigned long long () const
 
ObjectPtroperator= (const ObjectPtr &other)=default
 
constexpr ObjectPtr (const ObjectPtr &other)=default
 
 ObjectPtr ()
 
constexpr ObjectPtr (uword tagged)
 
constexpr ObjectPtr (intptr_t tagged)
 
constexpr ObjectPtr (std::nullptr_t)
 
 ObjectPtr (UntaggedObject *heap_object)
 
ObjectPtr Decompress (uword heap_base) const
 
ObjectPtr DecompressSmi () const
 
uword heap_base () const
 

Protected Member Functions

uword untagged_pointer () const
 

Protected Attributes

uword tagged_pointer_
 

Detailed Description

Definition at line 101 of file tagged_pointer.h.

Constructor & Destructor Documentation

◆ ObjectPtr() [1/6]

constexpr dart::ObjectPtr::ObjectPtr ( const ObjectPtr other)
constexprdefault

◆ ObjectPtr() [2/6]

dart::ObjectPtr::ObjectPtr ( )
inline

Definition at line 210 of file tagged_pointer.h.

210: tagged_pointer_(0) {}

◆ ObjectPtr() [3/6]

constexpr dart::ObjectPtr::ObjectPtr ( uword  tagged)
inlineexplicitconstexpr

Definition at line 211 of file tagged_pointer.h.

211: tagged_pointer_(tagged) {}

◆ ObjectPtr() [4/6]

constexpr dart::ObjectPtr::ObjectPtr ( intptr_t  tagged)
inlineexplicitconstexpr

Definition at line 212 of file tagged_pointer.h.

212: tagged_pointer_(tagged) {}

◆ ObjectPtr() [5/6]

constexpr dart::ObjectPtr::ObjectPtr ( std::nullptr_t  )
inlineconstexpr

Definition at line 213 of file tagged_pointer.h.

213: tagged_pointer_(0) {} // NOLINT

◆ ObjectPtr() [6/6]

dart::ObjectPtr::ObjectPtr ( UntaggedObject heap_object)
inlineexplicit

Definition at line 214 of file tagged_pointer.h.

215 : tagged_pointer_(reinterpret_cast<uword>(heap_object) + kHeapObjectTag) {
216 }
@ kHeapObjectTag
uintptr_t uword
Definition globals.h:501

Member Function Documentation

◆ Decompress()

ObjectPtr dart::ObjectPtr::Decompress ( uword  heap_base) const
inline

Definition at line 218 of file tagged_pointer.h.

218{ return *this; }

◆ DecompressSmi()

ObjectPtr dart::ObjectPtr::DecompressSmi ( ) const
inline

Definition at line 219 of file tagged_pointer.h.

219{ return *this; }

◆ GetClassId()

intptr_t dart::ObjectPtr::GetClassId ( ) const
inline

Definition at line 864 of file raw_object.h.

864 {
865 return untag()->GetClassId();
866}
UntaggedObject * untag() const
intptr_t GetClassId() const
Definition raw_object.h:371

◆ GetClassIdMayBeSmi()

intptr_t dart::ObjectPtr::GetClassIdMayBeSmi ( ) const
inline

Definition at line 151 of file tagged_pointer.h.

151 {
152 return IsHeapObject() ? GetClassId() : static_cast<intptr_t>(kSmiCid);
153 }
intptr_t GetClassId() const
Definition raw_object.h:864

◆ heap_base()

uword dart::ObjectPtr::heap_base ( ) const
inline

Definition at line 220 of file tagged_pointer.h.

220 {
221 // TODO(rmacnak): Why does Windows have trouble linking GetClassId used
222 // here?
223#if !defined(DART_HOST_OS_WINDOWS)
224 ASSERT(IsHeapObject());
225 ASSERT(!IsInstructions());
226 ASSERT(!IsInstructionsSection());
227#endif
229 }
#define ASSERT(E)
static constexpr uintptr_t kHeapBaseMask

◆ IsDartInstance()

bool dart::ObjectPtr::IsDartInstance ( ) const
inline

Definition at line 137 of file tagged_pointer.h.

137 {
138 return (!IsHeapObject() || !IsInternalOnlyClassId(GetClassId()));
139 }
bool IsInternalOnlyClassId(intptr_t index)
Definition class_id.h:299

◆ IsForwardingCorpse()

bool dart::ObjectPtr::IsForwardingCorpse ( ) const
inline

Definition at line 143 of file tagged_pointer.h.

143 {
144 return ((GetClassId() == kForwardingCorpse));
145 }
@ kForwardingCorpse
Definition class_id.h:225

◆ IsFreeListElement()

bool dart::ObjectPtr::IsFreeListElement ( ) const
inline

Definition at line 140 of file tagged_pointer.h.

140 {
141 return ((GetClassId() == kFreeListElement));
142 }
@ kFreeListElement
Definition class_id.h:224

◆ IsPseudoObject()

bool dart::ObjectPtr::IsPseudoObject ( ) const
inline

Definition at line 146 of file tagged_pointer.h.

146 {
148 }
bool IsFreeListElement() const
bool IsForwardingCorpse() const

◆ IsRawNull()

bool dart::ObjectPtr::IsRawNull ( ) const
inline

Definition at line 136 of file tagged_pointer.h.

136{ return GetClassId() == kNullCid; }
@ kNullCid
Definition class_id.h:252

◆ IsStringInstance()

bool dart::ObjectPtr::IsStringInstance ( ) const
inline

Definition at line 135 of file tagged_pointer.h.

135{ return IsStringClassId(GetClassId()); }
bool IsStringClassId(intptr_t index)
Definition class_id.h:350

◆ operator bool()

dart::ObjectPtr::operator bool ( ) const
delete

◆ operator int()

dart::ObjectPtr::operator int ( ) const
inlineexplicit

Definition at line 176 of file tagged_pointer.h.

176 { // NOLINT
177 return static_cast<int>(tagged_pointer_); // NOLINT
178 }

◆ operator long()

dart::ObjectPtr::operator long ( ) const
inlineexplicit

Definition at line 181 of file tagged_pointer.h.

181 { // NOLINT
182 return static_cast<long>(tagged_pointer_); // NOLINT
183 }

◆ operator long long()

dart::ObjectPtr::operator long long ( ) const
inlineexplicit

Definition at line 186 of file tagged_pointer.h.

186 { // NOLINT
187 return static_cast<long long>(tagged_pointer_); // NOLINT
188 }

◆ operator unsigned int()

dart::ObjectPtr::operator unsigned int ( ) const
inlineexplicit

Definition at line 191 of file tagged_pointer.h.

191 { // NOLINT
192 return static_cast<unsigned int>(tagged_pointer_); // NOLINT
193 }

◆ operator unsigned long()

dart::ObjectPtr::operator unsigned long ( ) const
inlineexplicit

Definition at line 196 of file tagged_pointer.h.

196 { // NOLINT
197 return static_cast<unsigned long>(tagged_pointer_); // NOLINT
198 }

◆ operator unsigned long long()

dart::ObjectPtr::operator unsigned long long ( ) const
inlineexplicit

Definition at line 201 of file tagged_pointer.h.

201 { // NOLINT
202 return static_cast<unsigned long long>(tagged_pointer_); // NOLINT
203 }

◆ operator!=() [1/2]

bool dart::ObjectPtr::operator!= ( const std::nullptr_t &  other)
inline

Definition at line 158 of file tagged_pointer.h.

158{ return tagged_pointer_ != 0; }

◆ operator!=() [2/2]

constexpr bool dart::ObjectPtr::operator!= ( const std::nullptr_t &  other) const
inlineconstexpr

Definition at line 162 of file tagged_pointer.h.

162 {
163 return tagged_pointer_ != 0;
164 }

◆ operator=()

ObjectPtr & dart::ObjectPtr::operator= ( const ObjectPtr other)
default

◆ operator==() [1/2]

bool dart::ObjectPtr::operator== ( const std::nullptr_t &  other)
inline

Definition at line 157 of file tagged_pointer.h.

157{ return tagged_pointer_ == 0; }

◆ operator==() [2/2]

constexpr bool dart::ObjectPtr::operator== ( const std::nullptr_t &  other) const
inlineconstexpr

Definition at line 159 of file tagged_pointer.h.

159 {
160 return tagged_pointer_ == 0;
161 }

◆ untag()

UntaggedObject * dart::ObjectPtr::untag ( ) const
inline

Definition at line 105 of file tagged_pointer.h.

105 {
106 return reinterpret_cast<UntaggedObject*>(untagged_pointer());
107 }
uword untagged_pointer() const

◆ untagged_pointer()

uword dart::ObjectPtr::untagged_pointer ( ) const
inlineprotected

Definition at line 232 of file tagged_pointer.h.

232 {
233 ASSERT(IsHeapObject());
235 }

◆ Validate()

void dart::ObjectPtr::Validate ( IsolateGroup isolate_group) const

Definition at line 30 of file raw_object.cc.

30 {
31 // All Smi values are valid.
32 if (!IsHeapObject()) {
33 return;
34 }
35 // Slightly more readable than a segfault.
37 FATAL("RAW_NULL encountered");
38 }
39 untag()->Validate(isolate_group);
40}
void Validate(IsolateGroup *isolate_group) const
Definition raw_object.cc:42
#define FATAL(error)

Member Data Documentation

◆ tagged_pointer_

uword dart::ObjectPtr::tagged_pointer_
protected

Definition at line 237 of file tagged_pointer.h.


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