Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::ForwardPointersVisitor Class Reference
Inheritance diagram for dart::ForwardPointersVisitor:
dart::ObjectPointerVisitor

Public Member Functions

 ForwardPointersVisitor (Thread *thread)
 
void VisitPointers (ObjectPtr *first, ObjectPtr *last) override
 
void VisitingObject (ObjectPtr obj)
 
- Public Member Functions inherited from dart::ObjectPointerVisitor
 ObjectPointerVisitor (IsolateGroup *isolate_group)
 
virtual ~ObjectPointerVisitor ()
 
IsolateGroupisolate_group () const
 
virtual void VisitTypedDataViewPointers (TypedDataViewPtr view, CompressedObjectPtr *first, CompressedObjectPtr *last)
 
virtual void VisitPointers (ObjectPtr *first, ObjectPtr *last)=0
 
void VisitCompressedPointers (uword heap_base, CompressedObjectPtr *first, CompressedObjectPtr *last)
 
void VisitPointers (ObjectPtr *p, intptr_t len)
 
void VisitPointer (ObjectPtr *p)
 
const char * gc_root_type () const
 
void set_gc_root_type (const char *gc_root_type)
 
void clear_gc_root_type ()
 
virtual bool visit_weak_persistent_handles () const
 
virtual bool trace_values_through_fields () const
 
const ClassTableclass_table () const
 
virtual bool CanVisitSuspendStatePointers (SuspendStatePtr suspend_state)
 

Detailed Description

Definition at line 78 of file become.cc.

Constructor & Destructor Documentation

◆ ForwardPointersVisitor()

dart::ForwardPointersVisitor::ForwardPointersVisitor ( Thread thread)
inlineexplicit

Definition at line 80 of file become.cc.

81 : ObjectPointerVisitor(thread->isolate_group()),
82 thread_(thread),
83 visiting_object_(nullptr) {}
ObjectPointerVisitor(IsolateGroup *isolate_group)
Definition: visitor.cc:11

Member Function Documentation

◆ VisitingObject()

void dart::ForwardPointersVisitor::VisitingObject ( ObjectPtr  obj)
inline

Definition at line 139 of file become.cc.

139 {
140 visiting_object_ = obj;
141 // The incoming remembered bit may be unreliable. Clear it so we can
142 // consistently reapply the barrier to all slots.
143 if ((obj != nullptr) && obj->IsOldObject() &&
144 obj->untag()->IsRemembered()) {
145 ASSERT(!obj->IsForwardingCorpse());
146 ASSERT(!obj->IsFreeListElement());
147 obj->untag()->ClearRememberedBit();
148 }
149 }
#define ASSERT(E)

◆ VisitPointers()

void dart::ForwardPointersVisitor::VisitPointers ( ObjectPtr first,
ObjectPtr last 
)
inlineoverridevirtual

Implements dart::ObjectPointerVisitor.

Definition at line 85 of file become.cc.

85 {
86 for (ObjectPtr* p = first; p <= last; p++) {
87 ObjectPtr old_target = *p;
88 ObjectPtr new_target;
89 if (IsForwardingObject(old_target)) {
90 new_target = GetForwardedObject(old_target);
91 } else {
92 // Though we do not need to update the slot's value when it is not
93 // forwarded, we do need to recheck the generational barrier. In
94 // particular, the remembered bit may be incorrectly false if this
95 // become was the result of aborting a scavenge while visiting the
96 // remembered set.
97 new_target = old_target;
98 }
99 if (visiting_object_ == nullptr) {
100 *p = new_target;
101 } else if (visiting_object_->untag()->IsCardRemembered()) {
102 visiting_object_->untag()->StoreArrayPointer(p, new_target, thread_);
103 } else {
104 visiting_object_->untag()->StorePointer(p, new_target, thread_);
105 }
106 }
107 }
UntaggedObject * untag() const
void StorePointer(type const *addr, type value)
Definition: raw_object.h:595
void StoreArrayPointer(type const *addr, value_type value)
Definition: raw_object.h:645
bool IsCardRemembered() const
Definition: raw_object.h:385
static ObjectPtr GetForwardedObject(ObjectPtr object)
Definition: become.cc:54
static bool IsForwardingObject(ObjectPtr object)
Definition: become.cc:50

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