Add more VerifyObject calls.
Added verify object calls to SirtRef, IndirectReferenceTable,
ReferenceTable.
Removed un-needed verify object in ScopedObjectAccess / DecodeJObject
since object sources are handled.
Bug: 12934910
Change-Id: I55a46a8ea61fed2a77526eda27fd2cce97a9b125
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 2497e6a..87b4e60 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -2708,5 +2708,12 @@
mod_union_tables_.Put(mod_union_table->GetSpace(), mod_union_table);
}
+void Heap::CheckPreconditionsForAllocObject(mirror::Class* c, size_t byte_count) {
+ CHECK(c == NULL || (c->IsClassClass() && byte_count >= sizeof(mirror::Class)) ||
+ (c->IsVariableSize() || c->GetObjectSize() == byte_count) ||
+ strlen(ClassHelper(c).GetDescriptor()) == 0);
+ CHECK_GE(byte_count, sizeof(mirror::Object));
+}
+
} // namespace gc
} // namespace art