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

Unified Diff: runtime/vm/verifier.cc

Issue 630933002: Check mark bit when verifying heap. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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
===================================================================
--- runtime/vm/verifier.cc (revision 40925)
+++ runtime/vm/verifier.cc (working copy)
@@ -21,6 +21,24 @@
void VerifyObjectVisitor::VisitObject(RawObject* raw_obj) {
+ if (raw_obj->IsHeapObject()) {
+ switch (mark_expectation_) {
+ case kForbidMarked:
+ if (raw_obj->IsMarked()) {
+ uword raw_addr = RawObject::ToAddr(raw_obj);
+ FATAL1("Marked object encountered %#" Px "\n", raw_addr);
+ }
+ break;
+ case kAllowMarked:
+ break;
+ case kRequireMarked:
+ if (!raw_obj->IsMarked()) {
+ uword raw_addr = RawObject::ToAddr(raw_obj);
+ FATAL1("Unmarked object encountered %#" Px "\n", raw_addr);
+ }
+ break;
+ }
+ }
allocated_set_->Add(raw_obj);
raw_obj->Validate(isolate());
}
@@ -47,10 +65,11 @@
}
-void VerifyPointersVisitor::VerifyPointers() {
+void VerifyPointersVisitor::VerifyPointers(MarkExpectation mark_expectation) {
NoGCScope no_gc;
Isolate* isolate = Isolate::Current();
- ObjectSet* allocated_set = isolate->heap()->CreateAllocatedObjectSet();
+ ObjectSet* allocated_set =
+ isolate->heap()->CreateAllocatedObjectSet(mark_expectation);
VerifyPointersVisitor visitor(isolate, allocated_set);
// Visit all strongly reachable objects.
isolate->VisitObjectPointers(&visitor,
« 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