Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Enumerations | Functions
raw_object.h File Reference
#include "platform/assert.h"
#include "platform/thread_sanitizer.h"
#include "vm/class_id.h"
#include "vm/compiler/method_recognizer.h"
#include "vm/compiler/runtime_api.h"
#include "vm/exceptions.h"
#include "vm/globals.h"
#include "vm/pointer_tagging.h"
#include "vm/snapshot.h"
#include "vm/tagged_pointer.h"
#include "vm/thread.h"
#include "vm/token.h"
#include "vm/token_position.h"
#include "vm/visitor.h"

Go to the source code of this file.

Classes

class  dart::UntaggedObject
 
class  dart::UntaggedObject::SizeTag
 
class  dart::UntaggedObject::ClassIdTag
 
class  dart::UntaggedObject::CardRememberedBit
 
class  dart::UntaggedObject::NotMarkedBit
 
class  dart::UntaggedObject::NewOrEvacuationCandidateBit
 
class  dart::UntaggedObject::CanonicalBit
 
class  dart::UntaggedObject::AlwaysSetBit
 
class  dart::UntaggedObject::OldAndNotRememberedBit
 
class  dart::UntaggedObject::ImmutableBit
 
class  dart::UntaggedObject::ReservedBit
 
class  dart::UntaggedClass
 
class  dart::UntaggedPatchClass
 
class  dart::UntaggedFunction
 
class  dart::UntaggedFunction::UnboxedParameterBitmap
 
class  dart::UntaggedClosureData
 
class  dart::UntaggedFfiTrampolineData
 
class  dart::UntaggedField
 
class  dart::UntaggedScript
 
class  dart::UntaggedLibrary
 
class  dart::UntaggedNamespace
 
class  dart::UntaggedKernelProgramInfo
 
class  dart::UntaggedWeakSerializationReference
 
class  dart::UntaggedWeakArray
 
class  dart::UntaggedCode
 
class  dart::UntaggedObjectPool
 
class  dart::UntaggedInstructions
 
class  dart::UntaggedInstructionsSection
 
class  dart::UntaggedPcDescriptors
 
class  dart::UntaggedPcDescriptors::KindAndMetadata
 
class  dart::UntaggedCodeSourceMap
 
class  dart::UntaggedCompressedStackMaps
 
struct  dart::UntaggedCompressedStackMaps::Payload
 
class  dart::UntaggedInstructionsTable
 
class  dart::UntaggedLocalVarDescriptors
 
class  dart::UntaggedLocalVarDescriptors::IndexBits
 
class  dart::UntaggedLocalVarDescriptors::KindBits
 
struct  dart::UntaggedLocalVarDescriptors::VarInfo
 
class  dart::UntaggedExceptionHandlers
 
class  dart::UntaggedContext
 
class  dart::UntaggedContextScope
 
class  dart::UntaggedSentinel
 
class  dart::UntaggedSingleTargetCache
 
class  dart::UntaggedMonomorphicSmiableCall
 
class  dart::UntaggedCallSiteData
 
class  dart::UntaggedUnlinkedCall
 
class  dart::UntaggedICData
 
class  dart::UntaggedMegamorphicCache
 
class  dart::UntaggedSubtypeTestCache
 
class  dart::UntaggedLoadingUnit
 
class  dart::UntaggedError
 
class  dart::UntaggedApiError
 
class  dart::UntaggedLanguageError
 
class  dart::UntaggedUnhandledException
 
class  dart::UntaggedUnwindError
 
class  dart::UntaggedInstance
 
class  dart::UntaggedLibraryPrefix
 
class  dart::UntaggedTypeArguments
 
class  dart::UntaggedTypeParameters
 
class  dart::UntaggedAbstractType
 
class  dart::UntaggedType
 
class  dart::UntaggedFunctionType
 
class  dart::UntaggedRecordType
 
class  dart::UntaggedTypeParameter
 
class  dart::UntaggedClosure
 
class  dart::UntaggedNumber
 
class  dart::UntaggedInteger
 
class  dart::UntaggedSmi
 
