Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
dart::ObjectCopyBase Class Reference
Inheritance diagram for dart::ObjectCopyBase:
dart::FastObjectCopyBase dart::SlowObjectCopyBase dart::ObjectCopy< FastObjectCopyBase > dart::ObjectCopy< SlowObjectCopyBase > dart::FastObjectCopy dart::SlowObjectCopy

Public Member Functions

 ObjectCopyBase (Thread *thread)
 
 ~ObjectCopyBase ()
 

Protected Member Functions

void StoreCompressedLargeArrayPointerBarrier (ObjectPtr obj, intptr_t offset, ObjectPtr value)
 
DART_FORCE_INLINE bool CanCopyObject (uword tags, ObjectPtr object)
 

Static Protected Member Functions

static ObjectPtr LoadPointer (ObjectPtr src, intptr_t offset)
 
static CompressedObjectPtr LoadCompressedPointer (ObjectPtr src, intptr_t offset)
 
static compressed_uword LoadCompressedNonPointerWord (ObjectPtr src, intptr_t offset)
 
static void StorePointerBarrier (ObjectPtr obj, intptr_t offset, ObjectPtr value)
 
static void StoreCompressedPointerBarrier (ObjectPtr obj, intptr_t offset, ObjectPtr value)
 
static void StorePointerNoBarrier (ObjectPtr obj, intptr_t offset, ObjectPtr value)
 
template<typename T = ObjectPtr>
static void StoreCompressedPointerNoBarrier (ObjectPtr obj, intptr_t offset, T value)
 
static void StoreCompressedNonPointerWord (ObjectPtr obj, intptr_t offset, compressed_uword value)
 

Protected Attributes

Threadthread_
 
uword heap_base_
 
Zonezone_
 
Heapheap_
 
ClassTableclass_table_
 
Scavengernew_space_
 
Objecttmp_
 
Objectto_
 
intptr_t expando_cid_
 
const char * exception_msg_ = nullptr
 
Objectexception_unexpected_object_
 

Detailed Description

Definition at line 766 of file object_graph_copy.cc.

Constructor & Destructor Documentation

◆ ObjectCopyBase()

dart::ObjectCopyBase::ObjectCopyBase ( Thread thread)
inlineexplicit

Definition at line 768 of file object_graph_copy.cc.

769 : thread_(thread),
770 heap_base_(thread->heap_base()),
771 zone_(thread->zone()),
772 heap_(thread->isolate_group()->heap()),
773 class_table_(thread->isolate_group()->class_table()),
775 tmp_(Object::Handle(thread->zone())),
776 to_(Object::Handle(thread->zone())),
778 thread->isolate_group()->object_store()->expando_class())),
Scavenger * new_space()
Definition: heap.h:62
intptr_t GetClassId() const
Definition: object.h:341
static Object & Handle()
Definition: object.h:407

◆ ~ObjectCopyBase()

dart::ObjectCopyBase::~ObjectCopyBase ( )
inline

Definition at line 780 of file object_graph_copy.cc.

780{}

Member Function Documentation

◆ CanCopyObject()

DART_FORCE_INLINE bool dart::ObjectCopyBase::CanCopyObject ( uword  tags,
ObjectPtr  object 
)
inlineprotected

Definition at line 842 of file object_graph_copy.cc.

