Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
dart::SlowObjectCopy Class Reference
Inheritance diagram for dart::SlowObjectCopy:
dart::ObjectCopy< SlowObjectCopyBase > dart::SlowObjectCopyBase dart::ObjectCopyBase

Public Member Functions

 SlowObjectCopy (Thread *thread, IdentityMap *map)
 
 ~SlowObjectCopy ()
 
ObjectPtr ContinueCopyGraphSlow (const Object &root, const Object &fast_root_copy)
 
ArrayPtr BuildArrayOfObjectsToRehash (const GrowableArray< const Object * > &objects_to_rehash)
 
- Public Member Functions inherited from dart::ObjectCopy< SlowObjectCopyBase >
 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)
 
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::SlowObjectCopyBase
 SlowObjectCopyBase (Thread *thread, IdentityMap *map)
 
- Public Member Functions inherited from dart::ObjectCopyBase
 ObjectCopyBase (Thread *thread)
 
 ~ObjectCopyBase ()
 

Friends

class ObjectGraphCopier
 

Additional Inherited Members

- Public Types inherited from dart::ObjectCopy< SlowObjectCopyBase >
using Types = typename Base::Types
 
- Public Types inherited from dart::SlowObjectCopyBase
using Types = HandleTypes
 
- Protected Member Functions inherited from dart::SlowObjectCopyBase
DART_FORCE_INLINE void ForwardCompressedPointers (const Object &src, const Object &dst, intptr_t offset, intptr_t end_offset)
 
DART_FORCE_INLINE void ForwardCompressedPointers (const Object &src, const Object &dst, intptr_t offset, intptr_t end_offset, UnboxedFieldBitmap bitmap)
 
void ForwardCompressedArrayPointers (intptr_t array_length, const Object &src, const Object &dst, intptr_t offset, intptr_t end_offset)
 
void ForwardCompressedContextPointers (intptr_t context_length, const Object &src, const Object &dst, intptr_t offset, intptr_t end_offset)
 
DART_FORCE_INLINE void ForwardCompressedLargeArrayPointer (const Object &src, const Object &dst, intptr_t offset)
 
DART_FORCE_INLINE void ForwardCompressedPointer (const Object &src, const Object &dst, intptr_t offset)
 
ObjectPtr Forward (uword tags, const Object &from)
 
void EnqueueTransferable (const TransferableTypedData &from, const TransferableTypedData &to)
 
void EnqueueWeakProperty (const WeakProperty &from)
 
void EnqueueWeakReference (const WeakReference &from)
 
void EnqueueObjectToRehash (const Object &to)
 
void EnqueueExpandoToRehash (const Object &to)
 
void StoreCompressedArrayPointers (intptr_t array_length, const Object &src, const Object &dst, intptr_t offset, intptr_t end_offset)
 
void StoreCompressedPointers (const Object &src, const Object &dst, intptr_t offset, intptr_t end_offset)
 
- Protected Member Functions inherited from dart::ObjectCopyBase
void StoreCompressedLargeArrayPointerBarrier (ObjectPtr obj, intptr_t offset, ObjectPtr value)
 
DART_FORCE_INLINE bool CanCopyObject (uword tags, ObjectPtr object)
 
- Static Protected Member Functions inherited from dart::SlowObjectCopyBase
static void StoreCompressedPointersNoBarrier (const Object &src, const Object &dst, intptr_t offset, intptr_t end_offset)
 
- Static Protected Member Functions inherited from dart::ObjectCopyBase
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 inherited from dart::SlowObjectCopyBase
SlowForwardMap slow_forward_map_
 
- Protected Attributes inherited from dart::ObjectCopyBase
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 2291 of file object_graph_copy.cc.

Constructor & Destructor Documentation

◆ SlowObjectCopy()

dart::SlowObjectCopy::SlowObjectCopy ( Thread thread,
IdentityMap map 
)
inline

Definition at line 2293 of file object_graph_copy.cc.

2294 : ObjectCopy(thread, map),
2295 objects_to_rehash_(Array::Handle(thread->zone())),
2296 expandos_to_rehash_(Array::Handle(thread->zone())) {}
ObjectCopy(Thread *thread, IdentityMap *map)
static Object & Handle()
Definition object.h:407

◆ ~SlowObjectCopy()

dart::SlowObjectCopy::~SlowObjectCopy ( )
inline

Definition at line 2297 of file object_graph_copy.cc.

2297{}

Member Function Documentation

◆ BuildArrayOfObjectsToRehash()

ArrayPtr dart::SlowObjectCopy::BuildArrayOfObjectsToRehash ( const GrowableArray< const Object * > &  objects_to_rehash)
inline

Definition at line 2386 of file object_graph_copy.cc.

