Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
dart::ObjectCopy< Base > Class Template Reference
Inheritance diagram for dart::ObjectCopy< Base >:
dart::Base

Public Types

using Types = typename Base::Types
 

Public Member Functions

 ObjectCopy (Thread *thread, IdentityMap *map)
 
void CopyPredefinedInstance (typename Types::Object from, typename Types::Object to, intptr_t cid)
 
void CopyUserdefinedInstance (typename Types::Object from, typename Types::Object to, UnboxedFieldBitmap bitmap)
 
void CopyUserdefinedInstanceWithoutUnboxedFields (typename Types::Object from, typename Types::Object to)
 
void CopyClosure (typename Types::Closure from, typename Types::Closure to)
 
void CopyContext (typename Types::Context from, typename Types::Context to)
 
void CopyArray (typename Types::Array from, typename Types::Array to)
 
void CopyGrowableObjectArray (typename Types::GrowableObjectArray from, typename Types::GrowableObjectArray to)
 
void CopyRecord (typename Types::Record from, typename Types::Record to)
 
template<intptr_t one_for_set_two_for_map, typename T >
void CopyLinkedHashBase (T from, T to, UntaggedLinkedHashBase *from_untagged, UntaggedLinkedHashBase *to_untagged)
 
void CopyMap (typename Types::Map from, typename Types::Map to)
 
void CopySet (typename Types::Set from, typename Types::Set to)
 
void CopyDouble (typename Types::Double from, typename Types::Double to)
 
void CopyFloat32x4 (typename Types::Float32x4 from, typename Types::Float32x4 to)
 
void CopyFloat64x2 (typename Types::Float64x2 from, typename Types::Float64x2 to)
 
void CopyTypedData (TypedDataPtr from, TypedDataPtr to)
 
void CopyTypedData (const TypedData &from, const TypedData &to)
 
void CopyTypedDataView (typename Types::TypedDataView from, typename Types::TypedDataView to)
 
void CopyExternalTypedData (typename Types::ExternalTypedData from, typename Types::ExternalTypedData to)
 
void CopyTransferableTypedData (typename Types::TransferableTypedData from, typename Types::TransferableTypedData to)
 
void CopyWeakProperty (typename Types::WeakProperty from, typename Types::WeakProperty to)
 
void CopyWeakReference (typename Types::WeakReference from, typename Types::WeakReference to)
 
UntaggedObjectUntagObject (typename Types::Object obj)
 
- Public Member Functions inherited from dart::Base
 Base (int arg)
 

Additional Inherited Members

- Public Attributes inherited from dart::Base
int base
 

Detailed Description

template<typename Base>
class dart::ObjectCopy< Base >

Definition at line 1693 of file object_graph_copy.cc.

Member Typedef Documentation

◆ Types

template<typename Base >
using dart::ObjectCopy< Base >::Types = typename Base::Types

Definition at line 1695 of file object_graph_copy.cc.

Constructor & Destructor Documentation

◆ ObjectCopy()

template<typename Base >
dart::ObjectCopy< Base >::ObjectCopy ( Thread thread,
IdentityMap map 
)
inline

Definition at line 1697 of file object_graph_copy.cc.

1697: Base(thread, map) {}
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
Definition: SkVx.h:680

Member Function Documentation

◆ CopyArray()

template<typename Base >
void dart::ObjectCopy< Base >::CopyArray ( typename Types::Array  from,
typename Types::Array  to 
)
inline

Definition at line 1810 of file object_graph_copy.cc.

