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

#include <verifier.h>

Inheritance diagram for dart::VerifyObjectVisitor:
dart::ObjectVisitor

Public Member Functions

 VerifyObjectVisitor (IsolateGroup *isolate_group, ObjectSet *allocated_set, MarkExpectation mark_expectation)
 
void VisitObject (ObjectPtr obj) override
 
- Public Member Functions inherited from dart::ObjectVisitor
 ObjectVisitor ()
 
virtual ~ObjectVisitor ()
 
virtual void VisitObject (ObjectPtr obj)=0
 

Detailed Description

Definition at line 23 of file verifier.h.

Constructor & Destructor Documentation

◆ VerifyObjectVisitor()

dart::VerifyObjectVisitor::VerifyObjectVisitor ( IsolateGroup isolate_group,
ObjectSet allocated_set,
MarkExpectation  mark_expectation 
)
inline

Definition at line 25 of file verifier.h.

28 : isolate_group_(isolate_group),
29 allocated_set_(allocated_set),
30 mark_expectation_(mark_expectation) {}

Member Function Documentation

◆ VisitObject()

void dart::VerifyObjectVisitor::VisitObject ( ObjectPtr  obj)
overridevirtual

Implements dart::ObjectVisitor.

Definition at line 19 of file verifier.cc.

19 {
20 ASSERT(obj->IsHeapObject());
22 if (obj->IsFreeListElement() || obj->IsForwardingCorpse()) {
23 if (obj->IsOldObject() && obj->untag()->IsMarked()) {
24 FATAL("Marked free list element encountered %#" Px "\n", addr);
25 }
26 } else {
27 switch (mark_expectation_) {
28 case kForbidMarked:
29 if (obj->IsOldObject() && obj->untag()->IsMarked()) {
30 FATAL("Marked object encountered %#" Px "\n", addr);
31 }
32 break;
33 case kAllowMarked:
34 break;
35 case kRequireMarked:
36 if (obj->IsOldObject() && !obj->untag()->IsMarked()) {
37 FATAL("Unmarked object encountered %#" Px "\n", addr);
38 }
39 break;
40 }
41 allocated_set_->Add(obj);
42 }
43 obj->Validate(isolate_group_);
44}
void Add(ObjectPtr raw_obj)
Definition: object_set.h:75
static uword ToAddr(const UntaggedObject *raw_obj)
Definition: raw_object.h:522
#define ASSERT(E)
#define FATAL(error)
uintptr_t uword
Definition: globals.h:501
@ kAllowMarked
Definition: verifier.h:21
@ kRequireMarked
Definition: verifier.h:21
@ kForbidMarked
Definition: verifier.h:21
#define Px
Definition: globals.h:410

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