class  dart::UntaggedMint
 
class  dart::UntaggedDouble
 
class  dart::UntaggedString
 
class  dart::UntaggedOneByteString
 
class  dart::UntaggedTwoByteString
 
class  dart::UntaggedPointerBase
 
class  dart::UntaggedTypedDataBase
 
class  dart::UntaggedTypedData
 
class  dart::UntaggedTypedDataView
 
class  dart::UntaggedBool
 
class  dart::UntaggedArray
 
class  dart::UntaggedImmutableArray
 
class  dart::UntaggedGrowableObjectArray
 
class  dart::UntaggedLinkedHashBase
 
class  dart::UntaggedMap
 
class  dart::UntaggedConstMap
 
class  dart::UntaggedSet
 
class  dart::UntaggedConstSet
 
class  dart::UntaggedFloat32x4
 
class  dart::UntaggedInt32x4
 
class  dart::UntaggedFloat64x2
 
class  dart::UntaggedRecord
 
class  dart::UntaggedExternalTypedData
 
class  dart::UntaggedPointer
 
class  dart::UntaggedDynamicLibrary
 
class  dart::UntaggedCapability
 
class  dart::UntaggedSendPort
 
class  dart::UntaggedReceivePort
 
class  dart::UntaggedTransferableTypedData
 
class  dart::UntaggedStackTrace
 
class  dart::UntaggedSuspendState
 
class  dart::UntaggedRegExp
 
class  dart::UntaggedWeakProperty
 
class  dart::UntaggedWeakReference
 
class  dart::UntaggedFinalizerBase
 
class  dart::UntaggedFinalizer
 
class  dart::UntaggedNativeFinalizer
 
class  dart::UntaggedFinalizerEntry
 
class  dart::UntaggedMirrorReference
 
class  dart::UntaggedUserTag
 
class  dart::UntaggedFutureOr
 

Namespaces

namespace  dart
 

Macros

#define DEFINE_FORWARD_DECLARATION(clazz)   class Untagged##clazz;
 
#define DEFINE_CONTAINS_COMPRESSED(type)
 
#define CHECK_CONTAIN_COMPRESSED(type)
 
#define VISIT_FROM(first)
 
#define VISIT_FROM_PAYLOAD_START(elem_type)
 
#define VISIT_TO(last)
 
#define VISIT_TO_PAYLOAD_END(elem_type)
 
#define VISIT_NOTHING()   int NothingToVisit();
 
#define ASSERT_UNCOMPRESSED(Type)
 
#define ASSERT_COMPRESSED(Type)
 
#define ASSERT_NOTHING_TO_VISIT(Type)    ASSERT(SIZE_OF_RETURNED_VALUE(Untagged##Type, NothingToVisit) == sizeof(int))
 
#define V(name)   k##name##Element,
 
#define VISITOR_SUPPORT(object)
 
#define RAW_OBJECT_IMPLEMENTATION(object)
 
#define RAW_HEAP_OBJECT_IMPLEMENTATION(object)
 
#define POINTER_FIELD(type, name)
 
#define COMPRESSED_POINTER_FIELD(type, name)
 
#define ARRAY_POINTER_FIELD(type, name)
 
#define COMPRESSED_ARRAY_POINTER_FIELD(type, name)
 
#define VARIABLE_POINTER_FIELDS(type, accessor_name, array_name)
 
#define COMPRESSED_VARIABLE_POINTER_FIELDS(type, accessor_name, array_name)
 
#define SMI_FIELD(type, name)
 
#define COMPRESSED_SMI_FIELD(type, name)
 
#define WSR_COMPRESSED_POINTER_FIELD(Type, Name)    COMPRESSED_POINTER_FIELD(Type, Name)
 
#define FOR_EACH_RAW_FUNCTION_KIND(V)
 
#define KIND_DEFN(Name)   k##Name,
 
#define KIND_CASE(Name)
 
#define KIND_CASE(Name)
 
#define JIT_FUNCTION_COUNTERS(F)
 
#define DECLARE(return_type, type, name)   type name##_;
 
