Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: runtime/vm/verifier.cc

Issue 2160953002: Add a verification step which iterates over the heap and verifies that all canonical objects are co… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address code review comments. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/verifier.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « runtime/vm/verifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698