Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
object.h File Reference
#include <limits>
#include <tuple>
#include <utility>
#include "include/dart_api.h"
#include "platform/assert.h"
#include "platform/atomic.h"
#include "platform/thread_sanitizer.h"
#include "platform/utils.h"
#include "vm/bitmap.h"
#include "vm/code_comments.h"
#include "vm/code_entry_kind.h"
#include "vm/compiler/assembler/object_pool_builder.h"
#include "vm/compiler/method_recognizer.h"
#include "vm/compiler/runtime_api.h"
#include "vm/dart.h"
#include "vm/flags.h"
#include "vm/globals.h"
#include "vm/growable_array.h"
#include "vm/handles.h"
#include "vm/heap/heap.h"
#include "vm/isolate.h"
#include "vm/json_stream.h"
#include "vm/os.h"
#include "vm/raw_object.h"
#include "vm/report.h"
#include "vm/static_type_exactness_state.h"
#include "vm/thread.h"
#include "vm/token_position.h"

Go to the source code of this file.

Classes

class  dart::Object
 
class  dart::PassiveObject
 
class  dart::Class
 
class  dart::PatchClass
 
class  dart::SingleTargetCache
 
class  dart::MonomorphicSmiableCall
 
class  dart::CallSiteData
 
class  dart::UnlinkedCall
 
class  dart::ICData
 
struct  dart::NameFormattingParams
 
class  dart::Function
 
struct  dart::Function::AwaiterLink
 
struct  dart::Function::ICDataArrayIndices
 
class  dart::Function::KindBits
 
class  dart::Function::RecognizedBits
 
class  dart::Function::ModifierBits
 
class  dart::ClosureData
 
class  dart::FfiTrampolineData
 
class  dart::Field
 
class  dart::Script
 
class  dart::DictionaryIterator
 
class  dart::ClassDictionaryIterator
 
class  dart::Library
 
class  dart::Namespace
 
class  dart::KernelProgramInfo
 
class  dart::ObjectPool
 
struct  dart::ObjectPool::Entry
 
struct  dart::ObjectPool::ArrayTraits
 
class  dart::Instructions
 
class  dart::Instructions::SizeBits
 
class  dart::InstructionsSection
 
class  dart::InstructionsTable
 
class  dart::LocalVarDescriptors
 
class  dart::PcDescriptors
 
class  dart::PcDescriptors::Iterator
 
class  dart::CodeSourceMap
 
class  dart::CompressedStackMaps
 
class  dart::CompressedStackMaps::RawPayloadHandle
 
class  dart::CompressedStackMaps::Iterator< PayloadHandle >
 
class  dart::ExceptionHandlers
 
struct  dart::ExceptionHandlers::ArrayTraits
 
class  dart::WeakSerializationReference
 
class  dart::WeakArray
 
struct  dart::WeakArray::ArrayTraits
 
class  dart::Code
 
class  dart::Code::KindField
 
class  dart::Code::EntryPointField
 
class  dart::Code::OffsetField
 
struct  dart::Code::ArrayTraits
 
class  dart::Context
 
struct  dart::Context::ArrayTraits
 
class  dart::ContextScope
 
struct  dart::ContextScope::ArrayTraits
 
class  dart::Sentinel
 
class  dart::MegamorphicCache
 
class  dart::SubtypeTestCache
 
class  dart::LoadingUnit
 
class  dart::Error
 
class  dart::ApiError
 
class  dart::LanguageError
 
class  dart::UnhandledException
 
class  dart::UnwindError
 
class  dart::Instance
 
class  dart::LibraryPrefix
 
class  dart::TypeParameters
 
class  dart::TypeArguments
 
struct  dart::TypeArguments::ArrayTraits
 
class  dart::TypeArguments::Cache
 
struct  dart::TypeArguments::Cache::KeyLocation
 
class  dart::AbstractType
 
class  dart::Type
 
class  dart::FunctionType
 
class  dart::TypeParameter
 
class  dart::Number
 
class  dart::Integer
 
class  dart::Smi
 
class  dart::SmiTraits
 
class  dart::Mint
 
class  dart::Double
 
class  dart::Symbol
 
class  dart::String
 
class  dart::String::CodePointIterator
 
class  dart::StringHasher
 
class  dart::OneByteString
 
struct  dart::OneByteString::ArrayTraits
 
class  dart::TwoByteString
 
struct  dart::TwoByteString::ArrayTraits
 
class  dart::Bool
 
class  dart::Array
 
struct  dart::Array::ArrayTraits
 
class  dart::ImmutableArray
 
class  dart::GrowableObjectArray
 
class  dart::Float32x4
 
class  dart::Int32x4
 
class  dart::Float64x2
 
class  dart::RecordShape
 
class  dart::RecordType
 
class  dart::Record
 
struct  dart::Record::ArrayTraits
 
class  dart::PointerBase
 
class  dart::TypedDataBase
 
class  dart::TypedData
 
class  dart::ExternalTypedData
 
class  dart::TypedDataView
 
class  dart::ByteBuffer
 
class  dart::Pointer
 
class  dart::DynamicLibrary
 
class  dart::LinkedHashBase
 
class  dart::ImmutableLinkedHashBase
 
class  dart::Map
 
class  dart::Map::Iterator
 
class  dart::ConstMap
 
class  dart::Set
 
class  dart::Set::Iterator
 
class  dart::ConstSet
 
class  dart::Closure
 
class  dart::Capability
 
class  dart::ReceivePort
 
class  dart::SendPort
 
