summaryrefslogtreecommitdiff
path: root/runtime/stack_map.cc
AgeCommit message (Collapse)Author
2024-01-19Move files related to compiled code into oat/ directory Dmitrii Ishcheikin
Test: art/test.py -b --host Change-Id: Icedd3a82c6bca5147c3bc9dc50de5a729003d66f
2022-04-08Force inlining in `CodeInfo` constructors. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I871ec7326b55c988d78b4481974e95c53ac7a9b1
2022-03-15Revert^2 "Faster deduplication of `CodeInfo` tables." Vladimir Marko
This reverts commit 8c7f649fff75ba98392931157292f06f7930f2b6. Reason for revert: Add hwasan exclusion annotation. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: Ifc4dec165a2977a08654d7ae094fe1aa8a5bbbe5
2022-03-14Revert "Faster deduplication of `CodeInfo` tables." Roland Levillain
This reverts commit fa9c809a0b285a982b036697e4c8f1e2e0a9790e. Reason for revert: Breaks `git_master-art-host/art-asan` build/test target. Bug: 181943478 Change-Id: Ifea53e79a773b6411ebdeb981460d92247a88a6f
2022-03-10Faster deduplication of `CodeInfo` tables. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I313c54b4030aa0485109a348adefb42c1ea9ffbf
2021-11-30Add std::noboolalpha to InlineInfo dumps Santiago Aboy Solanes
std::boolalpha can persist in the stream, so we explicitly pass std::noboolalpha to avoid unintended boolalpha prints. Tests: ART tests Change-Id: I57e29c386868676bd19107cabfe6c313a15ce689
2021-11-09Inline across dex files for compiler options' non-BCP methods Santiago Aboy Solanes
We are now able to inline across dexfiles for the dexfiles present in compiler options' dex_files_for_oat_file_. Note that the dex files in the Class Loader Context are not included in this implementation since they will not have an OatDexFile. Bug: 154012332 Test: ART tests Change-Id: I7704217d936afecb66fc952c10529bb1030d6981
2021-11-01Revert^2 "Inline across dex files for bootclaspath's methods" Santiago Aboy Solanes
This reverts commit 8cb989f1019c4fa30845bf2deb5bc996ed4e8966, so we are re-enabling commit d690f8ae8f8e2675bc52089a83ac18c749f8e6d2. Reason for revert: Failing test was fixed here https://android-review.googlesource.com/c/platform/art/+/1873567 Bug: 154012332 Test: ART tests Change-Id: If159b29583e35abcfe753f30483f83990208b1b9
2021-10-29Revert "Inline across dex files for bootclaspath's methods" Santiago Aboy Solanes
This reverts commit d690f8ae8f8e2675bc52089a83ac18c749f8e6d2. Reason for revert: Test breakage related to VarHandles e.g. https://ci.chromium.org/ui/p/art/builders/ci/angler-armv7-ndebug/2409/overview Change-Id: I0d3537cd0907866c628478fad1d77aff4ee65113
2021-10-26Inline across dex files for bootclaspath's methods Santiago Aboy Solanes
We can relax a bit the restriction for not inlining across dexfiles when we are AoT compiling and we need an environment. There's an added new restriction related to BSS entries. We could potentially inline across dex files for those cases too but are left to be solved in follow-up CLs. Bug: 154012332 Test: ART tests Change-Id: I5122b26c79b3e30d2643c0ccc05d595a0047953e
2021-04-10Inline CodeInfo::DecodeCodeSize David Srbecky
Micro-optimization. This is not expected to make any difference (but it also certainly should not cause any harm to performance). Bug: 183547619 Change-Id: If1d493822f1bb49f9cf332a88b373f1d01195ca6
2021-03-10Refactor stack map printing in oatdump. David Srbecky
Separate helper class seems unnecessary. Test: m test-art-host-gtest-art_oatdump_tests Change-Id: Ic590dcfe7a177ec1d08f0710651720773bf17659
2021-03-09Move code size from OatQuickMethodHeader to CodeInfo. David Srbecky
This saves 0.5% of oat file size. (0.8% saving from this CL minus 0.3% due to go/aog/1614482) Bug: 123510633 Test: m dump-oat Test: m test-art-host-gtest Test: ./art/test.py -b -r --host Change-Id: I035b54a47b300a5808aa8c2992f87eae009fd245
2021-03-08Slightly refactor stack map stats printing. David Srbecky
Take advantage of the "operator" overload and move the pretty print method so it can be better reused. Test: m dump-oat Change-Id: I46b169e044f2c4481bb2bc277601d61f873c9950
2021-03-05Add code size to CodeInfo. David Srbecky
This is in preparation of removing it from OatQuickMethodHeader. Bug: 123510633 Test: m test-art-host-gtest Test: ./art/test.py -b -r --host Change-Id: I5c5adb4c040e329b81c1393aa1b80ee017729c8a
2020-08-28Enable -Wconversion for thread.cc Eric Holk
This should help prevent bugs due to unexpected implicit integer conversions. Some collateral changes were needed as well to limit the number of casts that had to be introduced. Bug: 165843530 Test: m test-art-host-gtests Change-Id: I091122827001ab335c7e140864f67cdf90fcf8b4
2019-06-30Stack maps: Refactor constructors. David Srbecky
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
2019-06-20Revert^2 "Stack maps: Interleave consecutive varints." David Srbecky
Reorder the layout of consecutive varints. Store all the 'headers' which define the varint size first and then store any large values. The size is unchanged, but it makes the reading from memory faster. This speeds up CodeInfo by 10%, and maps startup by 0.1%. Change in size is negligible (the bits mostly just move). This reverts commit 1b2a49b7aba39ed6663a69dfdf63d0df069f0d42. Test: test.py -b --host --64 --optimizing Change-Id: Ica7b42180ef2bae637445c0ce44fd3833ec0ecfc
2019-06-20Revert "Stack maps: Interleave consecutive varints." Raylin Hsu
This reverts commit a2b34561a7faca95d0a4f8194ad155798e238e37. Reason for revert: <INSERT REASONING HERE> Change-Id: Ie5b220e429e101bb5fa2606665a9c8cb64308ad3 Bug: 135638469
2019-06-19Stack maps: Interleave consecutive varints. David Srbecky
Reorder the layout of consecutive varints. Store all the 'headers' which define the varint size first and then store any large values. The size is unchanged, but it makes the reading from memory faster. This speeds up CodeInfo by 10%, and maps startup by 0.1%. Change in size is negligible (the bits mostly just move). Test: test.py -b --host --64 --optimizing Change-Id: I16f702389d4ba94a407b1586cae5f82b8ef60e7b
2019-06-18Stack maps: Handle special cases using flags. David Srbecky
Keep the BitTable decoder simple (1+NumColumns varints). Move special case handling up to CodeInfo (empty/dedup). This speeds up CodeInfo by 5%, and maps startup by 0.05%. Change in size is negligible (the bits mostly just move). Test: test.py -b --host --64 --optimizing Change-Id: Ib6abe52f04384de9ffd7cfba04a3124b62f713ff
2019-05-26Optimize stack maps: add fast path for no inline info. David Srbecky
Consumers of CodeInfo can skip significant chunks of work if they can quickly determine that method has no inlining. Store this fact as a flag bit at the start of code info. This changes binary format and adds <0.1% to oat size. I added the extra flag field as the simplest solution for now, although I would like to use it for more things in the future. (e.g. store the special cases of empty/deduped tables in it) This improves app startup by 0.4% (maps,speed). PMD on golem seems to gets around 15% faster. Bug: 133257467 Test: ./art/test.py -b --host --64 Change-Id: Ia498a31bafc74b51cc95b8c70cf1da4b0e3d894e
2019-05-25Optimize stack map decoding. David Srbecky
We usually read several consecutive varints. Add helper method optimized for that use case (ideally reading 8 varints from single load). This improves app startup by 0.4% (maps,speed). PMD on golem seems to get around 5% faster. CodeInfo::Decode on its own is 25% faster. Bug: 133257467 Test: ./art/test.py -b --host --64 Change-Id: Iaf7e8469ed6397b1d1d4102e409b5731f7229557
2019-03-06Revert "Revert^2 "Add code size to CodeInfo"" Nicolas Geoffray
This reverts commit e1412dacbf1d2a809bd1fca658cc8cb8f61f8ee6. Bug: 123510633 Bug: 127305289 Reason for revert: b/127305289 Change-Id: I54557b05a44777f1fa2c15bde4fa648980f42eed
2019-03-05Revert "Don't pack code size in CodeInfo." Nicolas Geoffray
This reverts commit e35ac04a1a9a22b1c4386b27f3a30cd840aa17b1. Bug: 123510633 Bug: 127305289 Reason for revert: b/127305289 Change-Id: I18c2d9291411b31641333c14c47da8c4fdf317f7
2019-02-27Don't pack code size in CodeInfo. David Srbecky
The unpacking is tricky for host tooling as we need to propagate ISA. This adds 0.05% to oat file size. Bug: 123510633 Change-Id: I5618db5e5dbe83d8a2bb89aef61cb0b10e336f40
2019-02-14Revert^2 "Add code size to CodeInfo" David Srbecky
This temporarily adds 0.25% to oat file size. The space will be reclaimed back in follow-up CL. This reverts commit 8f20a23a35fa6fbe4dcb4ff70268a24dc7fb2a24. Reason for revert: Reland as-is after CL/903819 Bug: 123510633 Test: DCHECK compare the two stored code sizes. Change-Id: Ia3ab31c208948f4996188764fcdcba13d9977d19
2019-02-12Revert "Add code size to CodeInfo" David Srbecky
This reverts commit 68efa7b1128486e08ae60cd27181645b27bbd2e4. Reason for revert: Breaks tests Change-Id: I28fb143990f58e0d5f0b106bea9d9a159f19297e
2019-02-11Add code size to CodeInfo David Srbecky
This temporarily adds 0.25% to oat file size. The space will be reclaimed back in follow-up CL. Bug: 123510633 Test: DCHECK compare the two stored code sizes. Change-Id: I15340824ca637fd075a4cef87771b06cb96bb9f4
2018-08-10Add helper method to iterate over BitTable fields in CodeInfo. David Srbecky
Avoid the repetitive code patterns and simplify code. Test: test-art-host-gtest-stack_map_test Test: checked output of oatdump Change-Id: I2354bc652837eb34efeecf4de56a027384544034
2018-08-10Move varint encoding/decoding to BitMemoryReader/Writer. David Srbecky
Test: test-art-host-gtest-bit_memory_region_test Change-Id: I0f7d7dfc9efe9df0e3e746b1741c46f06a0bd3b4
2018-08-10Cleanup BitMemoryReader/Writer api. David Srbecky
Test: test-art-host-gtest-stack_map_test Test: test-art-host-gtest-bit_table_test Change-Id: I15c624d2a70736aeb8422ce5babcef8e8fa82136
2018-08-03Add stack map fast path for GC. David Srbecky
Test: test-art-host-gtest-stack_map_test Change-Id: Ia04a07b560fcce2fb955d66d1924ee224dec420d
2018-08-02Encode frame info using varints. David Srbecky
This saves 0.3% of oat file size. Test: test-art-host-gtest-stack_map_test Change-Id: I85003946a9579f03cb1ed2b5e9b2c62b3efe6734
2018-08-01Move MethodInfo to CodeInfo. David Srbecky
There is no need to treat it specially any more, because of the de-duplication at BitTable level. This saves 0.6% of oat file size. Test: test-art-host-gtest Change-Id: Ife7927d736243879a41d6f325d49ebf6930a63f6
2018-08-01Deduplicate stackmaps at BitTable level. David Srbecky
Make it possible to share BitTables between CodeInfos. This saves 1% of .oat file size. Test: test-art-host-gtest Change-Id: I14172cba6b65e734b94f8c232f24eeee1fc67113
2018-07-26Decode only the needed tables from CodeInfo. David Srbecky
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
2018-07-13Remove unused InvokeInfo from stack maps and the runtime. David Srbecky
Test: test-art-host-gtest Change-Id: I5ce28973042f9241e72ceb52fc5db472ca571563
2018-07-04Use iterators to access stack map data. David Srbecky
Try to simplify the code using the recently added iterators. Test: test-art-host-gtest-stack_map_test Change-Id: I0b9f54df01749ee6ec3a67cfb07ba636a2489c89
2018-06-27Remove explicit size from CodeInfo. David Srbecky
It was mostly there since it was necessary to create the bound-checked MemoryRegion for loading. The new BitMemoryReader interface is much easier to tweak to avoid needing to know the size ahead of time. Keep the CHECK that the loader reads the expected number of bytes, but move it to FillInCodeInfo. This saves 0.2% of .oat file size. Test: test-art-host-gtest-stack_map_test Test: test-art-host-gtest-bit_table_test Change-Id: I92ee936e9fd004da61b90841aff9c9f2029fcfbf
2018-06-26Add method frame info to CodeInfo. David Srbecky
The stored information will be used in follow-up CLs. This temporarily increases .oat file size by 0.7%. Test: test-art-host-gtest Change-Id: Ie7d898b06398ae44287bb1e8153861ab112a216c
2018-06-22Merge "Ensure that BitTableAccessor refers to non-null table." David Srbecky
2018-06-22Ensure that BitTableAccessor refers to non-null table. David Srbecky
Hopefully this should make clang analyzer happy. Test: test-art-host-gtest-stack_map_test Change-Id: I19c9048302dd47dd262842e0b58ed139f83fa1f6
2018-06-22Implement BitMemory{Reader,Writer} David Srbecky
Two simple classes which replace the need to pass the (BitMemoryRegion, bit_offset) tuple everywhere. The slightly simplifies the code and it also makes it possible to optimize those classes in the future. Test: test-art-host-gtest-stack_map_test Test: test-art-host-gtest-bit_table_test Change-Id: I4806c805149a07e1a11b76405ca27960a0012c69
2018-06-21Binary search stack maps by native pc. David Srbecky
Test: test.py --host -r -b -t 018 -t 510 Change-Id: I07042e8dfd82adcd24fdfe1a1970a7ccdc09ce46
2018-06-14Template BitTable based on the accessors. David Srbecky
Test: test-art-host-gtest-stack_map_test Test: test-art-host-gtest-bit_table_test Change-Id: I96c04e21864009b64cb3177a0e9f0f8782a9b10b
2018-06-14Move some helper methods to DexRegisterLocation. David Srbecky
Test: test-art-host-gtest-stack_map_test Change-Id: I0abab008159db023d531df69214cd3bb8c0639bd
2018-06-13Rewrite stack map statistics printing in outdump. David Srbecky
The code was repetitive and had a tendency to get out of sync. Test: Check the output of oatdump Change-Id: Ied68a6c9add7ac234ede68d4adbc097bb8b82d6f
2018-06-07Remove unused GetDexRegisterMap arguments. David Srbecky
They are no longer needed in the new encoding. I reuse the local variables in most places to DCHECK the size of the decoded register map. This has one catch though: We sometimes omit all dex registers, so the DCHECK should be done only after checking if the map is empty (if applicable). Test: test-art-host-gtest-stack_map_test Change-Id: I94b67029842374bc8eb7c9e5eac76fc93a651f24
2018-06-07Delta-compress register maps in stack maps. David Srbecky
The register maps tend to be similar from stack map to stack map, so instead of encoding them again, store only the modified ones. The dex register bitmap stores the delta now - if register has been modified since the previous stack map, the bit will be set. The decoding logic scans backwards through stack maps until it eventfully finds the most recent value of each register. This CL saves ~2.5% of .oat file size (~10% of stackmap size). Due to the scan, this makes dex register decoding slower by factor of 2.5, but that still beats the old algorithm before refactoring. Test: test-art-host-gtest-stack_map_test Change-Id: Id5217a329eb757954e0c9447f38b05ec34118f84