Revert^2 "Delay init of classes of pre-allocated exceptions."
This reverts commit 29cf32bb64dc61c4f755661939630775bd36419d.
Fixed heap-poisoning/gcstress tests by calling the Alloc<>()
of the exception object with kInstrumented=true.
Change-Id: I209ab4f020e9c6fb67319fddde69ed87e3653223
Test: m test-art-host-gtest
Test: testrunner.py --host
Test: Pixel 2 XL boots.
Test: run_build_test_target.py art-gtest-heap-poisoning
Test: run_build_test_target.py art-interpreter-gcstress
Bug: 109925024
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 7b92ba4..38212da 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -864,8 +864,7 @@
VLOG(startup) << "ClassLinker::FinishInit exiting";
}
-void ClassLinker::RunRootClinits() {
- Thread* self = Thread::Current();
+void ClassLinker::RunRootClinits(Thread* self) {
for (size_t i = 0; i < static_cast<size_t>(ClassRoot::kMax); ++i) {
ObjPtr<mirror::Class> c = GetClassRoot(ClassRoot(i), this);
if (!c->IsArrayClass() && !c->IsPrimitive()) {
@@ -873,6 +872,8 @@
Handle<mirror::Class> h_class(hs.NewHandle(c));
EnsureInitialized(self, h_class, true, true);
self->AssertNoPendingException();
+ } else {
+ DCHECK(c->IsInitialized());
}
}
}