class  dart::TransferableTypedDataPeer
 
class  dart::TransferableTypedData
 
class  dart::StackTrace
 
class  dart::SuspendState
 
class  dart::RegExpFlags
 
class  dart::RegExp
 
class  dart::RegExp::TypeBits
 
class  dart::RegExp::GlobalBit
 
class  dart::RegExp::IgnoreCaseBit
 
class  dart::RegExp::MultiLineBit
 
class  dart::RegExp::UnicodeBit
 
class  dart::RegExp::DotAllBit
 
class  dart::RegExp::FlagsBits
 
class  dart::WeakProperty
 
class  dart::WeakReference
 
class  dart::FinalizerEntry
 
class  dart::FinalizerBase
 
class  dart::Finalizer
 
class  dart::NativeFinalizer
 
class  dart::MirrorReference
 
class  dart::UserTag
 
class  dart::FutureOr
 
class  dart::ArrayOfTuplesView< EnumType, TupleT, kStartOffset >
 
class  dart::ArrayOfTuplesView< EnumType, TupleT, kStartOffset >::TupleView
 
class  dart::ArrayOfTuplesView< EnumType, TupleT, kStartOffset >::Iterator
 

Namespaces

namespace  dart
 
namespace  dart::compiler
 
namespace  dart::kernel
 

Macros

#define DEFINE_FORWARD_DECLARATION(clazz)   class clazz;
 
#define REUSABLE_FORWARD_DECLARATION(name)   class Reusable##name##HandleScope;
 
#define CHECK_HANDLE()
 
#define ALLSTATIC_CONTAINS_COMPRESSED_IMPLEMENTATION(object, handle)
 
#define BASE_OBJECT_IMPLEMENTATION(object, super)
 
#define OBJECT_SERVICE_SUPPORT(object)
 
#define SNAPSHOT_SUPPORT(object)
 
#define OBJECT_IMPLEMENTATION(object, super)
 
#define HEAP_OBJECT_IMPLEMENTATION(object, super)
 
#define FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, rettype, super)
 
#define FINAL_HEAP_OBJECT_IMPLEMENTATION(object, super)    FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, object, super)
 
#define MINT_OBJECT_IMPLEMENTATION(object, rettype, super)    FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, rettype, super)
 
#define DEFINE_CLASS_TESTER(clazz)
 
#define SHARED_READONLY_HANDLES_LIST(V)
 
#define DEFINE_SHARED_READONLY_HANDLE_GETTER(Type, name)
 
#define STORE_NON_POINTER_ILLEGAL_TYPE(type)
 
#define DECLARE_SHARED_READONLY_HANDLE(Type, name)   static Type* name##_;
 
#define REUSABLE_FRIEND_DECLARATION(name)    friend class Reusable##name##HandleScope;
 
#define PRECOMPILER_WSR_FIELD_DECLARATION(Type, Name)
 
#define DEFINE_NON_POINTER_FIELD_ACCESSORS(type, name)
 
#define DEOPT_REASONS(V)
 
#define DEFINE_ENUM_LIST(name)   kDeopt##name,
 
#define FOR_EACH_REBIND_RULE(V)
 
#define REBIND_ENUM_DEF(name)   k##name,
 
#define DEFINE_GETTERS_AND_SETTERS(return_type, type, name)
 
#define STATE_BITS_LIST(V)
 
#define DECLARE_FLAG_POS(Name)   k##Name##Pos,
 
#define DEFINE_FLAG_BIT(Name)    class Name##Bit : public BitField<uint8_t, bool, k##Name##Pos, 1> {};
 
#define DEFINE_FLAG_ACCESSORS(Name)
 
#define FOR_EACH_FUNCTION_KIND_BIT(V)
 
#define FOR_EACH_FUNCTION_VOLATILE_KIND_BIT(V)   V(Inlinable, is_inlinable)
 
#define DEFINE_ACCESSORS(name, accessor_name)
 
#define DEFINE_ACCESSORS(name, accessor_name)
 
#define DECLARE_BIT(name, _)   k##name##Bit,
 
#define ASSERT_FUNCTION_KIND_IN_RANGE(Name)    COMPILE_ASSERT(UntaggedFunction::k##Name < (1 << kKindTagSize));
 
#define DEFINE_BIT(name, _)    class name##Bit : public BitField<uint32_t, bool, k##name##Bit, 1> {};
 
#define INSTRUCTIONS_FLAGS_LIST(V)
 
#define DEFINE_INSTRUCTIONS_FLAG(Name)   k##Name##Index,
 
#define DEFINE_INSTRUCTIONS_FLAG_HANDLING(Name)
 
#define DEFINE_INSTRUCTIONS_FLAG_HANDLING(Name)
 
#define DECLARE_FLAG_ACCESSORS(Name)
 
#define TYPED_GETTER_SETTER(name, type)
 
#define TYPED_GETTER_SETTER(name, type)
 

Typedefs

typedef ZoneGrowableHandlePtrArray< const Stringdart::URIs
 
using dart::StaticCallsTable = ArrayOfTuplesView< Code::SCallTableEntry, std::tuple< Smi, Object, Function > >
 
using dart::StaticCallsTableEntry = StaticCallsTable::TupleView
 
using dart::SubtypeTestCacheTable = ArrayOfTuplesView< SubtypeTestCache::Entries, std::tuple< Object, TypeArguments, TypeArguments, TypeArguments, TypeArguments, TypeArguments, AbstractType, Bool > >
 
