summaryrefslogtreecommitdiff
path: root/runtime/class_table-inl.h
AgeCommit message (Collapse)Author
2024-05-09Avoid some `std::string` construction in `ClassTable`. Vladimir Marko
Do not construct a `std::string` when compaing most class descriptors for `Class` objects. We still construct it for the edge case when comparing a proxy class and non-proxy class descriptors which should really yield false, except that ART does not propely enforce the namespace separation. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 338123769 Change-Id: I001abf9dd6648621e86f43a8234d2c0c1d02471c
2024-01-24Add visibility attributes in runtime/c* Dmitrii Ishcheikin
Bug: 260881207 Test: presubmit Test: abtd app_compat_drm Test: abtd app_compat_top_100 Test: abtd app_compat_banking Change-Id: Id729aca1d8b6d003ff3e9755112f3283e9f2b507
2024-01-19Move files related to compiled code into oat/ directory Dmitrii Ishcheikin
Test: art/test.py -b --host Change-Id: Icedd3a82c6bca5147c3bc9dc50de5a729003d66f
2023-10-17Revert^2 "Update class-table and intern-table concurrently with uffd GC" Lokesh Gidra
This reverts commit 9faffd5c4e062ca45bd6f29a3b6d1b276e6c9839. Reason for revert: Reland after fixing null-pointer dereference Bug: 160737021 Test: art/testrunner/testrunner.py Change-Id: I80d3eda827ea805efc5a0e0eb0b80a9d8ceb9dd5
2023-10-17Revert "Update class-table and intern-table concurrently with uffd GC" Lokesh Gidra
This reverts commit 97a6f7cd191cde0abaaf6323ae2f67d8e42a1236. Reason for revert: LUCI failure in libcore test Change-Id: I381b261ae0f67103bf1d096d8f64c84ba3f3e19c
2023-10-17Update class-table and intern-table concurrently with uffd GC Lokesh Gidra
Bug: 160737021 Test: art/testrunner/testrunner.py Change-Id: I4413ead05947f3f865116ae8dc7d67d860106b37
2023-02-01Reland "Write classes in runtime-generated app image." Nicolas Geoffray
This reverts commit 24b3d648ff6c2c200003f55ac63fc910d7bfd40f. Bug: 260557058 Reason for revert: - Encode class loader context in image, and check it at load time. - Set nterp entrypoint to methods that can. Test: test.py Test: atest com.android.bluetooth.opp.BluetoothOppObexServerSessionTest#onPut_withUnsupportedMimeTypeInHeader_returnsHttpBadRequest Change-Id: Ibf4a8604c4a226d1acc021103668e211446bb53c
2023-01-29Revert "Write classes in runtime-generated app image." Sam Saccone
This reverts commit df68c0a6f0d36728fa728049e5bcec20de2d0d5e. Reason for revert: b/267084527 Change-Id: I2eacf89c23db00c46d56e78009efa11bed31af60
2023-01-28Write classes in runtime-generated app image. Nicolas Geoffray
Test: 845-data-image Bug: 260557058 Change-Id: I640b78942984ac3d3f8d24abda619d78154acd86
2022-08-10Update native gc-roots separately in compaction pause Lokesh Gidra
The concurrent compaction algorithm requires all GC roots to be updated to post-compact addresses before resuming mutators for concurrent compaction. Therefore, unlike CC, we cannot update native roots in classes/dex-caches/class-loaders while visiting references (VisitReferences) on heap objects. This CL separates the two and updates all the gc-roots in the compaction pause. Bug: 160737021 Test: art/test/testrunner/testrunner.py Change-Id: I8a57472ba49b9dc30bc0f41a7db3f5efa7eafd9a
2022-04-21Move descriptor hashing to `mirror::Class`. Vladimir Marko
We may want to reuse the hashing for image classes which are not closely related with the `ClassTable` where the hashing was previously. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: Icf1b51085829509f58e7685dc1e9cf2b0583d107
2022-04-04Faster class descriptor hashing. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I94612e8229b6d21abd51ade36ed88c1b5db77764
2022-02-17Avoid unnecessary read barriers in `ImageWriter`. Vladimir Marko
Also avoid visiting native roots during the same stages, namely layout and writing (including copy-and-fixup). Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I0d62d67556109dbcbd8a04fd0e8408733dacce33
2021-04-28Remove some dead code around ClassTable. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 175869411 Change-Id: Ifb3ac102129470aff6eb228e5523b240c113818f
2021-03-04Make some hash/equals operators inline. Vladimir Marko
Namely class descriptor hash/equals in ClassTable and string hash/equals in InternTable. This should reduce reliance on ThinLTO for performance. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 179799979 Bug: 179837605 Change-Id: Ie513b2312d30e1b52efefd705a26d13035789e4a
2019-05-08ObjPtr<>-ify ClassTable. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: Ieced7a452d381e5cacbafc91fd5d7672d9d92c30
2019-05-08Avoid some read barriers in ClassTable. Vladimir Marko
And clean up ClassTable. Test: m test-art-host-gtest Test: testrunner.py --host --interpreter Bug: 119486698 Change-Id: Ie413bc5a56eb548352ae1fed0976b75c44e0c0d4
2019-03-28Style cleanup for ObjPtr<>-ify changes. Vladimir Marko
Replace "ObjPtr<.> const" with "const ObjPtr<.>". Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I5a1c080bc88b091e15ee9eb0bb1ef6f6f290701c
2018-10-25ART: Do some include-what-you-use Andreas Gampe
Help with transitive includes. In preparation for new specialized headers reducing transitivity. Bug: 118385392 Test: mmma art Change-Id: Ib465ecceec3331ea81588fb4a43eb65e766b6904
2018-05-25Remove mirror::Reference::java_lang_ref_Reference. Vladimir Marko
And some #include cleanup after previous CLs removing static GcRoot<>s. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I56b34637f9d793ed7680696a1eeedd07d061ad00
2018-03-23ART: Simplify atomic.h Orion Hodson
Prefer std::atomic operations over wrappers in atomic.h. Exceptions are cases that relate to the Java data memory operations and CAS operations. Bug: 71621075 Test: art/test.py --host -j32 Test: art/test.py --target --64 -j4 Change-Id: I9a157e9dede852c1b2aa67d22e3e604a68a9ef1c
2018-03-13Fix dangling SingleImplementations left after class unloading Alexey Grebenkin
Test: make test-art-host, manual using sample code bug: 73143991 Change-Id: I4d56b39c69d4ed60266a8b90b9e9d18fba7b8227
2018-01-03ART: Rename Atomic::CompareExchange methods Orion Hodson
Renames Atomic::CompareExchange methods to Atomic::CompareAndSet equivalents. These methods return a boolean and do not get the witness value. This makes space for Atomic::CompareAndExchange methods in a later commit that will return a boolean and get the witness value. This is pre-work for VarHandle accessors which require both forms. Bug: 65872996 Test: art/test.py --host -j32 Change-Id: I9c691250e5556cbfde7811381b06d2920247f1a1
2017-07-28Use class unloading in dex2oat for verify and extract Mathieu Chartier
Unload the main classloader in between each dex file compilation to reduce RAM. This frees the whole java heap and associated linear allocs. This is only used for quickening since filters that do compilation may require loaded classes in the compiler and oat writer. This reduces dex2oat peak PSS for compiling a large app from 196MB to 135MB. Only works for verify and extract since the current approach is incompatible with oat writer patching. b/63911263 Added a verification override that reads the compiled class status to avoid ever verifying classes that were quickened (since this is not supported and causes failures). There is still some duplicated verification for some class with superclasses in other dex files. Support for quicken will be added in a follow up CL. Bug: 63467744 Test: test-art-host Test: test/testrunner/testrunner.py --interpreter --host -j40 Change-Id: Id0e4f84eb5db91d6143f752b498f4832a5b25b6e
2017-06-05ART: Small class-inl.h cleanup Andreas Gampe
Remove unnecessary class_linker-inl.h include, and fix up all transitives (mainly gc_root-inl.h). Also clean up reference.h. Test: m test-art-host Change-Id: I47bd6edcfe4a23821e37a6e6fa8cca91d0d2d226
2017-06-02Move to release CAS for updating object fields Mathieu Chartier
Relaxed cas is not sufficient to make sure threads that read the field will see the copied contents of objects. Bug: 37187694 Bug: 62240510 Test: test-art-host (cherry picked from commit a1f20c3f8d0dabb9723acccf3ba760acf3ebe62d) Change-Id: I8bff8a67c2c52eb131714b52e6d842c8c08dd70a
2016-12-13Address some review comments Mathieu Chartier
Addressed comments in dex cache and class table. Added class table test. Test: mm test-art-host-gtest-class_table_test -j20 Change-Id: I3ec0282247187acb1ec7af25b309501f001a1c3e
2016-12-06Reduce calls to DescriptorEquals Mathieu Chartier
Store the low 3 bits of the descriptor hash inside of class set entries. Compare these bits before comparing descriptors. Simpleperf interpret-only compile of facebook: mirror::Class::DescriptorEquals(char const*): 3.66% -> 1.03% Bug: 32641252 Test: test-art-host Change-Id: I8d898d4ac7c95383c49401fbcd85bfde226e026c
2016-10-04Revert "Revert "Store resolved Strings for AOT code in .bss."" Vladimir Marko
Fixed oat_test to keep dex files alive. Fixed mips build. Rewritten the .bss GC root visiting and added write barrier to the artResolveStringFromCode(). Test: build aosp_mips-eng Test: m ART_DEFAULT_GC_TYPE=SS test-art-target-host-gtest-oat_test Test: Run ART test suite on host and Nexus 9. Bug: 20323084 Bug: 30627598 This reverts commit 5f926055cb88089d8ca27243f35a9dfd89d981f0. Change-Id: I07fa2278d82b8eb64964c9a4b66cb93726ccda6b
2016-06-06Revert "Revert "Hold dex caches live in class table"" Mathieu Chartier
Bug: 29083330 This reverts commit f102faf1bcbdb2149e3e7bf27b1819f621b7894b. Change-Id: Ibc6d260247b3113beec7d33552061512a36c9ce8
2016-06-04Revert "Hold dex caches live in class table" Brian Carlstrom
This reverts commit d6d49e56c2b7b11f474acb80cb02bb1fe9b7861e. Bug: 29083330 Change-Id: Ie209b27897b8079f2d13fd0837fe5f83a7e61afc
2016-06-03Hold dex caches live in class table Mathieu Chartier
Prevents temporary dex caches being unloaded for the same dex file. Usually this is OK, but if someone resolved a string in that dex cache, it could leave stale pointers in BSS. Also it can use extra memory in linear alloc if we allocate dex cache arrays multiple times. Bug: 29083330 (cherry picked from commit f284d448e3edd428b6ade473d0993028638b2064) Change-Id: Ie1b0b0cf835a998e19227cbb90014011a6cd40c4
2016-04-05Shard classloader classes lock Mathieu Chartier
Used to guard adding and removing classes. Previously we used the class linker classes lock, but this had a deadlock issue since the reference processor may need to acquire the lock to mark the classes of a class loader. Another thread could be blocked trying to access weak globals while also holding the class linker classes lock. Bug: 27946564 Change-Id: If7c13e8775f0912e104d1382eacdba7e7edf6818
2016-02-01Fix up dex cache strings stored in classes Mathieu Chartier
Previously we left the image pointer instead of fixing up the pointer to the one in the BSS. This only showed up because JIT does the same as boot image, bypassing null check. Fixed a bug where oat files without embedded dex cache arrays would get their dex cache arrays corrupted. Added a non virtual class visitor for performance. Bug: 26846419 Bug: 22858531 Change-Id: I8cd0d61e440f753b4628ddb8c932eb23a0a81027
2015-10-19Keep dex files live in class table Mathieu Chartier
The DexFile.loadClass API allows callers to load classes using a dex file without having that dex file owned by the specified class loader. We now add the dex file to the class table to make sure it stays live until the class loader is unreachable. Fixes interpreter gcstress test 087 with 64 bit. Bug: 22720414 Change-Id: Ia4341149f45b6293312f8b275c7a68cea179f718
2015-08-12Visit class roots from ClassLoader::VisitReferences Mathieu Chartier
This causes the classes of a class loader to get marked when that class loader gets marked instead of during class root visiting. Bug: 22720414 Change-Id: If53f042aff1d9f7bf94ecbe6886601edda029b7d