842 {
843 const auto cid = UntaggedObject::ClassIdTag::decode(tags);
846 zone_,
847 "Illegal argument in isolate message: object is unsendable - %s ("
848 "see restrictions listed at `SendPort.send()` documentation "
849 "for more information)",
852 return false;
853 }
854 if (cid > kNumPredefinedCids) {
855 return true;
856 }
857#define HANDLE_ILLEGAL_CASE(Type) \
858 case k##Type##Cid: { \
859 exception_msg_ = \
860 "Illegal argument in isolate message: " \
861 "(object is a " #Type ")"; \
862 exception_unexpected_object_ = object; \
863 return false; \
864 }
865
866 switch (cid) {
867 // From "dart:ffi" we handle only Pointer/DynamicLibrary specially, since
868 // those are the only non-abstract classes (so we avoid checking more cids
869 // here that cannot happen in reality)
870 HANDLE_ILLEGAL_CASE(DynamicLibrary)
872 HANDLE_ILLEGAL_CASE(NativeFinalizer)
873 HANDLE_ILLEGAL_CASE(MirrorReference)
874 HANDLE_ILLEGAL_CASE(Pointer)
875 HANDLE_ILLEGAL_CASE(ReceivePort)
876 HANDLE_ILLEGAL_CASE(SuspendState)
877 HANDLE_ILLEGAL_CASE(UserTag)
878 default:
879 return true;
880 }
881 }
static constexpr ClassIdTagType decode(uword value)
Definition: bitfield.h:171
ClassPtr At(intptr_t cid) const
Definition: class_table.h:362
static bool IsIsolateUnsendable(ClassPtr clazz)
Definition: object.h:1795
static char * SCreate(Zone *zone, const char *format,...) PRINTF_ATTRIBUTE(2
virtual const char * ToCString() const
Definition: object.h:366
@ kNumPredefinedCids
Definition: class_id.h:257
static void Finalizer(void *isolate_callback_data, void *buffer)
Definition: json_stream.cc:192
const intptr_t cid
#define HANDLE_ILLEGAL_CASE(Type)

◆ LoadCompressedNonPointerWord()

static compressed_uword dart::ObjectCopyBase::LoadCompressedNonPointerWord ( ObjectPtr  src,
intptr_t  offset 
)
inlinestaticprotected

Definition at line 792 of file object_graph_copy.cc.

793 {
794 return *reinterpret_cast<compressed_uword*>(
795 reinterpret_cast<uint8_t*>(src.untag()) + offset);
796 }
uintptr_t compressed_uword
Definition: globals.h:44
SeparatedVector2 offset

◆ LoadCompressedPointer()

static CompressedObjectPtr dart::ObjectCopyBase::LoadCompressedPointer ( ObjectPtr  src,
intptr_t  offset 
)
inlinestaticprotected

Definition at line 787 of file object_graph_copy.cc.

788 {
789 return src.untag()->LoadPointer(reinterpret_cast<CompressedObjectPtr*>(
790 reinterpret_cast<uint8_t*>(src.untag()) + offset));
791 }
ObjectPtr CompressedObjectPtr

◆ LoadPointer()

static ObjectPtr dart::ObjectCopyBase::LoadPointer ( ObjectPtr  src,
intptr_t  offset 
)
inlinestaticprotected

Definition at line 783 of file object_graph_copy.cc.

783 {
784 return src.untag()->LoadPointer(reinterpret_cast<ObjectPtr*>(
785 reinterpret_cast<uint8_t*>(src.untag()) + offset));
786 }

◆ StoreCompressedLargeArrayPointerBarrier()

void dart::ObjectCopyBase::StoreCompressedLargeArrayPointerBarrier ( ObjectPtr  obj,
intptr_t  offset,
ObjectPtr  value 
)
inlineprotected

Definition at line 813 of file object_graph_copy.cc.

815 {
816 obj.untag()->StoreCompressedArrayPointer(
817 reinterpret_cast<CompressedObjectPtr*>(
818 reinterpret_cast<uint8_t*>(obj.untag()) + offset),
819 value, thread_);
820 }
uint8_t value

◆ StoreCompressedNonPointerWord()

static void dart::ObjectCopyBase::StoreCompressedNonPointerWord ( ObjectPtr  obj,
intptr_t  offset,
compressed_uword  value 
)
inlinestaticprotected

Definition at line 834 of file object_graph_copy.cc.

836 {
837 *reinterpret_cast<compressed_uword*>(
838 reinterpret_cast<uint8_t*>(obj.untag()) + offset) = value;
839 }

◆ StoreCompressedPointerBarrier()

static void dart::ObjectCopyBase::StoreCompressedPointerBarrier ( ObjectPtr  obj,
intptr_t  offset,
ObjectPtr  value 
)
inlinestaticprotected

Definition at line 805 of file object_graph_copy.cc.

807 {
808 obj.untag()->StoreCompressedPointer(
809 reinterpret_cast<CompressedObjectPtr*>(
810 reinterpret_cast<uint8_t*>(obj.untag()) + offset),
811 value);
812 }

◆ StoreCompressedPointerNoBarrier()

template<typename T = ObjectPtr>
static void dart::ObjectCopyBase::StoreCompressedPointerNoBarrier ( ObjectPtr  obj,
intptr_t  offset,
T  value 
)
inlinestaticprotected

Definition at line 828 of file object_graph_copy.cc.

830 {
831 *reinterpret_cast<CompressedObjectPtr*>(
832 reinterpret_cast<uint8_t*>(obj.untag()) + offset) = value;
833 }

◆ StorePointerBarrier()

static void dart::ObjectCopyBase::StorePointerBarrier ( ObjectPtr  obj,
intptr_t  offset,
ObjectPtr  value 
)
inlinestaticprotected

Definition at line 797 of file object_graph_copy.cc.

799 {
800 obj.untag()->StorePointer(
801 reinterpret_cast<ObjectPtr*>(reinterpret_cast<uint8_t*>(obj.untag()) +
802 offset),
803 value);
804 }

◆ StorePointerNoBarrier()

static void dart::ObjectCopyBase::StorePointerNoBarrier ( ObjectPtr  obj,
intptr_t  offset,
ObjectPtr  value 
)
inlinestaticprotected

Definition at line 821 of file object_graph_copy.cc.

823 {
824 *reinterpret_cast<ObjectPtr*>(reinterpret_cast<uint8_t*>(obj.untag()) +
825 offset) = value;
826 }

Member Data Documentation

◆ class_table_

ClassTable* dart::ObjectCopyBase::class_table_
protected

Definition at line 887 of file object_graph_copy.cc.

◆ exception_msg_

const char* dart::ObjectCopyBase::exception_msg_ = nullptr
protected

Definition at line 893 of file object_graph_copy.cc.

◆ exception_unexpected_object_

Object& dart::ObjectCopyBase::exception_unexpected_object_
protected

Definition at line 894 of file object_graph_copy.cc.

◆ expando_cid_

intptr_t dart::ObjectCopyBase::expando_cid_
protected

Definition at line 891 of file object_graph_copy.cc.

◆ heap_

Heap* dart::ObjectCopyBase::heap_
protected

Definition at line 886 of file object_graph_copy.cc.

◆ heap_base_

uword dart::ObjectCopyBase::heap_base_
protected

Definition at line 884 of file object_graph_copy.cc.

◆ new_space_

Scavenger* dart::ObjectCopyBase::new_space_
protected

Definition at line 888 of file object_graph_copy.cc.

◆ thread_

Thread* dart::ObjectCopyBase::thread_
protected

Definition at line 883 of file object_graph_copy.cc.

◆ tmp_

Object& dart::ObjectCopyBase::tmp_
protected

Definition at line 889 of file object_graph_copy.cc.

◆ to_

Object& dart::ObjectCopyBase::to_
protected

Definition at line 890 of file object_graph_copy.cc.

◆ zone_

Zone* dart::ObjectCopyBase::zone_
protected

Definition at line 885 of file object_graph_copy.cc.


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