Exception support for object allocation.
Strengthen asserts, no extra unit tests as expect good coverage on this
already.
Change-Id: Ie8786932667b70d20c0cdf69b4b6b721b6244ded
diff --git a/src/object.cc b/src/object.cc
index 29eac77..7b47d9f 100644
--- a/src/object.cc
+++ b/src/object.cc
@@ -774,20 +774,10 @@
new_dex_cache, false);
}
-Object* Class::AllocObjectFromCode(uint32_t type_idx, Method* method) {
- Class* klass = method->GetDexCacheResolvedTypes()->Get(type_idx);
- if (klass == NULL) {
- klass = Runtime::Current()->GetClassLinker()->ResolveType(type_idx, method);
- if (klass == NULL) {
- UNIMPLEMENTED(FATAL) << "throw an error";
- return NULL;
- }
- }
- return klass->AllocObject();
-}
-
Object* Class::AllocObject() {
DCHECK(!IsAbstract());
+ DCHECK(!IsInterface());
+ DCHECK(!IsPrimitive());
return Heap::AllocObject(this, this->object_size_);
}