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

Unified Diff: runtime/vm/raw_object.cc

Issue 919063002: Increase verbosity of assertion failures in SizeFromClass. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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/platform/assert.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.cc
===================================================================
--- runtime/vm/raw_object.cc (revision 43676)
+++ runtime/vm/raw_object.cc (working copy)
@@ -72,7 +72,15 @@
ASSERT(IsHeapObject());
intptr_t class_id = GetClassId();
- RawClass* raw_class = isolate->class_table()->At(class_id);
+ ClassTable* class_table = isolate->class_table();
+#if defined(DEBUG)
+ if (!class_table->IsValidIndex(class_id) ||
+ !class_table->HasValidClassAt(class_id)) {
+ FATAL2("Invalid class id: %" Pd " from tags %" Px "\n",
+ class_id, ptr()->tags_);
+ }
+#endif // DEBUG
+ RawClass* raw_class = class_table->At(class_id);
ASSERT(raw_class->ptr()->id_ == class_id);
// Get the instance size out of the class.
@@ -205,9 +213,14 @@
}
}
ASSERT(instance_size != 0);
+#if defined(DEBUG)
uword tags = ptr()->tags_;
- ASSERT((instance_size == SizeTag::decode(tags)) ||
- (SizeTag::decode(tags) == 0));
+ intptr_t tags_size = SizeTag::decode(tags);
+ if ((instance_size != tags_size) && (tags_size != 0)) {
+ FATAL3("Size mismatch: %" Pd " vs %" Pd " from tags %" Px "\n",
+ instance_size, tags_size, tags);
+ }
+#endif // DEBUG
return instance_size;
}
« no previous file with comments | « runtime/platform/assert.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698