diff options
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index b829f5916c..a2f451347a 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2180,11 +2180,9 @@ bool ClassLinker::AddImageSpace( ObjPtr<mirror::Class> klass(root.Read()); // Do not update class loader for boot image classes where the app image // class loader is only the initiating loader but not the defining loader. - if (space->HasAddress(klass.Ptr())) { + // Avoid read barrier since we are comparing against null. + if (klass->GetClassLoader<kDefaultVerifyFlags, kWithoutReadBarrier>() != nullptr) { klass->SetClassLoader(loader); - } else { - DCHECK(klass->IsBootStrapClassLoaded()); - DCHECK(Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(klass.Ptr())); } } } |