using dart::MegamorphicCacheEntries = ArrayOfTuplesView< MegamorphicCache::EntryType, std::tuple< Smi, Object > >
 
using dart::InstantiationsCacheTable = ArrayOfTuplesView< TypeArguments::Cache::Entry, std::tuple< Object, TypeArguments, TypeArguments >, TypeArguments::Cache::kHeaderSize >
 

Enumerations

enum class  dart::Nullability : uint8_t { dart::kNullable = 0 , dart::kNonNullable = 1 , dart::kLegacy = 2 }
 
enum class  dart::TypeEquality { dart::kCanonical = 0 , dart::kSyntactical = 1 , dart::kInSubtypeTest = 2 }
 
enum class  dart::NNBDCompiledMode { dart::kStrong = 0 , dart::kWeak = 1 , dart::kAgnostic = 2 , dart::kInvalid = 3 }
 
enum  dart::Genericity { dart::kAny , dart::kCurrentClass , dart::kFunctions }
 
enum  { dart::kNoneFree = 0 , dart::kCurrentAndEnclosingFree = kMaxInt32 - 1 , dart::kAllFree = kMaxInt32 }
 
enum class  dart::FfiCallbackKind : uint8_t { dart::kIsolateLocalStaticCallback , dart::kIsolateLocalClosureCallback , dart::kAsyncCallback }
 
enum class  dart::EntryPointPragma {
  dart::kAlways , dart::kNever , dart::kGetterOnly , dart::kSetterOnly ,
  dart::kCallOnly
}
 

Functions

void dart::DFLRT_ExitSafepoint (NativeArguments __unusable_)
 
void dart::DumpTypeTable (Isolate *isolate)
 
void dart::DumpTypeParameterTable (Isolate *isolate)
 
void dart::DumpTypeArgumentsTable (Isolate *isolate)
 
bool dart::FindPragmaInMetadata (Thread *T, const Object &metadata_obj, const String &pragma_name, bool multiple, Object *options)
 
EntryPointPragma dart::FindEntryPointPragma (IsolateGroup *IG, const Array &metadata, Field *reusable_field_handle, Object *pragma)
 
DART_WARN_UNUSED_RESULT ErrorPtr dart::EntryPointFieldInvocationError (const String &getter_name)
 
DART_WARN_UNUSED_RESULT ErrorPtr dart::EntryPointMemberInvocationError (const Object &member)
 

Variables

static constexpr intptr_t dart::kNullIdentityHash = 2011
 
static constexpr intptr_t dart::kTrueIdentityHash = 1231
 
static constexpr intptr_t dart::kFalseIdentityHash = 1237
 

Macro Definition Documentation

◆ ALLSTATIC_CONTAINS_COMPRESSED_IMPLEMENTATION