#define FOR_EACH_RAW_PC_DESCRIPTOR(V)
 
#define ENUM_DEF(name, init)   k##name = init,
 
#define CONTEXT_SCOPE_VARIABLE_DESC_FLAG_LIST(V)
 
#define DECLARE_BIT(Name)   kIs##Name,
 
#define DEFINE_ACCESSOR(type, name)
 

Enumerations

enum  dart::TypedDataElementType
 
enum class  dart::InstantiationMode : uint8_t { dart::kNeedsInstantiation , dart::kIsInstantiated , dart::kSharesInstantiatorTypeArguments , dart::kSharesFunctionTypeArguments }
 

Functions

 dart::COMPILE_ASSERT (sizeof(UntaggedMint)==16)
 
 dart::COMPILE_ASSERT (sizeof(UntaggedDouble)==16)
 
 dart::COMPILE_ASSERT (sizeof(UntaggedFloat32x4)==24)
 
 dart::COMPILE_ASSERT (sizeof(UntaggedInt32x4)==24)
 
 dart::COMPILE_ASSERT (sizeof(UntaggedFloat64x2)==24)
 

Macro Definition Documentation

◆ ARRAY_POINTER_FIELD

#define ARRAY_POINTER_FIELD (   type,
  name 
)
Value:
public: \
template <std::memory_order order = std::memory_order_relaxed> \
type name() const { \
return LoadPointer<type, order>(&name##_); \
} \
template <std::memory_order order = std::memory_order_relaxed> \
void set_##name(type value) { \
StoreArrayPointer<type, order>(&name##_, value); \
} \
\
protected: \
type name##_;
GLenum type
uint8_t value
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

Definition at line 917 of file raw_object.h.

◆ ASSERT_COMPRESSED

#define ASSERT_COMPRESSED (   Type)

Definition at line 118 of file raw_object.h.

◆ ASSERT_NOTHING_TO_VISIT

#define ASSERT_NOTHING_TO_VISIT (   Type)     ASSERT(SIZE_OF_RETURNED_VALUE(Untagged##Type, NothingToVisit) == sizeof(int))

Definition at line 121 of file raw_object.h.

◆ ASSERT_UNCOMPRESSED

#define ASSERT_UNCOMPRESSED (   Type)

Definition at line 117 of file raw_object.h.

◆ CHECK_CONTAIN_COMPRESSED

#define CHECK_CONTAIN_COMPRESSED (   type)
Value:
static_assert( \
kContainsCompressedPointers || is_uncompressed_ptr<type>::value, \
"From declaration uses ObjectPtr"); \
static_assert( \
!kContainsCompressedPointers || is_compressed_ptr<type>::value, \
"From declaration uses CompressedObjectPtr");

Definition at line 53 of file raw_object.h.

◆ COMPRESSED_ARRAY_POINTER_FIELD

#define COMPRESSED_ARRAY_POINTER_FIELD (   type,
  name 
)
Value:
public: \
template <std::memory_order order = std::memory_order_relaxed> \
type name() const { \
return LoadPointer<Compressed##type, order>(&name##_).Decompress( \
heap_base()); \
} \
template <std::memory_order order = std::memory_order_relaxed> \
void set_##name(type value) { \
StoreCompressedArrayPointer<type, Compressed##type, order>(&name##_, \
value); \
} \
\
protected: \
Compressed##type name##_;

Definition at line 931 of file raw_object.h.

◆ COMPRESSED_POINTER_FIELD

#define COMPRESSED_POINTER_FIELD (   type,
  name 
)
Value:
public: \
template <std::memory_order order = std::memory_order_relaxed> \
type name() const { \
return LoadCompressedPointer<type, Compressed##type, order>(&name##_); \
} \
template <std::memory_order order = std::memory_order_relaxed> \
void set_##name(type value) { \
StoreCompressedPointer<type, Compressed##type, order>(&name##_, value); \
} \
\
protected: \
Compressed##type name##_;

Definition at line 903 of file raw_object.h.

◆ COMPRESSED_SMI_FIELD

