summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 6b9c8aa353..8e42040c1d 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -128,7 +128,11 @@ void ClassLinker::ThrowEarlierClassFailure(mirror::Class* c) {
// the previous error.
Runtime* const runtime = Runtime::Current();
if (!runtime->IsAotCompiler()) { // Give info if this occurs at runtime.
- LOG(INFO) << "Rejecting re-init on previously-failed class " << PrettyClass(c);
+ std::string extra;
+ if (c->GetVerifyErrorClass() != nullptr) {
+ extra = PrettyDescriptor(c->GetVerifyErrorClass());
+ }
+ LOG(INFO) << "Rejecting re-init on previously-failed class " << PrettyClass(c) << ": " << extra;
}
CHECK(c->IsErroneous()) << PrettyClass(c) << " " << c->GetStatus();
@@ -1316,13 +1320,6 @@ void ClassLinker::VisitClassRoots(RootVisitor* visitor, VisitRootFlags flags) {
// Need to make sure to not copy ArtMethods without doing read barriers since the roots are
// marked concurrently and we don't hold the classlinker_classes_lock_ when we do the copy.
boot_class_table_.VisitRoots(buffered_visitor);
- // TODO: Avoid marking these to enable class unloading.
- JavaVMExt* const vm = Runtime::Current()->GetJavaVM();
- for (const ClassLoaderData& data : class_loaders_) {
- mirror::Object* class_loader = vm->DecodeWeakGlobal(self, data.weak_root);
- // Don't need to update anything since the class loaders will be updated by SweepSystemWeaks.
- visitor->VisitRootIfNonNull(&class_loader, RootInfo(kRootVMInternal));
- }
} else if ((flags & kVisitRootFlagNewRoots) != 0) {
for (auto& root : new_class_roots_) {
mirror::Class* old_ref = root.Read<kWithoutReadBarrier>();
@@ -4266,6 +4263,11 @@ bool ClassLinker::LinkClass(Thread* self,
ClassTable* const table = InsertClassTableForClassLoader(class_loader);
mirror::Class* existing = table->UpdateClass(descriptor, h_new_class.Get(),
ComputeModifiedUtf8Hash(descriptor));
+ if (class_loader != nullptr) {
+ // We updated the class in the class table, perform the write barrier so that the GC knows
+ // about the change.
+ Runtime::Current()->GetHeap()->WriteBarrierEveryFieldOf(class_loader);
+ }
CHECK_EQ(existing, klass.Get());
if (kIsDebugBuild && class_loader == nullptr && dex_cache_image_class_lookup_required_) {
// Check a class loaded with the system class loader matches one in the image if the class