Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::IdentityMap Class Reference

Public Member Functions

 IdentityMap (Thread *thread)
 
 ~IdentityMap ()
 
template<typename S , typename T >
DART_FORCE_INLINE ObjectPtr ForwardedObject (const S &object, T from_to)
 
template<typename S , typename T >
DART_FORCE_INLINE void Insert (const S &from, const S &to, T from_to, bool check_for_safepoint)
 

Detailed Description

Definition at line 528 of file object_graph_copy.cc.

Constructor & Destructor Documentation

◆ IdentityMap()

dart::IdentityMap::IdentityMap ( Thread thread)
inlineexplicit

Definition at line 530 of file object_graph_copy.cc.

530 : isolate_(thread->isolate()) {
531 isolate_->set_forward_table_new(new WeakTable());
532 isolate_->set_forward_table_old(new WeakTable());
533 }
void set_forward_table_old(WeakTable *table)
Definition: isolate.cc:2552
void set_forward_table_new(WeakTable *table)
Definition: isolate.cc:2548

◆ ~IdentityMap()

dart::IdentityMap::~IdentityMap ( )
inline

Definition at line 534 of file object_graph_copy.cc.

534 {
535 isolate_->set_forward_table_new(nullptr);
536 isolate_->set_forward_table_old(nullptr);
537 }

Member Function Documentation

◆ ForwardedObject()

template<typename S , typename T >
DART_FORCE_INLINE ObjectPtr dart::IdentityMap::ForwardedObject ( const S object,
T  from_to 
)
inline

Definition at line 540 of file object_graph_copy.cc.

540 {
541 const intptr_t id = GetObjectId(Ptr(object));
542 if (id == 0) return Marker();
543 return from_to.At(id + 1);
544 }
static ObjectPtr Ptr(ObjectPtr obj)
static DART_FORCE_INLINE ObjectPtr Marker()

◆ Insert()

template<typename S , typename T >
DART_FORCE_INLINE void dart::IdentityMap::Insert ( const S from,
const S to,
T  from_to,
bool  check_for_safepoint 
)
inline

Definition at line 547 of file object_graph_copy.cc.

550 {
551 ASSERT(ForwardedObject(from, from_to) == Marker());
552 const auto id = from_to.Length();
553 // May take >100ms and cannot yield to safepoints.
554 SetObjectId(Ptr(from), id);
555 from_to.Add(from, to);
556 }
DART_FORCE_INLINE ObjectPtr ForwardedObject(const S &object, T from_to)
#define ASSERT(E)

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