Pre-allocate the NoClassDefFoundError to be thrown for boot classes.
Bring over a Dalvik "optimization".
Bug: 12804658
Bug: 16853450
Change-Id: I6419de7bd2ba18d91479cb52489104954f5c4524
(cherry picked from commit 63557459a4098294a9ff44d035241de2966047c0)
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 183bf52..db7b476 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_;
}
@@ -501,6 +504,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_;