Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
dart::ForwardMapBase Class Reference
Inheritance diagram for dart::ForwardMapBase:
dart::FastForwardMap dart::SlowForwardMap

Public Member Functions

 ForwardMapBase (Thread *thread)
 

Protected Member Functions

void FinalizeTransferable (const TransferableTypedData &from, const TransferableTypedData &to)
 
void FinalizeExternalTypedData (const ExternalTypedData &to)
 

Protected Attributes

Threadthread_
 
Zonezone_
 

Friends

class ObjectGraphCopier
 

Detailed Description

Definition at line 581 of file object_graph_copy.cc.

Constructor & Destructor Documentation

◆ ForwardMapBase()

dart::ForwardMapBase::ForwardMapBase ( Thread thread)
inlineexplicit

Definition at line 583 of file object_graph_copy.cc.

584 : thread_(thread), zone_(thread->zone()) {}

Member Function Documentation

◆ FinalizeExternalTypedData()

void dart::ForwardMapBase::FinalizeExternalTypedData ( const ExternalTypedData to)
inlineprotected

Definition at line 612 of file object_graph_copy.cc.

612 {
613 to.AddFinalizer(to.DataAddr(0), &FreeExternalTypedData, to.LengthInBytes());
614 }
void FreeExternalTypedData(void *isolate_callback_data, void *buffer)

◆ FinalizeTransferable()

void dart::ForwardMapBase::FinalizeTransferable ( const TransferableTypedData from,
const TransferableTypedData to 
)
inlineprotected

Definition at line 589 of file object_graph_copy.cc.

590 {
591 // Get the old peer.
592 auto fpeer = static_cast<TransferableTypedDataPeer*>(
593 thread_->heap()->GetPeer(from.ptr()));
594 ASSERT(fpeer != nullptr && fpeer->data() != nullptr);
595 const intptr_t length = fpeer->length();
596
597 // Allocate new peer object with (data, length).
598 auto tpeer = new TransferableTypedDataPeer(fpeer->data(), length);
599 thread_->heap()->SetPeer(to.ptr(), tpeer);
600
601 // Move the handle itself to the new object.
602 fpeer->handle()->EnsureFreedExternal(thread_->isolate_group());
603 FinalizablePersistentHandle* finalizable_ref =
606 /*auto_delete=*/true);
607 ASSERT(finalizable_ref != nullptr);
608 tpeer->set_handle(finalizable_ref);
609 fpeer->ClearData();
610 }
static FinalizablePersistentHandle * New(IsolateGroup *isolate_group, const Object &object, void *peer, Dart_HandleFinalizer callback, intptr_t external_size, bool auto_delete)
void * GetPeer(ObjectPtr raw_obj) const
Definition: heap.h:167
void SetPeer(ObjectPtr raw_obj, void *peer)
Definition: heap.h:164
Heap * heap() const
Definition: thread.cc:943
IsolateGroup * isolate_group() const
Definition: thread.h:541
#define ASSERT(E)
size_t length
void FreeTransferablePeer(void *isolate_callback_data, void *peer)

Friends And Related Function Documentation

◆ ObjectGraphCopier

friend class ObjectGraphCopier
friend

Definition at line 587 of file object_graph_copy.cc.

Member Data Documentation

◆ thread_

Thread* dart::ForwardMapBase::thread_
protected

Definition at line 616 of file object_graph_copy.cc.

◆ zone_

Zone* dart::ForwardMapBase::zone_
protected

Definition at line 617 of file object_graph_copy.cc.


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