#define COMPRESSED_SMI_FIELD (   type,
  name 
)
Value:
public: \
template <std::memory_order order = std::memory_order_relaxed> \
type name() const { \
type result = LoadCompressedSmi<order>(&name##_); \
ASSERT(!result.IsHeapObject()); \
return result; \
} \
template <std::memory_order order = std::memory_order_relaxed> \
void set_##name(type value) { \
ASSERT(!value.IsHeapObject()); \
StoreCompressedSmi(&name##_, value); \
} \
\
protected: \
Compressed##type name##_;
GAsyncResult * result

Definition at line 1015 of file raw_object.h.

◆ COMPRESSED_VARIABLE_POINTER_FIELDS

#define COMPRESSED_VARIABLE_POINTER_FIELDS (   type,
  accessor_name,
  array_name 
)
Value:
public: \
template <std::memory_order order = std::memory_order_relaxed> \
type accessor_name(intptr_t index) const { \
return LoadCompressedPointer<type, Compressed##type, order>( \
&array_name()[index]); \
} \
template <std::memory_order order = std::memory_order_relaxed> \
void set_##accessor_name(intptr_t index, type value) { \
StoreCompressedArrayPointer<type, Compressed##type, order>( \
&array_name()[index], value); \
} \
template <std::memory_order order = std::memory_order_relaxed> \
void set_##accessor_name(intptr_t index, type value, Thread* thread) { \
StoreCompressedArrayPointer<type, Compressed##type, order>( \
&array_name()[index], value, thread); \
} \
\
protected: \
Compressed##type* array_name() { \
OPEN_ARRAY_START(Compressed##type, Compressed##type); \
} \
Compressed##type const* array_name() const { \
OPEN_ARRAY_START(Compressed##type, Compressed##type); \
} \
VISIT_TO_PAYLOAD_END(Compressed##type)

Definition at line 971 of file raw_object.h.

◆ CONTEXT_SCOPE_VARIABLE_DESC_FLAG_LIST

#define CONTEXT_SCOPE_VARIABLE_DESC_FLAG_LIST (   V)
Value:
V(Final) \
V(Late) \
V(Nullable) \
V(Invisible) \
V(AwaiterLink)
#define V(name)
Definition: raw_object.h:125

Definition at line 2439 of file raw_object.h.

◆ DECLARE

#define DECLARE (   return_type,
  type,
  name 
)    type name##_;

Definition at line 1454 of file raw_object.h.

◆ DECLARE_BIT

#define DECLARE_BIT (   Name)    kIs##Name,

Definition at line 2457 of file raw_object.h.

◆ DEFINE_ACCESSOR

#define DEFINE_ACCESSOR (   type,
  name 
)
Value:
type name##_at(intptr_t index) { \
return LoadCompressedPointer<type>(&VariableDescAddr(index)->name); \
} \
void set_##name##_at(intptr_t index, type value) { \
StoreCompressedPointer(&VariableDescAddr(index)->name, value); \
}

Definition at line 2489 of file raw_object.h.

◆ DEFINE_CONTAINS_COMPRESSED

#define DEFINE_CONTAINS_COMPRESSED (   type)
Value:
static constexpr bool kContainsCompressedPointers = \

Definition at line 49 of file raw_object.h.

◆ DEFINE_FORWARD_DECLARATION

#define DEFINE_FORWARD_DECLARATION (   clazz)    class Untagged##clazz;

Definition at line 43 of file raw_object.h.

◆ ENUM_DEF

#define ENUM_DEF (   name,
  init 
)    k##name = init,

Definition at line 2071 of file raw_object.h.

◆ FOR_EACH_RAW_FUNCTION_KIND

#define FOR_EACH_RAW_FUNCTION_KIND (   V)

Definition at line 1240 of file raw_object.h.

◆ FOR_EACH_RAW_PC_DESCRIPTOR

