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

Unified Diff: runtime/vm/object.cc

Issue 11867015: Move verification of builtin_vtables into Dart::InitializeIsolate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 17246)
+++ runtime/vm/object.cc (working copy)
@@ -542,6 +542,21 @@
}
+void Object::VerifyBuiltinVtables() {
+#if defined(DEBUG)
+ Isolate* isolate = Isolate::Current();
+ ASSERT(isolate != NULL);
+ Class& cls = Class::Handle(isolate, Class::null());
+ for (intptr_t cid = (kIllegalCid + 1); cid < kNumPredefinedCids; cid++) {
+ if (isolate->class_table()->HasValidClassAt(cid)) {
+ cls |= isolate->class_table()->At(cid);
+ ASSERT(builtin_vtables_[cid] == cls.raw_ptr()->handle_vtable_);
+ }
+ }
+#endif
+}
+
+
void Object::RegisterClass(const Class& cls,
const String& name,
const Library& lib) {
@@ -1199,15 +1214,13 @@
cid = kInstanceCid;
}
ASSERT(vtable() == builtin_vtables_[cid]);
- Isolate* isolate = Isolate::Current();
if (FLAG_verify_handles) {
+ Isolate* isolate = Isolate::Current();
Heap* isolate_heap = isolate->heap();
Heap* vm_isolate_heap = Dart::vm_isolate()->heap();
ASSERT(isolate_heap->Contains(RawObject::ToAddr(raw_)) ||
vm_isolate_heap->Contains(RawObject::ToAddr(raw_)));
}
- ASSERT(builtin_vtables_[cid] ==
- isolate->class_table()->At(cid)->ptr()->handle_vtable_);
}
#endif
}
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698