summaryrefslogtreecommitdiff
path: root/runtime/oat_quick_method_header.cc
Commit message (Collapse)AuthorAgeFilesLines
* Increment hotness in nterp when doing lookups.Nicolas Geoffray2020-06-261-1/+1
| | | | | | | | Test: test.py Test: google/perf/app-transition/app-transition-to-recents Bug: 112676029 Bug: 157402634 Change-Id: Ibe08720b442c5050062db1104be2d3a62641e629
* nterp: Address old x86-64 comments.Vladimir Marko2020-04-241-6/+14
| | | | | | | | | Follow-up to https://android-review.googlesource.com/1185416 , https://android-review.googlesource.com/1180627 . Test: testrunner.py --host --interpreter Change-Id: I4ee8825593cf11d673fcaf8e1172d00405cc7abc
* Introduce the notion of an nterp frame.Nicolas Geoffray2019-12-171-1/+21
| | | | | | | | | | | | | | | | See comments in nterp_helpers.cc. An nterp frame follows the calling conventions and exception handling of the compiler. There are no ManagedStack transitions, and the compiler and interpreter can just call each other directly. For the stack walker, an nterp frame looks like a compiled frame. This CL introduces an nterp frame, another CL will contain an implementation for x64. Bug: 119800099 Test: test.py Change-Id: Ie9b691f58908b7f283b4cd63b84b651526155d27
* Helpers and refactorings to prepare for interpreter optimizations (x64)Nicolas Geoffray2019-12-041-1/+2
| | | | | | | | | | | | - Add data structure offsets that will be used in assembly code. - Be explicit about a stack overflow in a fault handler. - Move assembly helper code in asm_support so interpreter can use it. - Support putting literals in InterpreterCache. - Fix artHandleFillArrayDataFromCode for x64. Bug: 119800099 Test: test.py Change-Id: I2729f87fe5d09c04ae2e7081636f0cd89ac14c21
* Stack maps: Refactor constructors.David Srbecky2019-06-301-2/+2
| | | | | | | | | | | Create dedicated static methods instead of passing flags. This creates dedicated methods for the purpose and merges constructor and decoding into single optimized method. This speeds up CodeInfo by 10%, and maps startup by 0.1%. Test: ./art/test.py -b --host Change-Id: Ic7d43e22bca0be9fb13bc2c7544ebfdf46798cfe
* Remove frame info from OatQuickMethodHeader.David Srbecky2018-07-271-11/+0
| | | | | | | | | | | The information has been moved to CodeInfo, where it is stored in much more compact way. The old CL which added the data to CodeInfo cost 0.7%. This CL saves 2.5% of .oat file size so a win overall. Test: test-art-host-gtest Change-Id: I07fcf6f2776c96218f995ba3b57a1e6ccbf5e317
* Decode only the needed tables from CodeInfo.David Srbecky2018-07-261-2/+2
| | | | | | | | | | | Most use cases need only the first two bit tables from CodeInfo. Add flag to the decode method so that only those two are loaded. We only touched the table header but that still made difference. This speeds up pmd by over 10%. Test: test-art-host-gtest Change-Id: I7740081bf18205dd69864503b5bcec7de5e1a901
* Revert^2 "Add CodeInfo to JNI methods."David Srbecky2018-07-051-4/+4
| | | | | | | | | | | | | | | It has no stack maps. We only store the frame info there. As a consequence of having CodeInfo, the JNI methods are now classified as IsOptimized(). This does not have any real effect on .oat file size. This reverts commit 564fa8a1f3e3c39793c9b146ed5f21650617dc3f. Test: test-art-host-gtest Test: test-art-target-gtest-jni_compiler_test32 Change-Id: Ic7a1949027d89ba97cfedfc8ea453f041193b6a7
* Revert "Add CodeInfo to JNI methods."David Srbecky2018-07-051-4/+4
| | | | | | | | This reverts commit 85f3934f364e1674bfd2a6813274918576acdf60. Reason for revert: breaks gtests on target Change-Id: I9f97fe4e7557027677824974568120f658bbd53a
* Add CodeInfo to JNI methods.David Srbecky2018-07-041-4/+4
| | | | | | | | | | | | It has no stack maps. We only store the frame info there. As a consequence of having CodeInfo, the JNI methods are now classified as IsOptimized(). This does not have any real effect on .oat file size. Test: test-art-host-gtest Change-Id: I8d03a3af347dc7239719bb3c39ecf84c6eaece80
* ART: Ensure OatQuickMethodHeader is trivially copyableAndreas Gampe2018-06-201-2/+0
| | | | | | | Remove empty constructor. Test: mmma art Change-Id: Ie58721299a6675797e9a525f4eb7e6df82abed50
* Rewrite stackmap encoding code.David Srbecky2018-05-211-9/+8
| | | | | | | | | | | | | | | | | Remove most of the code related to handling of bit encodings. The design is still same; the encodings are just more implicit. Most of the complexity is replaced with a single BitTable class, which is a generic purpose table of tightly bit-packed integers. It has its own header which stores the bit-encoding of columns, and that removes the need to handle the encodings explicitly. Other classes, like StackMap, are accessors into the BitTable, with named getter methods for the individual columns. This CL saves ~1% of .oat file size (~4% of stackmap size). Test: test-art-host-gtest Change-Id: I7e92683753b0cc376300e3b23d892feac3670890
* Create dex subdirectoryDavid Sehr2018-01-051-1/+1
| | | | | | | | | Move all the DexFile related source to a common subdirectory dex/ of runtime. Bug: 71361973 Test: make -j 50 test-art-host Change-Id: I59e984ed660b93e0776556308be3d653722f5223
* ART: Move kDexNoIndex to dex_file_types.hAndreas Gampe2017-09-181-2/+3
| | | | | | | | Define the constant with the types to allow lowering the dependency on DexFile. Test: m Change-Id: I3c61421db45be96d2057e01b1a7825883d8bd178
* Add method info to oat filesMathieu Chartier2017-03-161-6/+7
| | | | | | | | | | | | | | | | | | | | The method info data is stored separately from the code info to reduce oat size by improving deduplication of stack maps. To reduce code size, this moves the invoke info and inline info method indices to this table. Oat size for a large app (arm64): 77746816 -> 74023552 (-4.8%) Average oat size reduction for golem (arm64): 2% Repurposed unused SrcMapElem deduping to be for MethodInfo. TODO: Delete SrcMapElem in a follow up CL. Bug: 36124906 Test: clean-oat-host && test-art-host-run-test Change-Id: I2241362e728389030b959f42161ce817cf6e2009
* Clean up code info table layoutMathieu Chartier2017-02-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Previously: Table layout was computed multiple places like stack_map_stream, and getters. This made it difficult to add new stack map tables and made the code hard to understand. This change makes the table layout specified all inside of the code info. Updating the layout only requires changing ComputeTableOffsets. Changed the stack map inline info offset to be an index, so that it is not require the inline infos are directly after the dex register table. Oat file size for a large app: 94459576 -> 93882040 (-0.61%) Updated oatdump and fixed a bug that was incorrectly computing the register mask bytes. Bug: 34621054 Test: test-art-host Change-Id: I3a7f141e09d5a18bce2bc6c9439835244a22016e
* Compressed native PC for stack mapsMathieu Chartier2017-01-201-1/+1
| | | | | | | | | Compress native PC based on instruction alignment. This reduces the size of stack maps, boot.oat is 0.4% smaller for arm64. Test: test-art-host, test-art-target, N6P booting Change-Id: I2b70eecabda88b06fa80a85688fd992070d54278
* Remove mirror:: and ArtMethod deps in utils.{h,cc}David Sehr2016-10-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | The latest chapter in the ongoing saga of attempting to dump a DEX file without having to start a whole runtime instance. This episode finds us removing references to ArtMethod/ArtField/mirror. One aspect of this change that I would like to call out specfically is that the utils versions of the "Pretty*" functions all were written to accept nullptr as an argument. I have split these functions up as follows: 1) an instance method, such as PrettyClass that obviously requires this != nullptr. 2) a static method, that behaves the same way as the util method, but calls the instance method if p != nullptr. This requires using a full class qualifier for the static methods, which isn't exactly beautiful. I have tried to remove as many cases as possible where it was clear p != nullptr. Bug: 22322814 Test: test-art-host Change-Id: I21adee3614aa697aa580cd1b86b72d9206e1cb24
* Clean up ScopedThreadStateChange to use ObjPtrMathieu Chartier2016-09-291-1/+1
| | | | | | | | | | | | | | | Also fixed inclusion of -inl.h files in .h files by adding scoped_object_access-inl.h and scoped_fast_natvie_object_access-inl.h Changed AddLocalReference / Decode to use ObjPtr. Changed libartbenchmark to be debug to avoid linkage errors. Bug: 31113334 Test: test-art-host Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483
* Clean up OatQuickMethodHeader after Quick removal.Vladimir Marko2016-04-041-64/+17
| | | | | | | | | | | | | This reduces the size of the pre-header by 8 bytes, reducing oat file size and mmapped .text section size. The memory needed to store a CompiledMethod by dex2oat is also reduced, for 32-bit dex2oat by 8B and for 64-bit dex2oat by 16B. The aosp_flounder-userdebug 32-bit and 64-bit boot.oat are each about 1.1MiB smaller. Disable the broken StubTest.IMT, b/27991555 . Change-Id: I05fe45c28c8ffb7a0fa8b1117b969786748b1039
* Pack stack map entries on bit level to save space.David Srbecky2016-03-311-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Use only the minimum number of bits required to store stack map data. For example, if native_pc needs 5 bits and dex_pc needs 3 bits, they will share the first byte of the stack map entry. The header is changed to store bit offsets of the fields rather than byte sizes. Offsets also make it easier to access later fields without calculating sum of all previous sizes. All of the header fields are byte sized or encoded as ULEB128 instead of the previous fixed size encoding. This shrinks it by about half. It saves 3.6 MB from non-debuggable boot.oat (AOSP). It saves 3.1 MB from debuggable boot.oat (AOSP). It saves 2.8 MB (of 99.4 MB) from /system/framework/arm/ (GOOG). It saves 1.0 MB (of 27.8 MB) from /system/framework/oat/arm/ (GOOG). Field loads from stackmaps seem to get around 10% faster. (based on the time it takes to load all stackmap entries from boot.oat) Bug: 27640410 Change-Id: I8bf0996b4eb24300c1b0dfc6e9d99fe85d04a1b7
* Remove ArtCode.Nicolas Geoffray2015-10-201-0/+139
- Instead use OatQuickMethodHeader. - Various cleanups now that we don't have all those ArtMethod -> ArtCode -> OatQuickMethodHeader indirections. As a consequence of this cleanup, exception handling got a bit faster. ParserCombinators benchmark (exception intensive) on x64: (lower is better) Before: ParserCombinators(RunTime): 1062500.0 us. After: ParserCombinators(RunTime): 833000.0 us. Change-Id: Idac917b6f1b0dc254ad68fb3781cd61bccadb0f3