2387 {
2388 const intptr_t length = objects_to_rehash.length();
2389 if (length == 0) return Array::null();
2390
2391 const auto& array = Array::Handle(zone_, Array::New(length));
2392 for (intptr_t i = 0; i < length; ++i) {
2393 array.SetAt(i, *objects_to_rehash[i]);
2394 }
2395 return array.ptr();
2396 }
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
Definition object.h:10933
static ObjectPtr null()
Definition object.h:433
size_t length

◆ ContinueCopyGraphSlow()

ObjectPtr dart::SlowObjectCopy::ContinueCopyGraphSlow ( const Object root,
const Object fast_root_copy 
)
inline

Definition at line 2299 of file object_graph_copy.cc.

2300 {
2301 auto& root_copy = Object::Handle(Z, fast_root_copy.ptr());
2302 if (root_copy.ptr() == Marker()) {
2303 root_copy = Forward(TagsFromUntaggedObject(root.ptr().untag()), root);
2304 }
2305
2306 WeakProperty& weak_property = WeakProperty::Handle(Z);
2307 Object& from = Object::Handle(Z);
2308 Object& to = Object::Handle(Z);
2309 while (true) {
2310 if (slow_forward_map_.fill_cursor_ ==
2311 slow_forward_map_.from_to_.Length()) {
2312 break;
2313 }
2314
2315 // Run fixpoint to copy all objects.
2316 while (slow_forward_map_.fill_cursor_ <
2317 slow_forward_map_.from_to_.Length()) {
2318 const intptr_t index = slow_forward_map_.fill_cursor_;
2319 from = slow_forward_map_.from_to_.At(index);
2320 to = slow_forward_map_.from_to_.At(index + 1);
2321 CopyObject(from, to);
2322 slow_forward_map_.fill_cursor_ += 2;
2323 if (exception_msg_ != nullptr) {
2324 return Marker();
2325 }
2326 // To maintain responsiveness we regularly check whether safepoints are
2327 // requested.
2329 }
2330
2331 // Possibly forward values of [WeakProperty]s if keys became reachable.
2332 intptr_t i = 0;
2333 auto& weak_properties = slow_forward_map_.weak_properties_;
2334 while (i < weak_properties.length()) {
2335 const auto& from_weak_property = *weak_properties[i];
2336 to = slow_forward_map_.ForwardedObject(from_weak_property.key());
2337 if (to.ptr() != Marker()) {
2338 weak_property ^=
2339 slow_forward_map_.ForwardedObject(from_weak_property.ptr());
2340
2341 // The key became reachable so we'll change the forwarded
2342 // [WeakProperty]'s key to the new key (it is `null` at this point).
2343 weak_property.set_key(to);
2344
2345 // Since the key has become strongly reachable in the copied graph,
2346 // we'll also need to forward the value.
2347 ForwardCompressedPointer(from_weak_property, weak_property,
2348 OFFSET_OF(UntaggedWeakProperty, value_));
2349
2350 // We don't need to process this [WeakProperty] again.
2351 const intptr_t last = weak_properties.length() - 1;
2352 if (i < last) {
2353 weak_properties[i] = weak_properties[last];
2354 weak_properties.SetLength(last);
2355 continue;
2356 }
2357 }
2358 i++;
2359 }
2360 }
2361
2362 // After the fix point with [WeakProperty]s do [WeakReference]s.
2363 WeakReference& weak_reference = WeakReference::Handle(Z);
2364 auto& weak_references = slow_forward_map_.weak_references_;
2365 for (intptr_t i = 0; i < weak_references.length(); i++) {
2366 const auto& from_weak_reference = *weak_references[i];
2367 to = slow_forward_map_.ForwardedObject(from_weak_reference.target());
2368 if (to.ptr() != Marker()) {
2369 weak_reference ^=
2370 slow_forward_map_.ForwardedObject(from_weak_reference.ptr());
2371
2372 // The target became reachable so we'll change the forwarded
2373 // [WeakReference]'s target to the new target (it is `null` at this
2374 // point).
2375 weak_reference.set_target(to);
2376 }
2377 }
2378
2379 objects_to_rehash_ =
2381 expandos_to_rehash_ =
2383 return root_copy.ptr();
2384 }
#define Z
intptr_t Length() const
Definition object.h:11046
ObjectPtr At(intptr_t index) const
Definition object.h:11059
ObjectPtr ForwardedObject(ObjectPtr object)
DART_FORCE_INLINE void ForwardCompressedPointer(const Object &src, const Object &dst, intptr_t offset)
ObjectPtr Forward(uword tags, const Object &from)
ArrayPtr BuildArrayOfObjectsToRehash(const GrowableArray< const Object * > &objects_to_rehash)
void CheckForSafepoint()
Definition thread.h:1091
DART_FORCE_INLINE uword TagsFromUntaggedObject(UntaggedObject *obj)
static DART_FORCE_INLINE ObjectPtr Marker()
#define OFFSET_OF(type, field)
Definition globals.h:138

Friends And Related Symbol Documentation

◆ ObjectGraphCopier

friend class ObjectGraphCopier
friend

Definition at line 2399 of file object_graph_copy.cc.


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