#define ALLSTATIC_CONTAINS_COMPRESSED_IMPLEMENTATION (   object,
  handle 
)
Value:
public: /* NOLINT */ \
using UntaggedObjectType = dart::Untagged##object; \
using ObjectPtrType = dart::object##Ptr; \
static_assert(std::is_base_of<dart::handle##Ptr, ObjectPtrType>::value, \
#object "Ptr must be a subtype of " #handle "Ptr"); \
static_assert(dart::handle::ContainsCompressedPointers() == \
UntaggedObjectType::kContainsCompressedPointers, \
"Pointer compression in Untagged" #object \
" must match pointer compression in Untagged" #handle); \
static constexpr bool ContainsCompressedPointers() { \
return UntaggedObjectType::kContainsCompressedPointers; \
} \
\
private: /* NOLINT */

Definition at line 90 of file object.h.

91 : /* NOLINT */ \
92 using UntaggedObjectType = dart::Untagged##object; \
93 using ObjectPtrType = dart::object##Ptr; \
94 static_assert(std::is_base_of<dart::handle##Ptr, ObjectPtrType>::value, \
95 #object "Ptr must be a subtype of " #handle "Ptr"); \
96 static_assert(dart::handle::ContainsCompressedPointers() == \
97 UntaggedObjectType::kContainsCompressedPointers, \
98 "Pointer compression in Untagged" #object \
99 " must match pointer compression in Untagged" #handle); \
100 static constexpr bool ContainsCompressedPointers() { \
101 return UntaggedObjectType::kContainsCompressedPointers; \
102 } \
103 \
104 private: /* NOLINT */

◆ ASSERT_FUNCTION_KIND_IN_RANGE

#define ASSERT_FUNCTION_KIND_IN_RANGE (   Name)     COMPILE_ASSERT(UntaggedFunction::k##Name < (1 << kKindTagSize));

Definition at line 4216 of file object.h.

◆ BASE_OBJECT_IMPLEMENTATION

#define BASE_OBJECT_IMPLEMENTATION (   object,
  super 
)

Definition at line 106 of file object.h.

107 : /* NOLINT */ \
108 using UntaggedObjectType = dart::Untagged##object; \
109 using ObjectPtrType = dart::object##Ptr; \
110 static_assert(!dart::super::ContainsCompressedPointers() || \
111 UntaggedObjectType::kContainsCompressedPointers, \
112 "Untagged" #object \
113 " must have compressed pointers, as supertype Untagged" #super \
114 " has compressed pointers"); \
115 static constexpr bool ContainsCompressedPointers() { \
116 return UntaggedObjectType::kContainsCompressedPointers; \
117 } \
118 object##Ptr ptr() const { \
119 return static_cast<object##Ptr>(ptr_); \
120 } \
121 bool Is##object() const { \
122 return true; \
123 } \
124 DART_NOINLINE static object& Handle() { \
125 return static_cast<object&>( \
126 HandleImpl(Thread::Current()->zone(), object::null(), kClassId)); \
127 } \
128 DART_NOINLINE static object& Handle(Zone* zone) { \
129 return static_cast<object&>(HandleImpl(zone, object::null(), kClassId)); \
130 } \
131 DART_NOINLINE static object& Handle(object##Ptr ptr) { \
132 return static_cast<object&>( \
133 HandleImpl(Thread::Current()->zone(), ptr, kClassId)); \
134 } \
135 DART_NOINLINE static object& Handle(Zone* zone, object##Ptr ptr) { \
136 return static_cast<object&>(HandleImpl(zone, ptr, kClassId)); \
137 } \
138 DART_NOINLINE static object& ZoneHandle() { \
139 return static_cast<object&>( \
140 ZoneHandleImpl(Thread::Current()->zone(), object::null(), kClassId)); \
141 } \
142 DART_NOINLINE static object& ZoneHandle(Zone* zone) { \
143 return static_cast<object&>( \
144 ZoneHandleImpl(zone, object::null(), kClassId)); \
145 } \
146 DART_NOINLINE static object& ZoneHandle(object##Ptr ptr) { \
147 return static_cast<object&>( \
148 ZoneHandleImpl(Thread::Current()->zone(), ptr, kClassId)); \
149 } \
150 DART_NOINLINE static object& ZoneHandle(Zone* zone, object##Ptr ptr) { \
151 return static_cast<object&>(ZoneHandleImpl(zone, ptr, kClassId)); \
152 } \
153 static object* ReadOnlyHandle() { \
154 return static_cast<object*>(ReadOnlyHandleImpl(kClassId)); \
155 } \
156 DART_NOINLINE static object& CheckedHandle(Zone* zone, ObjectPtr ptr) { \
157 object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(zone)); \
158 initializeHandle(obj, ptr); \
159 if (!obj->Is##object()) { \
160 FATAL("Handle check failed: saw %s expected %s", obj->ToCString(), \
161 #object); \
162 } \
163 return *obj; \
164 } \
165 DART_NOINLINE static object& CheckedZoneHandle(Zone* zone, ObjectPtr ptr) { \
166 object* obj = \
167 reinterpret_cast<object*>(VMHandles::AllocateZoneHandle(zone)); \
168 initializeHandle(obj, ptr); \
169 if (!obj->Is##object()) { \
170 FATAL("Handle check failed: saw %s expected %s", obj->ToCString(), \
171 #object); \
172 } \
173 return *obj; \
174 } \
175 DART_NOINLINE static object& CheckedZoneHandle(ObjectPtr ptr) { \
176 return CheckedZoneHandle(Thread::Current()->zone(), ptr); \
177 } \
178 /* T::Cast cannot be applied to a null Object, because the object vtable */ \
179 /* is not setup for type T, although some methods are supposed to work */ \
180 /* with null, for example Instance::Equals(). */ \
181 static const object& Cast(const Object& obj) { \
182 ASSERT(obj.Is##object()); \
183 return reinterpret_cast<const object&>(obj); \
184 } \
185 static object##Ptr RawCast(ObjectPtr raw) { \
186 ASSERT(Is##object##NoHandle(raw)); \
187 return static_cast<object##Ptr>(raw); \
188 } \
189 static object##Ptr null() { \
190 return static_cast<object##Ptr>(Object::null()); \
191 } \
192 virtual const char* ToCString() const; \
193 static const ClassId kClassId = k##object##Cid; \
194 \
195 private: /* NOLINT */ \
196 /* Initialize the handle based on the ptr in the presence of null. */ \
197 static void initializeHandle(object* obj, ObjectPtr ptr) { \
198 obj->setPtr(ptr, kClassId); \
199 } \
200 /* Disallow allocation, copy constructors and override super assignment. */ \
201 public: /* NOLINT */ \
202 void operator delete(void* pointer) { \
203 UNREACHABLE(); \
204 } \
205 \
206 private: /* NOLINT */ \
207 void* operator new(size_t size); \
208 object(const object& value) = delete; \
209 void operator=(super##Ptr value) = delete; \
210 void operator=(const object& value) = delete; \
211 void operator=(const super& value) = delete;
ClassId
Definition class_id.h:212
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259

◆ CHECK_HANDLE

#define CHECK_HANDLE ( )

Definition at line 84 of file object.h.

◆ DECLARE_BIT

#define DECLARE_BIT (   name,
 
)    k##name##Bit,

Definition at line 4203 of file object.h.

◆ DECLARE_FLAG_ACCESSORS

#define DECLARE_FLAG_ACCESSORS (   Name)
Value:
bool Is##Name##At(intptr_t scope_index) const; \
void SetIs##Name##At(intptr_t scope_index, bool value) const;

Definition at line 7473 of file object.h.

◆ DECLARE_FLAG_POS

#define DECLARE_FLAG_POS (   Name)    k##Name##Pos,

Definition at line 4076 of file object.h.

◆ DECLARE_SHARED_READONLY_HANDLE

#define DECLARE_SHARED_READONLY_HANDLE (   Type,
  name 
)    static Type* name##_;

Definition at line 1013 of file object.h.

◆ DEFINE_ACCESSORS [1/2]

#define DEFINE_ACCESSORS (   name,
  accessor_name 
)
Value:
void set_##accessor_name(bool value) const { \
untag()->kind_tag_.UpdateUnsynchronized<name##Bit>(value); \
} \
bool accessor_name() const { return untag()->kind_tag_.Read<name##Bit>(); }
uint8_t value
const char * name
Definition fuchsia.cc:50

Definition at line 4155 of file object.h.

4156 { \
4157 untag()->kind_tag_.UpdateUnsynchronized<name##Bit>(value); \
4158 } \
4159 bool accessor_name() const { return untag()->kind_tag_.Read<name##Bit>(); }
raw_obj untag() -> num_entries()) VARIABLE_COMPRESSED_VISITOR(Array, Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(TypedData, TypedData::ElementSizeInBytes(raw_obj->GetClassId()) *Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(Record, RecordShape(raw_obj->untag() ->shape()).num_fields()) VARIABLE_NULL_VISITOR(CompressedStackMaps, CompressedStackMaps::PayloadSizeOf(raw_obj)) VARIABLE_NULL_VISITOR(OneByteString, Smi::Value(raw_obj->untag() ->length())) VARIABLE_NULL_VISITOR(TwoByteString, Smi::Value(raw_obj->untag() ->length())) intptr_t UntaggedField::VisitFieldPointers(FieldPtr raw_obj, ObjectPointerVisitor *visitor)

◆ DEFINE_ACCESSORS [2/2]

#define DEFINE_ACCESSORS (   name,
  accessor_name 
)
Value:
void set_##accessor_name(bool value) const { \
untag()->kind_tag_.UpdateBool<name##Bit>(value); \
} \
bool accessor_name() const { return untag()->kind_tag_.Read<name##Bit>(); }

Definition at line 4155 of file object.h.

4156 { \
4157 untag()->kind_tag_.UpdateUnsynchronized<name##Bit>(value); \
4158 } \
4159 bool accessor_name() const { return untag()->kind_tag_.Read<name##Bit>(); }

◆ DEFINE_BIT

#define DEFINE_BIT (   name,
 
)     class name##Bit : public BitField<uint32_t, bool, k##name##Bit, 1> {};

Definition at line 4235 of file object.h.

4236 : public BitField<uint32_t, bool, k##name##Bit, 1> {};

◆ DEFINE_CLASS_TESTER

#define DEFINE_CLASS_TESTER (   clazz)
Value:
virtual bool Is##clazz() const { return false; } \
static bool Is##clazz##NoHandle(ObjectPtr ptr) { \
/* Use a stack handle to make RawCast safe in contexts where handles */ \
/* should not be allocated, such as GC or runtime transitions. Not */ \
/* using Object's constructor to avoid Is##clazz being de-virtualized. */ \
char buf[sizeof(Object)]; \
Object* obj = reinterpret_cast<Object*>(&buf); \
initializeHandle(obj, ptr); \
return obj->IsNull() || obj->Is##clazz(); \
}

Definition at line 349 of file object.h.

350 { return false; } \
351 static bool Is##clazz##NoHandle(ObjectPtr ptr) { \
352 /* Use a stack handle to make RawCast safe in contexts where handles */ \
353 /* should not be allocated, such as GC or runtime transitions. Not */ \
354 /* using Object's constructor to avoid Is##clazz being de-virtualized. */ \
355 char buf[sizeof(Object)]; \
356 Object* obj = reinterpret_cast<Object*>(&buf); \
357 initializeHandle(obj, ptr); \
358 return obj->IsNull() || obj->Is##clazz(); \
359 }