1810 {
1811 const intptr_t length = Smi::Value(UntagArray(from)->length());
1812 Base::StoreCompressedArrayPointers(
1813 length, from, to, OFFSET_OF(UntaggedArray, type_arguments_),
1814 OFFSET_OF(UntaggedArray, type_arguments_));
1815 Base::StoreCompressedPointersNoBarrier(from, to,
1816 OFFSET_OF(UntaggedArray, length_),
1817 OFFSET_OF(UntaggedArray, length_));
1818 Base::ForwardCompressedArrayPointers(
1819 length, from, to, Array::data_offset(),
1821 }
static intptr_t data_offset()
Definition: object.h:10835
intptr_t Value() const
Definition: object.h:9990
size_t length
static constexpr intptr_t kCompressedWordSize
Definition: globals.h:42
#define OFFSET_OF(type, field)
Definition: globals.h:138

◆ CopyClosure()

template<typename Base >
void dart::ObjectCopy< Base >::CopyClosure ( typename Types::Closure  from,
typename Types::Closure  to 
)
inline

Definition at line 1785 of file object_graph_copy.cc.

1785 {
1786 Base::StoreCompressedPointers(
1787 from, to, OFFSET_OF(UntaggedClosure, instantiator_type_arguments_),
1788 OFFSET_OF(UntaggedClosure, function_));
1789 Base::ForwardCompressedPointer(from, to,
1790 OFFSET_OF(UntaggedClosure, context_));
1791 Base::StoreCompressedPointersNoBarrier(from, to,
1792 OFFSET_OF(UntaggedClosure, hash_),
1793 OFFSET_OF(UntaggedClosure, hash_));
1794 ONLY_IN_PRECOMPILED(UntagClosure(to)->entry_point_ =
1795 UntagClosure(from)->entry_point_);
1796 }
#define ONLY_IN_PRECOMPILED(code)
Definition: globals.h:101

◆ CopyContext()

template<typename Base >
void dart::ObjectCopy< Base >::CopyContext ( typename Types::Context  from,
typename Types::Context  to 
)
inline

Definition at line 1798 of file object_graph_copy.cc.

1798 {
1799 const intptr_t length = Context::NumVariables(Types::GetContextPtr(from));
1800
1801 UntagContext(to)->num_variables_ = UntagContext(from)->num_variables_;
1802
1803 Base::ForwardCompressedPointer(from, to,
1804 OFFSET_OF(UntaggedContext, parent_));
1805 Base::ForwardCompressedContextPointers(
1806 length, from, to, Context::variable_offset(0),
1808 }
static intptr_t NumVariables(const ContextPtr context)
Definition: object.h:7418
static intptr_t variable_offset(intptr_t context_index)
Definition: object.h:7439
static constexpr intptr_t kBytesPerElement
Definition: object.h:7431

◆ CopyDouble()

template<typename Base >
void dart::ObjectCopy< Base >::CopyDouble ( typename Types::Double  from,
typename Types::Double  to 
)
inline

Definition at line 1925 of file object_graph_copy.cc.

1925 {
1926#if !defined(DART_PRECOMPILED_RUNTIME)
1927 auto raw_from = UntagDouble(from);
1928 auto raw_to = UntagDouble(to);
1929 raw_to->value_ = raw_from->value_;
1930#else
1931 // Will be shared and not copied.
1932 UNREACHABLE();
1933#endif
1934 }
#define UNREACHABLE()
Definition: assert.h:248

◆ CopyExternalTypedData()

template<typename Base >
void dart::ObjectCopy< Base >::CopyExternalTypedData ( typename Types::ExternalTypedData  from,
typename Types::ExternalTypedData  to 
)
inline

Definition at line 2029 of file object_graph_copy.cc.

2030 {
2031 // The external typed data is initialized on the forwarding pass (where
2032 // normally allocation but not initialization happens), so views on it
2033 // can be initialized immediately.
2034#if defined(DEBUG)
2035 auto raw_from = UntagExternalTypedData(from);
2036 auto raw_to = UntagExternalTypedData(to);
2037 ASSERT(raw_to->data_ != nullptr);
2038 ASSERT(raw_to->length_ == raw_from->length_);
2039#endif
2040 }
#define ASSERT(E)

◆ CopyFloat32x4()

template<typename Base >
void dart::ObjectCopy< Base >::CopyFloat32x4 ( typename Types::Float32x4  from,
typename Types::Float32x4  to 
)
inline

Definition at line 1936 of file object_graph_copy.cc.

1937 {
1938#if !defined(DART_PRECOMPILED_RUNTIME)
1939 auto raw_from = UntagFloat32x4(from);
1940 auto raw_to = UntagFloat32x4(to);
1941 raw_to->value_[0] = raw_from->value_[0];
1942 raw_to->value_[1] = raw_from->value_[1];
1943 raw_to->value_[2] = raw_from->value_[2];
1944 raw_to->value_[3] = raw_from->value_[3];
1945#else
1946 // Will be shared and not copied.
1947 UNREACHABLE();
1948#endif
1949 }

◆ CopyFloat64x2()

template<typename Base >
void dart::ObjectCopy< Base >::CopyFloat64x2 ( typename Types::Float64x2  from,
typename Types::Float64x2  to 
)
inline

Definition at line 1951 of file object_graph_copy.cc.

1952 {
1953#if !defined(DART_PRECOMPILED_RUNTIME)
1954 auto raw_from = UntagFloat64x2(from);
1955 auto raw_to = UntagFloat64x2(to);
1956 raw_to->value_[0] = raw_from->value_[0];
1957 raw_to->value_[1] = raw_from->value_[1];
1958#else
1959 // Will be shared and not copied.
1960 UNREACHABLE();
1961#endif
1962 }

◆ CopyGrowableObjectArray()

template<typename Base >
void dart::ObjectCopy< Base >::CopyGrowableObjectArray ( typename Types::GrowableObjectArray  from,
typename Types::GrowableObjectArray  to 
)
inline

Definition at line 1823 of file object_graph_copy.cc.

1824 {
1825 Base::StoreCompressedPointers(
1826 from, to, OFFSET_OF(UntaggedGrowableObjectArray, type_arguments_),
1827 OFFSET_OF(UntaggedGrowableObjectArray, type_arguments_));
1828 Base::StoreCompressedPointersNoBarrier(
1829 from, to, OFFSET_OF(UntaggedGrowableObjectArray, length_),
1830 OFFSET_OF(UntaggedGrowableObjectArray, length_));
1831 Base::ForwardCompressedPointer(
1832 from, to, OFFSET_OF(UntaggedGrowableObjectArray, data_));
1833 }

◆ CopyLinkedHashBase()

template<typename Base >
template<intptr_t one_for_set_two_for_map, typename T >
void dart::ObjectCopy< Base >::CopyLinkedHashBase ( T  from,
T  to,
UntaggedLinkedHashBase from_untagged,
UntaggedLinkedHashBase to_untagged 
)
inline

Definition at line 1846 of file object_graph_copy.cc.

1849 {
1850 // We have to find out whether the map needs re-hashing on the receiver side
1851 // due to keys being copied and the keys therefore possibly having different
1852 // hash codes (e.g. due to user-defined hashCode implementation or due to
1853 // new identity hash codes of the copied objects).
1854 bool needs_rehashing = false;
1855 ArrayPtr data = from_untagged->data_.Decompress(Base::heap_base_);
1856 if (data != Array::null()) {
1857 UntaggedArray* untagged_data = data.untag();
1858 const intptr_t length = Smi::Value(untagged_data->length_);
1859 auto key_value_pairs = untagged_data->data();
1860 for (intptr_t i = 0; i < length; i += one_for_set_two_for_map) {
1861 ObjectPtr key = key_value_pairs[i].Decompress(Base::heap_base_);
1862 const bool is_deleted_entry = key == data;
1863 if (key->IsHeapObject()) {
1864 if (!is_deleted_entry && MightNeedReHashing(key)) {
1865 needs_rehashing = true;
1866 break;
1867 }
1868 }
1869 }
1870 }
1871
1872 Base::StoreCompressedPointers(
1873 from, to, OFFSET_OF(UntaggedLinkedHashBase, type_arguments_),
1874 OFFSET_OF(UntaggedLinkedHashBase, type_arguments_));
1875
1876 // Compared with the snapshot-based (de)serializer we do preserve the same
1877 // backing store (i.e. used_data/deleted_keys/data) and therefore do not
1878 // magically shrink backing store based on usage.
1879 //
1880 // We do this to avoid making assumptions about the object graph and the
1881 // linked hash map (e.g. assuming there's no other references to the data,
1882 // assuming the linked hashmap is in a consistent state)
1883 if (needs_rehashing) {
1884 to_untagged->hash_mask_ = Smi::New(0);
1885 to_untagged->index_ = TypedData::RawCast(Object::null());
1886 to_untagged->deleted_keys_ = Smi::New(0);
1887 }
1888
1889 // From this point on we shouldn't use the raw pointers, since GC might
1890 // happen when forwarding objects.
1891 from_untagged = nullptr;
1892 to_untagged = nullptr;
1893
1894 if (!needs_rehashing) {
1895 Base::ForwardCompressedPointer(from, to,
1896 OFFSET_OF(UntaggedLinkedHashBase, index_));
1897 Base::StoreCompressedPointersNoBarrier(
1898 from, to, OFFSET_OF(UntaggedLinkedHashBase, hash_mask_),
1899 OFFSET_OF(UntaggedLinkedHashBase, hash_mask_));
1900 Base::StoreCompressedPointersNoBarrier(
1901 from, to, OFFSET_OF(UntaggedMap, deleted_keys_),
1902 OFFSET_OF(UntaggedMap, deleted_keys_));
1903 }
1904 Base::ForwardCompressedPointer(from, to,
1905 OFFSET_OF(UntaggedLinkedHashBase, data_));
1906 Base::StoreCompressedPointersNoBarrier(
1907 from, to, OFFSET_OF(UntaggedLinkedHashBase, used_data_),
1908 OFFSET_OF(UntaggedLinkedHashBase, used_data_));
1909
1910 if (Base::exception_msg_ == nullptr && needs_rehashing) {
1911 Base::EnqueueObjectToRehash(to);
1912 }
1913 }
static ObjectPtr null()
Definition: object.h:433
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325
static SmiPtr New(intptr_t value)
Definition: object.h:10006
static int8_t data[kExtLength]
static DART_FORCE_INLINE bool MightNeedReHashing(ObjectPtr object)

◆ CopyMap()

template<typename Base >
void dart::ObjectCopy< Base >::CopyMap ( typename Types::Map  from,
typename Types::Map  to 
)
inline

Definition at line 1915 of file object_graph_copy.cc.

1915 {
1916 CopyLinkedHashBase<2, typename Types::Map>(from, to, UntagMap(from),
1917 UntagMap(to));
1918 }

◆ CopyPredefinedInstance()

template<typename Base >
void dart::ObjectCopy< Base >::CopyPredefinedInstance ( typename Types::Object  from,
typename Types::Object  to,
intptr_t  cid 
)
inline

Definition at line 1699 of file object_graph_copy.cc.

1701 {
1704 return;
1705 }
1706 switch (cid) {
1707#define COPY_TO(clazz) \
1708 case clazz::kClassId: { \
1709 typename Types::clazz casted_from = Types::Cast##clazz(from); \
1710 typename Types::clazz casted_to = Types::Cast##clazz(to); \
1711 Copy##clazz(casted_from, casted_to); \
1712 return; \
1713 }
1714
1716 COPY_TO(Array)
1717 COPY_TO(GrowableObjectArray)
1718 COPY_TO(Map)
1719 COPY_TO(Set)
1720#undef COPY_TO
1721
1723 typename Types::Array casted_from = Types::CastArray(from);
1724 typename Types::Array casted_to = Types::CastArray(to);
1725 CopyArray(casted_from, casted_to);
1726 return;
1727 }
1728
1729#define COPY_TO(clazz) case kTypedData##clazz##Cid:
1730
1732 typename Types::TypedData casted_from = Types::CastTypedData(from);
1733 typename Types::TypedData casted_to = Types::CastTypedData(to);
1734 CopyTypedData(casted_from, casted_to);
1735 return;
1736 }
1737#undef COPY_TO
1738
1739 case kByteDataViewCid:
1741#define COPY_TO(clazz) \
1742 case kTypedData##clazz##ViewCid: \
1743 case kUnmodifiableTypedData##clazz##ViewCid:
1745 typename Types::TypedDataView casted_from =
1746 Types::CastTypedDataView(from);
1747 typename Types::TypedDataView casted_to =
1748 Types::CastTypedDataView(to);
1749 CopyTypedDataView(casted_from, casted_to);
1750 return;
1751 }
1752#undef COPY_TO
1753
1754#define COPY_TO(clazz) case kExternalTypedData##clazz##Cid:
1755
1757 typename Types::ExternalTypedData casted_from =
1758 Types::CastExternalTypedData(from);
1759 typename Types::ExternalTypedData casted_to =
1760 Types::CastExternalTypedData(to);
1761 CopyExternalTypedData(casted_from, casted_to);
1762 return;
1763 }
1764#undef COPY_TO
1765 default:
1766 break;
1767 }
1768
1769 const Object& obj = Types::HandlifyObject(from);
1770 FATAL("Unexpected object: %s\n", obj.ToCString());
1771 }
#define CLASS_LIST_NO_OBJECT_NOR_STRING_NOR_ARRAY_NOR_MAP(V)
Definition: class_id.h:113
#define CLASS_LIST_TYPED_DATA(V)
Definition: class_id.h:137
static const ClassId kClassId
Definition: object.h:11044
void CopyArray(typename Types::Array from, typename Types::Array to)
void CopyTypedData(TypedDataPtr from, TypedDataPtr to)
void CopyExternalTypedData(typename Types::ExternalTypedData from, typename Types::ExternalTypedData to)
void CopyUserdefinedInstanceWithoutUnboxedFields(typename Types::Object from, typename Types::Object to)
void CopyTypedDataView(typename Types::TypedDataView from, typename Types::TypedDataView to)
#define FATAL(error)
bool IsImplicitFieldClassId(intptr_t index)
Definition: class_id.h:556
@ kByteDataViewCid
Definition: class_id.h:244
@ kUnmodifiableByteDataViewCid
Definition: class_id.h:245
const intptr_t cid
#define COPY_TO(clazz)

