Pre-allocate the NoClassDefFoundError to be thrown for boot classes.
Bring over a Dalvik "optimization".
Bug: 12804658
Bug: 16853450
Change-Id: I6419de7bd2ba18d91479cb52489104954f5c4524
diff --git a/runtime/runtime.h b/runtime/runtime.h
index e97af17..03952c4 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -246,6 +246,9 @@
mirror::Throwable* GetPreAllocatedOutOfMemoryError() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ mirror::Throwable* GetPreAllocatedNoClassDefFoundError()
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
const std::vector<std::string>& GetProperties() const {
return properties_;
}
@@ -509,6 +512,7 @@
GcRoot<mirror::ArtMethod> callee_save_methods_[kLastCalleeSaveType];
GcRoot<mirror::Throwable> pre_allocated_OutOfMemoryError_;
+ GcRoot<mirror::Throwable> pre_allocated_NoClassDefFoundError_;
GcRoot<mirror::ArtMethod> resolution_method_;
GcRoot<mirror::ArtMethod> imt_conflict_method_;
GcRoot<mirror::ObjectArray<mirror::ArtMethod>> default_imt_;