◆ DEFINE_ENUM_LIST

#define DEFINE_ENUM_LIST (   name)    kDeopt##name,

Definition at line 2493 of file object.h.

◆ DEFINE_FLAG_ACCESSORS

#define DEFINE_FLAG_ACCESSORS (   Name)
Value:
void Set##Name(bool value) const { \
set_state_bits(Name##Bit::update(value, state_bits())); \
} \
bool Name() const { return Name##Bit::decode(state_bits()); }

Definition at line 4085 of file object.h.

4086 { \
4087 set_state_bits(Name##Bit::update(value, state_bits())); \
4088 } \
4089 bool Name() const { return Name##Bit::decode(state_bits()); }
ImplicitString Name
Definition DMSrcSink.h:38

◆ DEFINE_FLAG_BIT

#define DEFINE_FLAG_BIT (   Name)     class Name##Bit : public BitField<uint8_t, bool, k##Name##Pos, 1> {};

Definition at line 4080 of file object.h.

4081 : public BitField<uint8_t, bool, k##Name##Pos, 1> {};

◆ DEFINE_FORWARD_DECLARATION

#define DEFINE_FORWARD_DECLARATION (   clazz)    class clazz;

Definition at line 54 of file object.h.

◆ DEFINE_GETTERS_AND_SETTERS

#define DEFINE_GETTERS_AND_SETTERS (   return_type,
  type,
  name 
)
Value:
static intptr_t name##_offset() { \
return OFFSET_OF(UntaggedFunction, name##_); \
} \
return_type name() const { \
return LoadNonPointer<type, std::memory_order_relaxed>(&untag()->name##_); \
} \
\
void set_##name(type value) const { \
StoreNonPointer<type, type, std::memory_order_relaxed>(&untag()->name##_, \
value); \
}
#define OFFSET_OF(type, field)
Definition globals.h:138

Definition at line 3512 of file object.h.

3513 { \
3514 return OFFSET_OF(UntaggedFunction, name##_); \
3515 } \
3516 return_type name() const { \
3517 return LoadNonPointer<type, std::memory_order_relaxed>(&untag()->name##_); \
3518 } \
3519 \
3520 void set_##name(type value) const { \
3521 StoreNonPointer<type, type, std::memory_order_relaxed>(&untag()->name##_, \
3522 value); \
3523 }

◆ DEFINE_INSTRUCTIONS_FLAG

#define DEFINE_INSTRUCTIONS_FLAG (   Name)    k##Name##Index,

Definition at line 5691 of file object.h.

◆ DEFINE_INSTRUCTIONS_FLAG_HANDLING [1/2]

#define DEFINE_INSTRUCTIONS_FLAG_HANDLING (   Name)
Value:
class Name##Bit \
: public BitField<uint32_t, bool, kFlagsPos + k##Name##Index, 1> {}; \
bool Name() const { return Name##Bit::decode(untag()->size_and_flags_); } \
static bool Name(const InstructionsPtr instr) { \
return Name##Bit::decode(instr->untag()->size_and_flags_); \
}

Definition at line 5698 of file object.h.

5700 : public BitField<uint32_t, bool, kFlagsPos + k##Name##Index, 1> {}; \
5701 bool Name() const { return Name##Bit::decode(untag()->size_and_flags_); } \
5702 static bool Name(const InstructionsPtr instr) { \
5703 return Name##Bit::decode(instr->untag()->size_and_flags_); \
5704 }

◆ DEFINE_INSTRUCTIONS_FLAG_HANDLING [2/2]

#define DEFINE_INSTRUCTIONS_FLAG_HANDLING (   Name)
Value:
void Set##Name(bool value) const { \
StoreNonPointer(&untag()->size_and_flags_, \
Name##Bit::update(value, untag()->size_and_flags_)); \
}

Definition at line 5698 of file object.h.

5700 : public BitField<uint32_t, bool, kFlagsPos + k##Name##Index, 1> {}; \
5701 bool Name() const { return Name##Bit::decode(untag()->size_and_flags_); } \
5702 static bool Name(const InstructionsPtr instr) { \
5703 return Name##Bit::decode(instr->untag()->size_and_flags_); \
5704 }

◆ DEFINE_NON_POINTER_FIELD_ACCESSORS

#define DEFINE_NON_POINTER_FIELD_ACCESSORS (   type,
  name 
)
Value:
type name() const { return untag()->name##_; } \
void set_##name(type value) const { \
StoreNonPointer(&untag()->name##_, value); \
} \
static intptr_t name##_offset() { \
return OFFSET_OF(UntaggedSingleTargetCache, name##_); \
}

Definition at line 2301 of file object.h.

2302 { return untag()->name##_; } \
2303 void set_##name(type value) const { \
2304 StoreNonPointer(&untag()->name##_, value); \
2305 } \
2306 static intptr_t name##_offset() { \
2307 return OFFSET_OF(UntaggedSingleTargetCache, name##_); \
2308 }

◆ DEFINE_SHARED_READONLY_HANDLE_GETTER

#define DEFINE_SHARED_READONLY_HANDLE_GETTER (   Type,
  name 
)
Value:
static const Type& name() { \
ASSERT(name##_ != nullptr); \
return *name##_; \
}

Definition at line 503 of file object.h.

504 { \
505 ASSERT(name##_ != nullptr); \
506 return *name##_; \
507 }

◆ DEOPT_REASONS

#define DEOPT_REASONS (   V)
Value:
V(BinarySmiOp) \
V(BinaryInt64Op) \
V(DoubleToSmi) \
V(CheckSmi) \
V(CheckClass) \
V(Unknown) \
V(PolymorphicInstanceCallTestFail) \
V(UnaryInt64Op) \
V(BinaryDoubleOp) \
V(UnaryOp) \
V(UnboxInteger) \
V(Unbox) \
V(CheckArrayBound) \
V(AtCall) \
V(GuardField) \
V(TestCids) \
V(NumReasons)
#define V(name)
Definition raw_object.h:124

Definition at line 2473 of file object.h.

◆ FINAL_HEAP_OBJECT_IMPLEMENTATION

#define FINAL_HEAP_OBJECT_IMPLEMENTATION (   object,
  super 
)     FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, object, super)

Definition at line 300 of file object.h.

◆ FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER

#define FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER (   object,
  rettype,
  super 
)
Value:
public: /* NOLINT */ \
void operator=(object##Ptr value) { \
ptr_ = value; \
CHECK_HANDLE(); \
} \
void operator^=(ObjectPtr value) { \
ptr_ = value; \
CHECK_HANDLE(); \
} \
\
private: /* NOLINT */ \
object() : super() {} \
BASE_OBJECT_IMPLEMENTATION(object, super) \
OBJECT_SERVICE_SUPPORT(object) \
Untagged##object* untag() const { \
ASSERT(ptr() != null()); \
return const_cast<Untagged##object*>(ptr()->untag()); \
} \
static intptr_t NextFieldOffset() { \
return -kWordSize; \
} \
SNAPSHOT_SUPPORT(rettype) \
friend class Object; \
friend class StackFrame; \
friend class Thread; \
friend void DFLRT_ExitSafepoint(NativeArguments __unusable_);
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator^=(E &l, E r)
constexpr intptr_t kWordSize
Definition globals.h:509
void DFLRT_ExitSafepoint(NativeArguments __unusable_)

Definition at line 272 of file object.h.

273 : /* NOLINT */ \
274 void operator=(object##Ptr value) { \
275 ptr_ = value; \
276 CHECK_HANDLE(); \
277 } \
278 void operator^=(ObjectPtr value) { \
279 ptr_ = value; \
280 CHECK_HANDLE(); \
281 } \
282 \
283 private: /* NOLINT */ \
284 object() : super() {} \
285 BASE_OBJECT_IMPLEMENTATION(object, super) \
286 OBJECT_SERVICE_SUPPORT(object) \
287 Untagged##object* untag() const { \
288 ASSERT(ptr() != null()); \
289 return const_cast<Untagged##object*>(ptr()->untag()); \
290 } \
291 static intptr_t NextFieldOffset() { \
292 return -kWordSize; \
293 } \
294 SNAPSHOT_SUPPORT(rettype) \
295 friend class Object; \
296 friend class StackFrame; \
297 friend class Thread; \
298 friend void DFLRT_ExitSafepoint(NativeArguments __unusable_);

◆ FOR_EACH_FUNCTION_KIND_BIT

#define FOR_EACH_FUNCTION_KIND_BIT (   V)
Value:
V(Static, is_static) \
V(Const, is_const) \
V(Abstract, is_abstract) \
V(Reflectable, is_reflectable) \
V(Visible, is_visible) \
V(Debuggable, is_debuggable) \
V(Intrinsic, is_intrinsic) \
V(Native, is_native) \
V(External, is_external) \
V(PolymorphicTarget, is_polymorphic_target) \
V(HasPragma, has_pragma) \
V(IsSynthetic, is_synthetic) \
V(IsExtensionMember, is_extension_member) \
V(IsExtensionTypeMember, is_extension_type_member) \
V(IsRedirectingFactory, is_redirecting_factory)

Definition at line 4135 of file object.h.

◆ FOR_EACH_FUNCTION_VOLATILE_KIND_BIT

#define FOR_EACH_FUNCTION_VOLATILE_KIND_BIT (   V)    V(Inlinable, is_inlinable)

Definition at line 4153 of file object.h.

◆ FOR_EACH_REBIND_RULE

#define FOR_EACH_REBIND_RULE (   V)
Value:
V(Instance) \
V(NoRebind) \
V(NSMDispatch) \
V(Optimized) \
V(Static) \
V(Super)

Definition at line 2517 of file object.h.

◆ HEAP_OBJECT_IMPLEMENTATION

#define HEAP_OBJECT_IMPLEMENTATION (   object,
  super 
)
Value:
OBJECT_IMPLEMENTATION(object, super); \
Untagged##object* untag() const { \
ASSERT(ptr() != null()); \
return const_cast<Untagged##object*>(ptr()->untag()); \
} \
SNAPSHOT_SUPPORT(object) \
friend class StackFrame; \
friend class Thread; \
friend void DFLRT_ExitSafepoint(NativeArguments __unusable_);
#define OBJECT_IMPLEMENTATION(object, super)
Definition object.h:242

Definition at line 260 of file object.h.

262 { \
263 ASSERT(ptr() != null()); \
264 return const_cast<Untagged##object*>(ptr()->untag()); \
265 } \
266 SNAPSHOT_SUPPORT(object) \
267 friend class StackFrame; \
268 friend class Thread; \
269 friend void DFLRT_ExitSafepoint(NativeArguments __unusable_);

◆ INSTRUCTIONS_FLAGS_LIST

#define INSTRUCTIONS_FLAGS_LIST (   V)
Value:
V(HasMonomorphicEntry) \
V(ShouldBeAligned)

Definition at line 5686 of file object.h.

◆ MINT_OBJECT_IMPLEMENTATION

#define MINT_OBJECT_IMPLEMENTATION (   object,
  rettype,
  super 
)     FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, rettype, super)

