Revert "Change dex caches to be weak roots"
This reverts commit 3ae6b1d42523bb2a0ddb5edff1aaf05b592f28f4.
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 49451ad..1912314 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -791,12 +791,6 @@
return failure_count;
}
-void Runtime::SetSentinel(mirror::Object* sentinel) {
- CHECK(sentinel_.Read() == nullptr);
- CHECK(sentinel != nullptr);
- sentinel_ = GcRoot<mirror::Object>(sentinel);
-}
-
bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized) {
ATRACE_BEGIN("Runtime::Init");
CHECK_EQ(sysconf(_SC_PAGE_SIZE), kPageSize);
@@ -1060,6 +1054,10 @@
CHECK(class_linker_ != nullptr);
+ // Initialize the special sentinel_ value early.
+ sentinel_ = GcRoot<mirror::Object>(class_linker_->AllocObject(self));
+ CHECK(sentinel_.Read() != nullptr);
+
verifier::MethodVerifier::Init();
if (runtime_options.Exists(Opt::MethodTrace)) {