summaryrefslogtreecommitdiff
path: root/libdexfile
AgeCommit message (Collapse)Author
2025-03-20Move more path logic for tests to testing.cc, so it can be used without Martin Stjernholm
depending on CommonArtTest. Preparation to fix the libart-gtest dependency in art_standalone_libartpalette_tests. Due to a new #include, this necessitated fixing a bunch of `testing` namespace references that could become ambigious wrt `art::testing`. Test: m generate-boot-image Test: art/tools/buildbot-build.sh Bug: 404306250 Change-Id: Iafb3d73148125775c9c5ddbcbaef39dc61859118
2025-03-03Flag classes that have unresolved type checks. Nicolas Geoffray
This allows skipping resolving the field type when setting a field. Test: test.py Change-Id: I1945deca5fdcccca7e67297eca8765b1f2f516f3
2025-02-28Reject compact dex files on load. Martin Stjernholm
We don't want to bump the vdex version, so check all dex files inside a vdex directly when it's loaded. Test: atest art_standalone_runtime_tests art_standalone_libdexfile_tests Bug: 325430813 Bug: 399472993 Change-Id: Icf63cba35a30c609b369e80781e7de732b3a0605
2025-02-20Remove extraneous apex_available from art tests Colin Cross
The special case in Soong that was requring the workaround in b/395617594 is being removed. Bug: 395617594 Test: compare installs-${TARGET_PRODUCT}.mk Change-Id: Id6bd97f6d0faaa7f10889b3c5f65fc39f50cc1ba
2025-02-19Readability fixes and some API cleanup in art::hiddenapi::ApiList. Martin Stjernholm
- Describe the layout in dex_flags_ better and be more explicit about the differences between the Value and DomainApi parts. - Use factory functions instead of constructors with different types. - Hide several functions not used outside the class. - Add Value::kFuture for the de-facto Value for max-target-future. - Add static assertions for more invariants. - Note a strange behaviour in Combine() that is intentionally not addressed, to keep the refactoring pure. Test: atest art_standalone_runtime_tests art_hiddenapi_tests Test: m veridex Bug: 377676642 Change-Id: I52c1e45da94ffa6fb87e314fb423bb9994381465
2025-02-14verifier: Reject `filled-new-array/-range` with `[J`/`[D`. Vladimir Marko
We were not enforcing the specified requirement from https://source.android.com/docs/core/runtime/dalvik-bytecode for `filled-new-array/-range`. We now reject the descriptors `[J` and `[D` in the verifier and defer arrays of primitive types other than `[I` to the interpreter. All these cases would have previously hit a `DCHECK()` in the compiler. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Iaf91465faa8ed9599abe2504796a2d9bc5bd4678
2025-02-11FindProtoId: avoid UB on empty signature_type_idxs Ryan Prichard
Bug: http://b/395138850 Test: m art_standalone_libdexfile_tests && \ adb root && adb sync data && \ adb shell /data/nativetest64/art_standalone_libdexfile_tests/art_standalone_libdexfile_tests64 --gtest_filter='*FindProtoId*' --no_isolate Change-Id: Ie3e27c4d2e18b152f1a7a5123422d71422cbcc37
2025-02-10Add //apex_available:platform to art tests Colin Cross
Soong was accidentally allowing a corner case where modules that were not supposed to be available to the platform (due to apex_available being set to an apex and not including "//apex_available:platform") were being made available to the platform as long as no apex modules depended on them. art_test_defaults has apex_available: ["com.android.art.bug"] to work around an issue with duplicate install rules. Add "//apex_available:platform" explicitly to some art tests whose install rules are hidden when the corner case is fixed. These can be removed when b/395617594 is investigated and fixed. Bug: 394664568 Bug: 395617594 Test: compare out/soong/installs-${TARGET_PRODUCT}.mk Change-Id: If0646aa317b1033f5a7c0622fa0fbf89286b4a83
2025-02-10Use `std::string_view` for `DescriptorToDot()`, ... Vladimir Marko
... `DotToDescriptor()` and `DescriptorToName()` parameter. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 338123769 Change-Id: I9cda6e70f52ed8779fcd532a4e34515c12c40c78
2025-02-07Use `ClassAccessor::GetViewDescriptor()` more. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 338123769 Change-Id: Ib8206f037ece05374e16b8a3816520ea9bc70931
2025-02-07Remove cdex support from `ArtMethod`... Vladimir Marko
... and a few other places in `runtime/`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 325430813 Change-Id: Ied837bffed78b1fe4c4d381772b8c1933b76f6c0
2025-01-28Add alignment check for DEX's map data items Santiago Aboy Solanes
Bug: 391842969 Test: m test-art-host-gtest-art_runtime_tests64 Change-Id: I7077f79bae38e80e26d592602577b250532fcb29
2025-01-13Fail dex verification for duplicate static/instance fields. Nicolas Geoffray
Just like we ensure direct and virtual methods don't conflict, check that static and instance fields also don't conflict. Test: test.py Test: 734-duplicate-fields Change-Id: I3b959bf68a43fda573788ed848976a5fae91f8d1
2025-01-10Clean up `Instruction::CanFlowThrough()`. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Ia8fa55ca846130184759a0554dcd70b3774322dc
2025-01-07Clean up `Instruction::SizeInCodeUnitsComplexOpcode()`. Vladimir Marko
And remove code that's dead since https://android-review.googlesource.com/3436080 . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: Icadd18246bc812fe3c7589172223e632604e146a
2025-01-07verifier: Speed up `ComputeWidthsAndCountOps()`. Vladimir Marko
And avoid arithmetic overflow for `fill-array-data-payload`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I199cb2a43308854bf3c4e8e5a2d65a1a351f4bf9
2024-12-05verifier: Speed up `VerifyInstruction()`. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I63e5d5998b6088f7b803a49c261fb0ed15bde73c
2024-12-04Refactor dex `Instruction` for `constexpr`. Vladimir Marko
Allow querying opcode properties, including verification flags, at compile time. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I627c749a475ae0cc6cda28b40e0aeabf3861c6dd
2024-12-04Remove remnants of quickened opcode verification. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 170086509 Change-Id: I1865f016934158e2691116b59a5b6d462c99eccb
2024-12-03Speed up `AppendPrettyDescriptor()`. Vladimir Marko
Avoid a temporary `std::string` which may allocate memory. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I27f1ebe7d31dd3dd256b0b943b44f0ad9e581342
2024-12-02Prettify field type descriptor in `DexFile::PrettyField()`. Vladimir Marko
Align with `ArtField::PrettyField()`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I478f64b55e3b1bc7bc423aab95cfa4d3c04d32d7
2024-11-18Remove mcts-art from test_suites since they are not tagged as MTS am: c77bb270ee Tongbo Liu
Original change: https://android-review.googlesource.com/c/platform/art/+/3354721 Change-Id: I319b530f2e9fc1a11ace8edc262bbe66c6ce58f5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-18Remove mcts-art from test_suites since they are not tagged as MTS Tongbo Liu
Change-Id: Ie0404d47323ce594ab7f05b00b7f9c0b752d6379
2024-11-12Add an extra bit for intrinsics in ArtMethod Santiago Aboy Solanes
This increases the number of intrinsics from 255 to 511. Bug: 370367478 Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing Change-Id: I9104dab59b06f4fb72c44ec9e004566cc28e668f
2024-11-11Avoid `strlen()` for `ClassLinker::FindClass()`... Vladimir Marko
... and related functions in most cases. Note that the `CompilerDriver` previously resolved the `ClassLoader` and `TransactionAbortError` using the provided class loaders. We're now using the `ClassLoader` from the class roots and resolving the `TransactionAbortError` in the BCP class loader. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Bug: 338123769 Change-Id: I38e480cdcdb8bf02c958e4d0773437f5766f6be0
2024-11-08Replace test_for properties with explicit dependencies on implementations Colin Cross
As part of simplifying the apex logic in Soong, replace some of the magic dependencies on implementations vs stubs with explicit dependencies with a #impl suffix. This obsoletes the extra apex_avaiable entries required by b/183882457 and the test_for property. Bug: 372543712 Test: builds Flag: EXEMPT refactor Change-Id: Iafbccd8133729602d3c94bcc519c0933d1548da9
2024-10-31Remove dependencies on the 1-variant fallback Cole Faust
When adding a dependencies, if the variants don't match, but the dependency only has 1 variant anyways, soong will always use that variant. This makes it hard to add new variants to soong, because the 1-variant fallback stops being used and you start getting missing variant errors. Make changes to bp files such that all dependencies correctly specify the variant to use. Bug: 372091092 Flag: EXEMPT refactor Test: m nothing Change-Id: I9cc72bb9a769e0c96e3a5c1fff005f8ad8556ff2
2024-10-22Update comment in modifiers.h Santiago Aboy Solanes
kAccMiranda doesn't exist anymore (we do kAccCopied + kAccAbstract, see IsMiranda() for more info). However, the comment is still half-valid as kAccNterpEntryPointFastPathFlag conflicts in the same manner that kAccMiranda used to. Change-Id: I3f9ab175f026e60f48aa73af997ee6afaf025e0a
2024-09-27Turn kNumPackedOpcodes enum into constexpr Santiago Aboy Solanes
And do cleanups related to it. Change-Id: Ie24219984139eb9964fce1119f97b4d4e338dd55
2024-09-24Delete compact_dex_level.h. Martin Stjernholm
Test: art/tools/buildbot-build.sh Bug: 325430813 Change-Id: I3a5aa5f42c76e352239653833428ae15860a069a
2024-09-13Don't special case 0 for annotation set item Santiago Aboy Solanes
This format does not have a special case for 0 (https://source.android.com/docs/core/runtime/dex-format#off-item). This was added since there are other cases in which 0 denotes a special case for e.g. no annotations (https://source.android.com/docs/core/runtime/dex-format#set-ref-item). I manually checked other cases and they were fine: * CheckInterAnnotationSetRefList * CheckInterAnnotationsDirectoryItem * CheckInterProtoIdItem * CheckInterClassDefItem * CheckInterClassDataItem Bug: 365768956 Fixes: 365768956 Test: m test-art-host-gtest-art_runtime_tests64 Change-Id: I366a0a065253513d69118e3fc2448a056f589241
2024-09-02Typo fix: instrinsic -> intrinsic Santiago Aboy Solanes
Change-Id: I6116b792d156970cefc277d2ea6af05627917d09
2024-08-23Get Multidex checksums without opening dex files. Jiakai Zhang
This speeds up profman when processing compressed apks because it avoids extracting dex files into the memory. Bug: 358502198 Test: atest art_standalone_profman_tests Change-Id: I98f28653ac4e80f3e3c225bde370401c974199ae
2024-08-13Simplify test configs by disabling append-bitness and pushing the whole Martin Stjernholm
test directory instead. Using append-bitness with FilePusher apparently disables pushing of the whole directory. If we remove it and push the test directory instead, we won't need to append bitness since it's added implicitly (and the test directory also has arch subdirectories). Without append-bitness we can also switch to PushFilePreparer, because that flag is the only difference between them. By pushing the whole test directory it's possible to clean up several cases where it was necessary to push other files with the tests. Test configs that invoke generate-boot-image on the device aren't so easy to fix this way, because we must expand the right path to the binary inside the test directory. Hence they're kept as-is for now. #codehealth Test: atest -a art_libnativebridge_cts_tests art_standalone_artd_tests \ art_standalone_cmdline_tests art_standalone_compiler_tests \ art_standalone_dex2oat_cts_tests art_standalone_dex2oat_tests \ art_standalone_dexdump_tests art_standalone_dexlist_tests \ art_standalone_dexopt_chroot_setup_tests \ art_standalone_dexoptanalyzer_tests art_standalone_dexpreopt_tests \ art_standalone_disassembler_tests art_standalone_libartbase_tests \ art_standalone_libartpalette_tests \ art_standalone_libartservice_tests art_standalone_libarttools_tests \ art_standalone_libdexfile_external_tests \ art_standalone_libdexfile_support_tests \ art_standalone_libdexfile_tests art_standalone_libprofile_tests \ art_standalone_oatdump_tests art_standalone_odrefresh_tests \ art_standalone_profman_tests art_standalone_runtime_tests \ art_standalone_sigchain_tests libnativeloader_lazy_test \ libnativeloader_test libnativebridge-tests Change-Id: I7c524a856821a5ee2b53d53e84793bf6527b970b
2024-07-23Move FuzzerCorpusTest from art/libdexfile/dex to art/runtime Ioana-Teodora Isar
Bug: 352721437 Test: m test-art-host-gtest-art_runtime_tests64 Test: m test-art-host-gtest-art_libdexfile_tests64 Test: With chroot method run libdexfile and runtime tests on target Change-Id: Ie67bcda916a235960e6b5efc1b0128864bbe45a9
2024-07-17Add stubs to libdexfiled, to make the build system add it to Martin Stjernholm
provideNativeLibs in the debug APEX. This fixes an issue when the debug APEX com.google.art.debug is in use, typically in `eng` builds: In that case external (i.e. non-ART) users of libdexfile_support load libdexfile.so instead of the correct libdexfiled.so, leading to crashes. Test: lunch aosp_cf_x86_64_phone-trunk_staging-eng Build and boot adb shell cat /linkerconfig/ld.config.txt Verify that com_android_art.shared_libs lines list libdexfiled.so Bug: 349767294 Change-Id: I042b6126b082009346bfd576d98179857666971b
2024-06-23Ensure ART gtests are both or neither in CTS and MCTS. Roland Levillain
For now, there is no good reason to have ART gtests have a different test suite membership w.r.t. CTS and MCTS. This change adds the following test modules to ART MCTS: * `art_standalone_libdexfile_external_tests` * `odsign_e2e_tests` Also update some comments about CTS and MCTS in Blueprint files. Flag: TEST_ONLY Test: Run `m mcts-art` and check the content of `android-mcts-art.zip` Bug: 147819342 Change-Id: I6d2cb298006d1eb1a56d7c836becd2c6f3890649
2024-06-14Use C++20 `string{,_view}::{starts,ends}_with()`, part 2. Vladimir Marko
Replace uses of `android::base::{Starts,Ends}With()`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I80a0ca93f433464270989d248dd999e9366a1c17
2024-06-13Use C++20 `string{,_view}::{starts,ends}_with()`, part 1. Vladimir Marko
Remove the header file `string_view_cpp20.h` and update all source files that previously used this header file. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Iafcdfc838a97deed7fb3a37cc8afe1f7ee78306b
2024-06-11Clean up dead code in dex2oat resulting from ignoring --compact-dex-level. Martin Stjernholm
The flag has been ignored since https://r.android.com/2736873. Also clean up the associated build variable ART_DEFAULT_COMPACT_DEX_LEVEL which was only allowed to be "none". The build depedencies and dexlayout itself will be removed in later CLs. Test: art/tools/buildbot-build.sh Bug: 325430813 Change-Id: I0feae2121c11901e0676e26b5ec67c7745c6edf5
2024-05-23Fix class status check in `InitializeClassVisitor`. Vladimir Marko
And address other late comments on https://android-review.googlesource.com/2163021 . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 162110941 Change-Id: I9eb49179633f94044b2060231babd156787bbd14
2024-05-15Fix readability-redundant-string-cstr clang-tidy issues Stefano Cianciulli
Bug: 264654008 Test: m tidy-art Change-Id: Ia4540deb85d0564dbf80cae8b0b57bbf85ed0205
2024-05-14Faster `DexFile::FindTypeId()`. Vladimir Marko
Work with `std::string_view::compare()` instead of slower `CompareModifiedUtf8ToModifiedUtf8AsUtf16CodePointValues()`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 338123769 Change-Id: I4c3cc131da457c0a73f83fa2f864491eb2bc7a03
2024-05-14Add `ArtField::GetDeclaringClassDescriptor{,View}()`. Vladimir Marko
And clean up related `ArtField` and `ArtMethod` functions for dex file descriptor and name access. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 338123769 Change-Id: I3bf9c3b6135ea8e6b018ec41c93c847446918169
2024-05-13Clean up source_build Soong config variables. Martin Stjernholm
They no longer have any effect after the removal of the ART_MODULE_BUILD_FROM_SOURCE build variable (b/308188056). Test: m nothing Bug: 335854415 Change-Id: Ibe30b24defe8c63d2c0baab1ecebbf72cd970f74
2024-05-13Clean up descriptor and member name comparisons. Vladimir Marko
Add helper functions for these comparisons to keep comments related to ordering in one place. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I510a1cbbb46a22ddbd39d0530198cd004b476a8d
2024-04-23Set test ownerships for ART. Martin Stjernholm
Test: presubmits Bug: 333696887 Change-Id: Ieb6992ecb0a2489697ffa176dabc25626050cd48
2024-04-12Fix standalone tests to only link NDK and module exported libraries Martin Stjernholm
dynamically. libc++ is left out for now, due to problems using `stl: "libc++_static"` in some tests (b/333438055). Introduce a defaults for statically linking libunwindstack, to fix its dependencies in one place. Test: mmm art libnativehelper libcore find out/target/product/vsoc_x86_64/testcases/ -type f -regex '.*\(_standalone_\|libnativebridge\(_cts\|-lazy\)\|libnativeloader\).*_tests?\(32\|64\)?' | xargs readelf -d | grep 'File:\|NEEDED' | grep -v 'lib\(c\|m\|dl\|dl_android\|z\|log\|binder_ndk\|selinux\|nativeloader\|nativehelper\|nativebridge\|dexfile\|statspull\|statssocket\).so\|heapprofd_client_api.so' Check that no NEEDED dependencies are reported. Test: atest art_libnativebridge_cts_tests art_standalone_artd_tests art_standalone_cmdline_tests art_standalone_compiler_tests art_standalone_dex2oat_cts_tests art_standalone_dex2oat_tests art_standalone_dexdump_tests art_standalone_dexlist_tests art_standalone_dexopt_chroot_setup_tests art_standalone_dexoptanalyzer_tests art_standalone_dexpreopt_tests art_standalone_disassembler_tests art_standalone_libartbase_tests art_standalone_libartpalette_tests art_standalone_libartservice_tests art_standalone_libarttools_tests art_standalone_libdexfile_external_tests art_standalone_libdexfile_support_tests art_standalone_libdexfile_tests art_standalone_libprofile_tests art_standalone_oatdump_tests art_standalone_odrefresh_tests art_standalone_profman_tests art_standalone_runtime_tests art_standalone_sigchain_tests libnativeloader_lazy_test libnativeloader_test Bug: 247108425 Change-Id: I082bc88d8605b58981f43ba0677068de2ca3abea
2024-04-11Clean up string data access in `DexFile`. Vladimir Marko
The `*ByIdx()` and `*ByTypeIdx()` functions were doing validity checks that were needed only for processing the debug data, so move the checks to these callers. Replace these functions with new overloads of other functions to provide consistent naming. In a few cases, rewrite calls to these functions to fetch and work with a `string_view` instead. Rename `GetStringLength()` to `GetStringUtf16Length()` and change its return type to `uint32_t`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I561899606f6e5ec5f23aa4be617349dacdb376e3
2024-04-09Change `TypeLookupTable` to use `std::string_view`. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I7dc4725de0d6e866251c211d11e016fbe621725a