Definition at line 303 of file object.h.

◆ OBJECT_IMPLEMENTATION

#define OBJECT_IMPLEMENTATION (   object,
  super 
)
Value:
public: /* NOLINT */ \
DART_NOINLINE void operator=(object##Ptr value) { \
initializeHandle(this, value); \
} \
DART_NOINLINE void operator^=(ObjectPtr value) { \
initializeHandle(this, value); \
ASSERT(IsNull() || Is##object()); \
} \
\
protected: /* NOLINT */ \
object() : super() {} \
BASE_OBJECT_IMPLEMENTATION(object, super) \
OBJECT_SERVICE_SUPPORT(object) \
friend class Object;

Definition at line 242 of file object.h.

243 : /* NOLINT */ \
244 DART_NOINLINE void operator=(object##Ptr value) { \
245 initializeHandle(this, value); \
246 } \
247 DART_NOINLINE void operator^=(ObjectPtr value) { \
248 initializeHandle(this, value); \
249 ASSERT(IsNull() || Is##object()); \
250 } \
251 \
252 protected: /* NOLINT */ \
253 object() : super() {} \
254 BASE_OBJECT_IMPLEMENTATION(object, super) \
255 OBJECT_SERVICE_SUPPORT(object) \
256 friend class Object;
DART_EXPORT bool IsNull(Dart_Handle object)

◆ OBJECT_SERVICE_SUPPORT

#define OBJECT_SERVICE_SUPPORT (   object)
Value:
protected: /* NOLINT */ \
/* Object is printed as JSON into stream. If ref is true only a header */ \
/* with an object id is printed. If ref is false the object is fully */ \
/* printed. */ \
virtual void PrintJSONImpl(JSONStream* stream, bool ref) const; \
/* Prints JSON objects that describe the implementation-level fields of */ \
/* the current Object to |jsarr_fields|. */ \
virtual void PrintImplementationFieldsImpl(const JSONArray& jsarr_fields) \
const; \
virtual const char* JSONType() const { \
return "" #object; \
}

Definition at line 221 of file object.h.

222 : /* NOLINT */ \
223 /* Object is printed as JSON into stream. If ref is true only a header */ \
224 /* with an object id is printed. If ref is false the object is fully */ \
225 /* printed. */ \
226 virtual void PrintJSONImpl(JSONStream* stream, bool ref) const; \
227 /* Prints JSON objects that describe the implementation-level fields of */ \
228 /* the current Object to |jsarr_fields|. */ \
229 virtual void PrintImplementationFieldsImpl(const JSONArray& jsarr_fields) \
230 const; \
231 virtual const char* JSONType() const { \
232 return "" #object; \
233 }

◆ PRECOMPILER_WSR_FIELD_DECLARATION

#define PRECOMPILER_WSR_FIELD_DECLARATION (   Type,
  Name 
)
Value:
Type##Ptr Name() const { \
return untag()->Name(); \
} \
void set_##Name(const Type& value) const;