#define FOR_EACH_RAW_PC_DESCRIPTOR (   V)
Value:
/* Deoptimization continuation point. */ \
V(Deopt, 1) \
/* IC call. */ \
V(IcCall, kDeopt << 1) \
/* Call to a known target via stub. */ \
V(UnoptStaticCall, kIcCall << 1) \
/* Runtime call. */ \
V(RuntimeCall, kUnoptStaticCall << 1) \
/* OSR entry point in unopt. code. */ \
V(OsrEntry, kRuntimeCall << 1) \
/* Call rewind target address. */ \
V(Rewind, kOsrEntry << 1) \
/* Target-word-size relocation. */ \
V(BSSRelocation, kRewind << 1) \
V(Other, kBSSRelocation << 1) \
V(AnyKind, -1)

Definition at line 2052 of file raw_object.h.

◆ JIT_FUNCTION_COUNTERS

#define JIT_FUNCTION_COUNTERS (   F)
Value:
F(intptr_t, int32_t, usage_counter) \
F(intptr_t, uint16_t, optimized_instruction_count) \
F(intptr_t, uint16_t, optimized_call_site_count) \
F(int8_t, int8_t, deoptimization_counter) \
F(intptr_t, int8_t, state_bits) \
F(int, int8_t, inlining_depth)
#define F(x)

Definition at line 1443 of file raw_object.h.

◆ KIND_CASE [1/2]

#define KIND_CASE (   Name)
Value:
case Kind::k##Name: \
return #Name;
ImplicitString Name
Definition: DMSrcSink.h:38

◆ KIND_CASE [2/2]

#define KIND_CASE (   Name)
Value:
if (strcmp(str, #Name) == 0) { \
*out = Kind::k##Name; \
return true; \
}

◆ KIND_DEFN

#define KIND_DEFN (   Name)    k##Name,

Definition at line 1278 of file raw_object.h.

◆ POINTER_FIELD

#define POINTER_FIELD (   type,
  name 
)
Value:
public: \
template <std::memory_order order = std::memory_order_relaxed> \
type name() const { \
return LoadPointer<type, order>(&name##_); \
} \
template <std::memory_order order = std::memory_order_relaxed> \
void set_##name(type value) { \
StorePointer<type, order>(&name##_, value); \
} \
\
protected: \
type name##_;

Definition at line 889 of file raw_object.h.

◆ RAW_HEAP_OBJECT_IMPLEMENTATION

#define RAW_HEAP_OBJECT_IMPLEMENTATION (   object)
Value:
private: \
RAW_OBJECT_IMPLEMENTATION(object); \
friend class object##SerializationCluster; \
friend class object##DeserializationCluster; \
friend class object##MessageSerializationCluster; \
friend class object##MessageDeserializationCluster; \
friend class Serializer; \
friend class Deserializer; \
template <typename Base> \
friend class ObjectCopy; \
friend class Pass2Visitor;

Definition at line 143 of file raw_object.h.

◆ RAW_OBJECT_IMPLEMENTATION

#define RAW_OBJECT_IMPLEMENTATION (   object)
Value:
private: /* NOLINT */ \
VISITOR_SUPPORT(object) \
friend class object; \
friend class UntaggedObject; \
friend class OffsetsTable; \
DISALLOW_ALLOCATION(); \
DISALLOW_IMPLICIT_CONSTRUCTORS(Untagged##object)

Definition at line 134 of file raw_object.h.

◆ SMI_FIELD

#define SMI_FIELD (   type,
  name 
)
Value:
public: \
template <std::memory_order order = std::memory_order_relaxed> \
type name() const { \
type result = LoadSmi<order>(&name##_); \
ASSERT(!result.IsHeapObject()); \
return result; \
} \
template <std::memory_order order = std::memory_order_relaxed> \
void set_##name(type value) { \
ASSERT(!value.IsHeapObject()); \
StoreSmi<type, order>(&name##_, value); \
} \
\
protected: \
type name##_;

Definition at line 998 of file raw_object.h.

◆ V

#define V (   name)    k##name##Element,

Definition at line 125 of file raw_object.h.

◆ VARIABLE_POINTER_FIELDS

#define VARIABLE_POINTER_FIELDS (   type,
  accessor_name,
  array_name 
)
Value:
public: \
template <std::memory_order order = std::memory_order_relaxed> \
type accessor_name(intptr_t index) const { \
return LoadPointer<type, order>(&array_name()[index]); \
} \
template <std::memory_order order = std::memory_order_relaxed> \
void set_##accessor_name(intptr_t index, type value) { \
StoreArrayPointer<type, order>(&array_name()[index], value); \
} \
template <std::memory_order order = std::memory_order_relaxed> \
void set_##accessor_name(intptr_t index, type value, Thread* thread) { \
StoreArrayPointer<type, order>(&array_name()[index], value, thread); \
} \
\
protected: \
type* array_name() { \
OPEN_ARRAY_START(type, type); \
} \
type const* array_name() const { \
OPEN_ARRAY_START(type, type); \
} \
VISIT_TO_PAYLOAD_END(type)

