Index: runtime/vm/verifier.cc |
diff --git a/runtime/vm/verifier.cc b/runtime/vm/verifier.cc |
index 18a78744e2b1fdaab509803d820380c082a5e84a..de125bfd7c5cdcc9088914df9b59cfbb38bb98aa 100644 |
--- a/runtime/vm/verifier.cc |
+++ b/runtime/vm/verifier.cc |
@@ -82,4 +82,22 @@ void VerifyPointersVisitor::VerifyPointers(MarkExpectation mark_expectation) { |
delete allocated_set; |
} |
+ |
+#if defined(DEBUG) |
+VerifyCanonicalVisitor::VerifyCanonicalVisitor(Thread* thread) |
+ : thread_(thread), |
+ instanceHandle_(Instance::Handle(thread->zone())) { |
+} |
+ |
+ |
+void VerifyCanonicalVisitor::VisitObject(RawObject* obj) { |
+ if (obj->GetClassId() >= kInstanceCid) { |
+ if (obj->IsCanonical()) { |
+ instanceHandle_ ^= obj; |
+ ASSERT(instanceHandle_.CheckIsCanonical(thread_)); |
+ } |
+ } |
+} |
+#endif // defined(DEBUG) |
+ |
} // namespace dart |