Definition at line 1055 of file object.h.

1056 { \
1057 return untag()->Name(); \
1058 } \
1059 void set_##Name(const Type& value) const;

◆ REBIND_ENUM_DEF

#define REBIND_ENUM_DEF (   name)    k##name,

Definition at line 2526 of file object.h.

◆ REUSABLE_FORWARD_DECLARATION

#define REUSABLE_FORWARD_DECLARATION (   name)    class Reusable##name##HandleScope;

Definition at line 74 of file object.h.

◆ REUSABLE_FRIEND_DECLARATION

#define REUSABLE_FRIEND_DECLARATION (   name)     friend class Reusable##name##HandleScope;

Definition at line 1027 of file object.h.

◆ SHARED_READONLY_HANDLES_LIST

#define SHARED_READONLY_HANDLES_LIST (   V)

Definition at line 457 of file object.h.

◆ SNAPSHOT_SUPPORT

#define SNAPSHOT_SUPPORT (   object)
Value:
friend class object##MessageSerializationCluster; \
friend class object##MessageDeserializationCluster;

Definition at line 238 of file object.h.

◆ STATE_BITS_LIST

#define STATE_BITS_LIST (   V)
Value:
V(WasCompiled) \
V(WasExecutedBit) \
V(ProhibitsInstructionHoisting) \
V(ProhibitsBoundsCheckGeneralization)