◆ CopyRecord()

template<typename Base >
void dart::ObjectCopy< Base >::CopyRecord ( typename Types::Record  from,
typename Types::Record  to 
)
inline

Definition at line 1835 of file object_graph_copy.cc.

1835 {
1836 const intptr_t num_fields = Record::NumFields(Types::GetRecordPtr(from));
1837 Base::StoreCompressedPointersNoBarrier(from, to,
1838 OFFSET_OF(UntaggedRecord, shape_),
1839 OFFSET_OF(UntaggedRecord, shape_));
1840 Base::ForwardCompressedPointers(
1841 from, to, Record::field_offset(0),
1843 }
static constexpr intptr_t kBytesPerElement
Definition: object.h:11440
static intptr_t NumFields(RecordPtr ptr)
Definition: object.h:11426
static intptr_t field_offset(intptr_t index)
Definition: object.h:11448

◆ CopySet()

template<typename Base >
void dart::ObjectCopy< Base >::CopySet ( typename Types::Set  from,
typename Types::Set  to 
)
inline

Definition at line 1920 of file object_graph_copy.cc.

1920 {
1921 CopyLinkedHashBase<1, typename Types::Set>(from, to, UntagSet(from),
1922 UntagSet(to));
1923 }

◆ CopyTransferableTypedData()

template<typename Base >
void dart::ObjectCopy< Base >::CopyTransferableTypedData ( typename Types::TransferableTypedData  from,
typename Types::TransferableTypedData  to 
)
inline

Definition at line 2042 of file object_graph_copy.cc.

2043 {
2044 // The [TransferableTypedData] is an empty object with an associated heap
2045 // peer object.
2046 // -> We'll validate that there's a peer and enqueue the transferable to be
2047 // transferred if the transitive copy is successful.
2048 auto fpeer = static_cast<TransferableTypedDataPeer*>(
2049 Base::heap_->GetPeer(Types::GetTransferableTypedDataPtr(from)));
2050 ASSERT(fpeer != nullptr);
2051 if (fpeer->data() == nullptr) {
2052 Base::exception_msg_ =
2053 "Illegal argument in isolate message"
2054 " : (TransferableTypedData has been transferred already)";
2055 Base::exception_unexpected_object_ =
2056 Types::GetTransferableTypedDataPtr(from);
2057 return;
2058 }
2059 Base::EnqueueTransferable(from, to);
2060 }

◆ CopyTypedData() [1/2]

template<typename Base >
void dart::ObjectCopy< Base >::CopyTypedData ( const TypedData from,
const TypedData to 
)
inline

Definition at line 1975 of file object_graph_copy.cc.

1975 {
1976 auto raw_from = from.ptr().untag();
1977 auto raw_to = to.ptr().untag();
1978 const intptr_t cid = Types::GetTypedDataPtr(from)->GetClassId();
1979 ASSERT(raw_to->length_ == raw_from->length_);
1980 raw_to->RecomputeDataField();
1981 const intptr_t length =
1982 TypedData::ElementSizeInBytes(cid) * Smi::Value(raw_from->length_);
1983 CopyTypedDataBaseWithSafepointChecks(Base::thread_, from, to, length);
1984 }
intptr_t ElementSizeInBytes() const
Definition: object.h:11531
void CopyTypedDataBaseWithSafepointChecks(Thread *thread, const T &from, const T &to, intptr_t length)

◆ CopyTypedData() [2/2]

template<typename Base >
void dart::ObjectCopy< Base >::CopyTypedData ( TypedDataPtr  from,
TypedDataPtr  to 
)
inline

Definition at line 1964 of file object_graph_copy.cc.

1964 {
1965 auto raw_from = from.untag();
1966 auto raw_to = to.untag();
1967 const intptr_t cid = Types::GetTypedDataPtr(from)->GetClassId();
1968 raw_to->length_ = raw_from->length_;
1969 raw_to->RecomputeDataField();
1970 const intptr_t length =
1971 TypedData::ElementSizeInBytes(cid) * Smi::Value(raw_from->length_);
1972 memmove(raw_to->data_, raw_from->data_, length);
1973 }

◆ CopyTypedDataView()

template<typename Base >
void dart::ObjectCopy< Base >::CopyTypedDataView ( typename Types::TypedDataView  from,
typename Types::TypedDataView  to 
)
inline

Definition at line 1986 of file object_graph_copy.cc.

1987 {
1988 // This will forward & initialize the typed data.
1989 Base::ForwardCompressedPointer(
1990 from, to, OFFSET_OF(UntaggedTypedDataView, typed_data_));
1991
1992 auto raw_from = UntagTypedDataView(from);
1993 auto raw_to = UntagTypedDataView(to);
1994 raw_to->length_ = raw_from->length_;
1995 raw_to->offset_in_bytes_ = raw_from->offset_in_bytes_;
1996 raw_to->data_ = nullptr;
1997
1998 auto forwarded_backing_store =
1999 raw_to->typed_data_.Decompress(Base::heap_base_);
2000 if (forwarded_backing_store == Marker() ||
2001 forwarded_backing_store == Object::null()) {
2002 // Ensure the backing store is never "sentinel" - the scavenger doesn't
2003 // like it.
2004 Base::StoreCompressedPointerNoBarrier(
2005 Types::GetTypedDataViewPtr(to),
2006 OFFSET_OF(UntaggedTypedDataView, typed_data_), Object::null());
2007 raw_to->length_ = Smi::New(0);
2008 raw_to->offset_in_bytes_ = Smi::New(0);
2009 ASSERT(Base::exception_msg_ != nullptr);
2010 return;
2011 }
2012
2013 const bool is_external =
2014 raw_from->data_ != raw_from->DataFieldForInternalTypedData();
2015 if (is_external) {
2016 // The raw_to is fully initialized at this point (see handling of external
2017 // typed data in [ForwardCompressedPointer])
2018 raw_to->RecomputeDataField();
2019 } else {
2020 // The raw_to isn't initialized yet, but it's address is valid, so we can
2021 // compute the data field it would use.
2022 raw_to->RecomputeDataFieldForInternalTypedData();
2023 }
2024 const bool is_external2 =
2025 raw_to->data_ != raw_to->DataFieldForInternalTypedData();
2026 ASSERT(is_external == is_external2);
2027 }
static DART_FORCE_INLINE ObjectPtr Marker()

◆ CopyUserdefinedInstance()

template<typename Base >
void dart::ObjectCopy< Base >::CopyUserdefinedInstance ( typename Types::Object  from,
typename Types::Object  to,
UnboxedFieldBitmap  bitmap 
)
inline

Definition at line 1773 of file object_graph_copy.cc.

1775 {
1776 const intptr_t instance_size = UntagObject(from)->HeapSize();
1777 Base::ForwardCompressedPointers(from, to, kWordSize, instance_size, bitmap);
1778 }
UntaggedObject * UntagObject(typename Types::Object obj)
intptr_t HeapSize() const
Definition: raw_object.h:401
Definition: bitmap.py:1
constexpr intptr_t kWordSize
Definition: globals.h:509

◆ CopyUserdefinedInstanceWithoutUnboxedFields()

template<typename Base >
void dart::ObjectCopy< Base >::CopyUserdefinedInstanceWithoutUnboxedFields ( typename Types::Object  from,
typename Types::Object  to 
)
inline

Definition at line 1780 of file object_graph_copy.cc.

1781 {
1782 const intptr_t instance_size = UntagObject(from)->HeapSize();
1783 Base::ForwardCompressedPointers(from, to, kWordSize, instance_size);
1784 }

◆ CopyWeakProperty()

template<typename Base >
void dart::ObjectCopy< Base >::CopyWeakProperty ( typename Types::WeakProperty  from,
typename Types::WeakProperty  to 
)
inline

Definition at line 2062 of file object_graph_copy.cc.

2063 {
2064 // We store `null`s as keys/values and let the main algorithm know that
2065 // we should check reachability of the key again after the fixpoint (if it
2066 // became reachable, forward the key/value).
2067 Base::StoreCompressedPointerNoBarrier(Types::GetWeakPropertyPtr(to),
2068 OFFSET_OF(UntaggedWeakProperty, key_),
2069 Object::null());
2070 Base::StoreCompressedPointerNoBarrier(
2071 Types::GetWeakPropertyPtr(to), OFFSET_OF(UntaggedWeakProperty, value_),
2072 Object::null());
2073 // To satisfy some ASSERT()s in GC we'll use Object:null() explicitly here.
2074 Base::StoreCompressedPointerNoBarrier(
2075 Types::GetWeakPropertyPtr(to),
2076 OFFSET_OF(UntaggedWeakProperty, next_seen_by_gc_), Object::null());
2077 Base::EnqueueWeakProperty(from);
2078 }

◆ CopyWeakReference()

template<typename Base >
void dart::ObjectCopy< Base >::CopyWeakReference ( typename Types::WeakReference  from,
typename Types::WeakReference  to 
)
inline

Definition at line 2080 of file object_graph_copy.cc.

2081 {
2082 // We store `null` as target and let the main algorithm know that
2083 // we should check reachability of the target again after the fixpoint (if
2084 // it became reachable, forward the target).
2085 Base::StoreCompressedPointerNoBarrier(
2086 Types::GetWeakReferencePtr(to),
2087 OFFSET_OF(UntaggedWeakReference, target_), Object::null());
2088 // Type argument should always be copied.
2089 Base::ForwardCompressedPointer(
2090 from, to, OFFSET_OF(UntaggedWeakReference, type_arguments_));
2091 // To satisfy some ASSERT()s in GC we'll use Object:null() explicitly here.
2092 Base::StoreCompressedPointerNoBarrier(
2093 Types::GetWeakReferencePtr(to),
2094 OFFSET_OF(UntaggedWeakReference, next_seen_by_gc_), Object::null());
2095 Base::EnqueueWeakReference(from);
2096 }

◆ UntagObject()

template<typename Base >
UntaggedObject * dart::ObjectCopy< Base >::UntagObject ( typename Types::Object  obj)
inline

Definition at line 2109 of file object_graph_copy.cc.

2109 {
2110 return Types::GetObjectPtr(obj).Decompress(Base::heap_base_).untag();
2111 }

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