Definition at line 947 of file raw_object.h.

◆ VISIT_FROM

#define VISIT_FROM (   first)
Value:
DEFINE_CONTAINS_COMPRESSED(decltype(first##_)) \
static constexpr bool kContainsPointerFields = true; \
base_ptr_type<decltype(first##_)>::type* from() { \
return reinterpret_cast<base_ptr_type<decltype(first##_)>::type*>( \
&first##_); \
}
#define DEFINE_CONTAINS_COMPRESSED(type)
Definition: raw_object.h:49

Definition at line 61 of file raw_object.h.

◆ VISIT_FROM_PAYLOAD_START

#define VISIT_FROM_PAYLOAD_START (   elem_type)
Value:
"Payload elements must be object pointers"); \
DEFINE_CONTAINS_COMPRESSED(elem_type) \
static constexpr bool kContainsPointerFields = true; \
const uword payload_start = reinterpret_cast<uword>(this) + sizeof(*this); \
ASSERT(Utils::IsAligned(payload_start, sizeof(elem_type))); \
return reinterpret_cast<base_ptr_type<elem_type>::type*>(payload_start); \
}
uintptr_t uword
Definition: globals.h:501

Definition at line 69 of file raw_object.h.

◆ VISIT_NOTHING

#define VISIT_NOTHING ( )    int NothingToVisit();

Definition at line 105 of file raw_object.h.

◆ VISIT_TO

#define VISIT_TO (   last)
Value:
CHECK_CONTAIN_COMPRESSED(decltype(last##_)); \
static_assert(kContainsPointerFields, \
"Must have a corresponding VISIT_FROM"); \
base_ptr_type<decltype(last##_)>::type* to(intptr_t length = 0) { \
return reinterpret_cast<base_ptr_type<decltype(last##_)>::type*>( \
&last##_); \
}
size_t length
#define CHECK_CONTAIN_COMPRESSED(type)
Definition: raw_object.h:53

Definition at line 81 of file raw_object.h.

◆ VISIT_TO_PAYLOAD_END

#define VISIT_TO_PAYLOAD_END (   elem_type)
Value:
"Payload elements must be object pointers"); \
static_assert(kContainsPointerFields, \
"Must have a corresponding VISIT_FROM"); \
CHECK_CONTAIN_COMPRESSED(elem_type); \
const uword payload_start = reinterpret_cast<uword>(this) + sizeof(*this); \
ASSERT(Utils::IsAligned(payload_start, sizeof(elem_type))); \
const uword payload_last = \
payload_start + sizeof(elem_type) * (length - 1); \
return reinterpret_cast<base_ptr_type<elem_type>::type*>(payload_last); \
}

Definition at line 90 of file raw_object.h.

◆ VISITOR_SUPPORT

#define VISITOR_SUPPORT (   object)
Value:
static intptr_t Visit##object##Pointers(object##Ptr raw_obj, \
ObjectPointerVisitor* visitor);
static ObjectPtr Ptr(ObjectPtr obj)

Definition at line 130 of file raw_object.h.

◆ WSR_COMPRESSED_POINTER_FIELD

#define WSR_COMPRESSED_POINTER_FIELD (   Type,
  Name 
)     COMPRESSED_POINTER_FIELD(Type, Name)

Definition at line 1045 of file raw_object.h.