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_table-inl.h | |
parent | 09c218c61ab525b05d7181be92e78d69d035e122 (diff) |
Write classes in runtime-generated app image.
Test: 845-data-image
Bug: 260557058
Change-Id: I640b78942984ac3d3f8d24abda619d78154acd86
Diffstat (limited to 'runtime/class_table-inl.h')
-rw-r--r-- | runtime/class_table-inl.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/class_table-inl.h b/runtime/class_table-inl.h index 67eeb553a4..ecc8a0a620 100644 --- a/runtime/class_table-inl.h +++ b/runtime/class_table-inl.h @@ -213,6 +213,11 @@ inline ClassTable::TableSlot::TableSlot(ObjPtr<mirror::Class> klass, uint32_t de DCHECK_EQ(descriptor_hash, klass->DescriptorHash()); } +inline ClassTable::TableSlot::TableSlot(uint32_t ptr, uint32_t descriptor_hash) + : data_(ptr | MaskHash(descriptor_hash)) { + DCHECK_ALIGNED(ptr, kObjectAlignment); +} + template <typename Filter> inline void ClassTable::RemoveStrongRoots(const Filter& filter) { WriterMutexLock mu(Thread::Current(), lock_); @@ -227,6 +232,11 @@ inline ObjPtr<mirror::Class> ClassTable::LookupByDescriptor(ObjPtr<mirror::Class return Lookup(descriptor, hash); } +inline size_t ClassTable::Size() const { + ReaderMutexLock mu(Thread::Current(), lock_); + return classes_.size(); +} + } // namespace art #endif // ART_RUNTIME_CLASS_TABLE_INL_H_ |