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

#include <verifier.h>

Inheritance diagram for dart::VerifyPointersVisitor:
dart::ObjectPointerVisitor

Public Member Functions

 VerifyPointersVisitor (IsolateGroup *isolate_group, ObjectSet *allocated_set, const char *msg)
 
void VisitPointers (ObjectPtr *first, ObjectPtr *last) override
 
- 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)
 

Static Public Member Functions

static void VerifyPointers (const char *msg, MarkExpectation mark_expectation=kForbidMarked)
 

Detailed Description

Definition at line 44 of file verifier.h.

Constructor & Destructor Documentation

◆ VerifyPointersVisitor()

dart::VerifyPointersVisitor::VerifyPointersVisitor ( IsolateGroup isolate_group,
ObjectSet allocated_set,
const char *  msg 
)
inline

Definition at line 46 of file verifier.h.

50 allocated_set_(allocated_set),
51 msg_(msg) {
52 ASSERT(msg_ != nullptr);
53 }
IsolateGroup * isolate_group() const
Definition: visitor.h:25
ObjectPointerVisitor(IsolateGroup *isolate_group)
Definition: visitor.cc:11
#define ASSERT(E)

Member Function Documentation

◆ VerifyPointers()

void dart::VerifyPointersVisitor::VerifyPointers ( const char *  msg,
MarkExpectation  mark_expectation = kForbidMarked 
)
static

Definition at line 81 of file verifier.cc.

82 {
83 Thread* thread = Thread::Current();
84 auto isolate_group = thread->isolate_group();
85 HeapIterationScope iteration(thread);
86 StackZone stack_zone(thread);
87 ObjectSet* allocated_set = isolate_group->heap()->CreateAllocatedObjectSet(
88 stack_zone.GetZone(), mark_expectation);
89
90 VerifyPointersVisitor visitor(isolate_group, allocated_set, msg);
91 // Visit all strongly reachable objects.
92 iteration.IterateObjectPointers(&visitor, ValidationPolicy::kValidateFrames);
93 VerifyWeakPointersVisitor weak_visitor(&visitor);
94
95 // Visit weak handles and prologue weak handles.
97}
ObjectSet * CreateAllocatedObjectSet(Zone *zone, MarkExpectation mark_expectation)
Definition: heap.cc:743
Heap * heap() const
Definition: isolate.h:296
void VisitWeakPersistentHandles(HandleVisitor *visitor)
Definition: isolate.cc:2998
static Thread * Current()
Definition: thread.h:362
VerifyPointersVisitor(IsolateGroup *isolate_group, ObjectSet *allocated_set, const char *msg)
Definition: verifier.h:46

◆ VisitPointers()

void dart::VerifyPointersVisitor::VisitPointers ( ObjectPtr first,
ObjectPtr last 
)
overridevirtual

Implements dart::ObjectPointerVisitor.

Definition at line 46 of file verifier.cc.

46 {
47 for (ObjectPtr* ptr = from; ptr <= to; ptr++) {
48 ObjectPtr obj = *ptr;
49 if (obj->IsHeapObject()) {
50 if (!allocated_set_->Contains(obj)) {
51 FATAL("%s: Invalid pointer: *0x%" Px " = 0x%" Px "\n", msg_,
52 reinterpret_cast<uword>(ptr), static_cast<uword>(obj));
53 }
54 }
55 }
56}
bool Contains(ObjectPtr raw_obj) const
Definition: object_set.h:66
#define FATAL(error)
uintptr_t uword
Definition: globals.h:501
#define Px
Definition: globals.h:410

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