Definition at line 4069 of file object.h.

◆ STORE_NON_POINTER_ILLEGAL_TYPE

#define STORE_NON_POINTER_ILLEGAL_TYPE (   type)
Value:
template <typename ValueType> \
void StoreNonPointer(type##Ptr const* addr, ValueType value) const { \
UnimplementedMethod(); \
} \
type##Ptr* UnsafeMutableNonPointer(type##Ptr const* addr) const { \
UnimplementedMethod(); \
return nullptr; \
}

Definition at line 849 of file object.h.

851 { \
852 UnimplementedMethod(); \
853 } \
854 type##Ptr* UnsafeMutableNonPointer(type##Ptr const* addr) const { \
855 UnimplementedMethod(); \
856 return nullptr; \
857 }

◆ TYPED_GETTER_SETTER [1/2]

#define TYPED_GETTER_SETTER (   name,
  type 
)
Value:
type Get##name(intptr_t byte_offset) const { \
ASSERT(static_cast<uintptr_t>(byte_offset) <= \
static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
return LoadUnaligned( \
reinterpret_cast<type*>(untag()->data_ + byte_offset)); \
} \
void Set##name(intptr_t byte_offset, type value) const { \
ASSERT(static_cast<uintptr_t>(byte_offset) <= \
static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
StoreUnaligned(reinterpret_cast<type*>(untag()->data_ + byte_offset), \
value); \
}

Definition at line 11551 of file object.h.

11552 { \
11553 ASSERT(static_cast<uintptr_t>(byte_offset) <= \
11554 static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
11555 return LoadUnaligned( \
11556 reinterpret_cast<type*>(untag()->data_ + byte_offset)); \
11557 } \
11558 void Set##name(intptr_t byte_offset, type value) const { \
11559 ASSERT(static_cast<uintptr_t>(byte_offset) <= \
11560 static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
11561 StoreUnaligned(reinterpret_cast<type*>(untag()->data_ + byte_offset), \
11562 value); \
11563 }

◆ TYPED_GETTER_SETTER [2/2]

#define TYPED_GETTER_SETTER (   name,
  type 
)
Value:
type Get##name(intptr_t byte_offset) const { \
ASSERT(static_cast<uintptr_t>(byte_offset) <= \
static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
return LoadUnaligned( \
reinterpret_cast<const type*>(untag()->data() + byte_offset)); \
} \
void Set##name(intptr_t byte_offset, type value) const { \
ASSERT(static_cast<uintptr_t>(byte_offset) <= \
static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
return StoreUnaligned( \
reinterpret_cast<type*>(untag()->data() + byte_offset), value); \
}

Definition at line 11551 of file object.h.

11552 { \
11553 ASSERT(static_cast<uintptr_t>(byte_offset) <= \
11554 static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
11555 return LoadUnaligned( \
11556 reinterpret_cast<type*>(untag()->data_ + byte_offset)); \
11557 } \
11558 void Set##name(intptr_t byte_offset, type value) const { \
11559 ASSERT(static_cast<uintptr_t>(byte_offset) <= \
11560 static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
11561 StoreUnaligned(reinterpret_cast<type*>(untag()->data_ + byte_offset), \
11562 value); \
11563 }