diff options
author | 2023-01-03 14:01:00 +0000 | |
---|---|---|
committer | 2023-01-28 16:42:34 +0000 | |
commit | df68c0a6f0d36728fa728049e5bcec20de2d0d5e (patch) | |
tree | f65b2ffdf3f998dc7980853c71d169cb489289a8 /runtime/class_linker.cc | |
parent | 09c218c61ab525b05d7181be92e78d69d035e122 (diff) |
Write classes in runtime-generated app image.
Test: 845-data-image
Bug: 260557058
Change-Id: I640b78942984ac3d3f8d24abda619d78154acd86
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index a2f451347a..b829f5916c 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2180,9 +2180,11 @@ 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. - // Avoid read barrier since we are comparing against null. - if (klass->GetClassLoader<kDefaultVerifyFlags, kWithoutReadBarrier>() != nullptr) { + if (space->HasAddress(klass.Ptr())) { klass->SetClassLoader(loader); + } else { + DCHECK(klass->IsBootStrapClassLoaded()); + DCHECK(Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(klass.Ptr())); } } } |