summaryrefslogtreecommitdiff
path: root/compiler/optimizing
AgeCommit message (Collapse)Author
2018-08-24Merge "Fix longstanding bug around implicit NPEs and GC, version 2." Treehugger Robot
2018-08-21Merge "Reduce memory usage by other deps in scheduler." Vladimir Marko
2018-08-20Fix longstanding bug around implicit NPEs and GC, version 2. Nicolas Geoffray
The TODO has been there since M (so forever :)): https://android-review.googlesource.com/c/platform/art/+/122794/13//COMMIT_MSG#13 We hardly see the issue in our tests as we need to have: 1) A GC happening while creating the NPE object. 2) ParallelMoves between the NullCheck and implicit null check operation that moves references. The CL piggy backs on the "IsEmittedAtUseSite" flag, to set implicit null checks with it. The liveness analysis then special cases implicit null checks to record environment uses at the location of the actual instruction that will do the implicit null check. Test: test.py --gcstress Test: run-libcore-tests --gcstress bug: 111545159 Change-Id: I3ecea4fe0d7e483e93db83281ca10db47da228c5
2018-08-16Reduce memory usage by other deps in scheduler. Vladimir Marko
Rely on transitive dependencies instead of adding the full set of side effect dependencies. Compiling a certain apk, the most memory hungry method has the scheduler memory allocations in ArenaStack hidden by the register allocator: - before: MEM: used: 155744672, allocated: 168446408, lost: 12036488 Scheduler 155744672 - after: MEM: used: 5181680, allocated: 7096776, lost: 114752 SsaLiveness 4683440 RegAllocator 314312 RegAllocVldt 183928 The total arena memory used, including the ArenaAllocator not listed above, goes from 167170024 to 16607032 (-90%). (Measured with kArenaAllocatorCountAllocations=true, kArenaAllocatorPreciseTracking=false.) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 64312607 Change-Id: I825bcfb490171070c46ad6d1f460785f4e75cfd7
2018-08-15Revert^2 "ARM: Reimplement the UnsafeCASObject intrinsic." Vladimir Marko
This reverts commit f28be439b97623ebad540f7a1e3f9f1e3436b001. The regression test for the revert reason was added in https://android-review.googlesource.com/731508 . We fix the problem by introducing a specialized entrypoint for the UnsafeCASObject intrinsic introspection marking where we read the destination register from the right bits. Change-Id: I1838abe05474be009d0fd96125efebd7f6dd9c59 Test: m test-art-host-gtest Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --32 Test: ART_HEAP_POISONING=true testrunner.py --target --optimizing --32 Bug: 36141117
2018-08-14Rename art::ReadBarrier::WhiteState as art::ReadBarrier::NonGrayState. Roland Levillain
The read barrier state recorded in object's lockword used to be a three-state value (white/gray/black), which was turned into a two-state value (white/gray), where the "black" state was conceptually merged into the "white" state. This change renames the "white" state as "non-gray" and adjusts corresponding comments. Test: art/test.py Change-Id: I2a17ed15651bdbbe99270c1b81b4d78a1c2c132b
2018-08-14Merge "Document the use of the biased card table in ART's code generators." Roland Levillain
2018-08-14Merge "ARM64: Reimplement the UnsafeCASObject intrinsic." Vladimir Marko
2018-08-14ARM64: Reimplement the UnsafeCASObject intrinsic. Vladimir Marko
For the UnsafeCASObject with Baker read barriers, drop the old code updating the field. Perform the main path CAS loop and redirect the flow for failure to a slow path that marks the old value and compares it with the expected value (if not marking, this is just a few instructions to determine that they differ). If it's the same, the old value is known to be the from-space reference to the expected object and the slow path performs a modified CAS loop checking for both expected object references (from-space and to-space). Test: Already covered by the 160-read-barrier-stress. Test: m test-art-host-gtest Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --64 Test: ART_HEAP_POISONING=true testrunner.py --target --optimizing --64 Bug: 36141117 Change-Id: I175806dbc003640c9bb6759be6788311bcc9310c
2018-08-14Document the use of the biased card table in ART's code generators. Roland Levillain
Test: n/a Change-Id: Ie03a6f6dc87fd0766fc2b685ec39a0a0ebe3fb57
2018-08-14Merge "Revert "ARM: Reimplement the UnsafeCASObject intrinsic."" Treehugger Robot
2018-08-14Revert "ARM: Reimplement the UnsafeCASObject intrinsic." Vladimir Marko
This reverts commit 1bf0b7ad2fc6ba0cc51d0df2890f9f2d0b05b32b. Reason for revert: The introspection entrypoint would read the destination register from the wrong bits. Bug: 36141117 Change-Id: I67c40ba9fb5a834fc5565149269d66a716438e9b
2018-08-14Merge "ARM: Reimplement the UnsafeCASObject intrinsic." Vladimir Marko
2018-08-14ARM: Reimplement the UnsafeCASObject intrinsic. Vladimir Marko
Clean up the shared code for all the UnsafeCAS* intrinsics to avoid deprecated instructions (IT should only be followed by a single 16-bit instruction) and simplify heap poisoning code (to be more readable at the cost of performance). For the UnsafeCASObject with Baker read barriers, drop the old code updating the field. Perform the main path CAS loop and redirect the flow for failure to a slow path that marks the old value and compares it with the expected value (if not marking, this is just a few instructions to determine that they differ). If it's the same, the old value is known to be the from-space reference to the expected object and the slow path performs a modified CAS loop checking for both expected object references (from-space and to-space). Also replace all uses of vixl's EmissionCheckScope with the ExactAssemblyScope in the arm32 codegen; all these uses are related to the Baker read barrier using introspection. Test: Already covered by 160-read-barrier-stress. Test: m test-art-host-gtest Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --32 Test: ART_HEAP_POISONING=true testrunner.py --target --optimizing --32 Bug: 36141117 Change-Id: If0b77d278826eb909b437ea9a1336afec575ccdf
2018-08-10Merge "Add helper method to iterate over BitTable fields in CodeInfo." David Srbecky
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-10Merge "ARM/ARM64: Introspection Baker RB for intrinsics." Vladimir Marko
2018-08-10ARM/ARM64: Introspection Baker RB for intrinsics. Vladimir Marko
Namely Unsafe.getObject/-Volatile(). Test: Additional tests in 160-read-barrier-stress. Test: m test-art-host-gtest Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing Test: ART_HEAP_POISONING=true testrunner.py --target --optimizing Bug: 36141117 Change-Id: I7305d75ab0ae8c9621843f9a382ad3a5e0aefa0b
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-07Merge "ARM64: Introspection Baker RB for volatile fields." Vladimir Marko
2018-08-07ARM64: Introspection Baker RB for volatile fields. Vladimir Marko
Test: Already covered by 160-read-barrier-stress. Test: m test-art-host-gtest Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing --jit --64 Bug: 36141117 Change-Id: I2f9a707587d1ee27c0efb19d77becba7ec7ffec4
2018-08-07Merge "ARM/ARM64: Clean up Baker RB introspection codegen." Vladimir Marko
2018-08-06ARM/ARM64: Clean up Baker RB introspection codegen. Vladimir Marko
Remove the guard flags and remove unused code. Avoid unnecessary temporaries for JIT. This was missed in https://android-review.googlesource.com/725705 Test: m test-art-host-gtest Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing --jit Bug: 36141117 Change-Id: Ic1bdc640db3f18d7169b0e62644f190e65a98d38
2018-08-06Look at phis in ReplaceUsesDominatedBy. Nicolas Geoffray
When the instruction does not dominate the phi, but the instruction that it is replacing does by being an input, do the replacement. It was a missed improvement opportunity before, but the String.<init> handling in the builder needs it for correctness. bug: 111758226 Test: 563-checker-fakestring Change-Id: I37f01e1aabc2a1f60e21fc57728f07248adbc946
2018-08-03Merge "Add stack map fast path for GC." David Srbecky
2018-08-03Merge "Revert^2 "ARM/ARM64: Use introspection marking for JITted code."" Vladimir Marko
2018-08-03Add stack map fast path for GC. David Srbecky
Test: test-art-host-gtest-stack_map_test Change-Id: Ia04a07b560fcce2fb955d66d1924ee224dec420d
2018-08-03Merge "Simplify StackMapStream encoding." Treehugger Robot
2018-08-03Simplify StackMapStream encoding. David Srbecky
Test: test-art-host-gtest-stack_map_test Change-Id: Ife021d03e4e486043ec609f9af8673ace7bde497
2018-08-03Rename type resolution entrypoints. Vladimir Marko
Rename the InitializeType and InitializeTypeAndVerifyAccess entrypoints to Resolve* to better match their semantics. Keep the InitializeStaticStorage name for now as the most appropriate name InitializeType would clash with the old name of the ResolveType entrypoint. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Ide55b58c490d085ab37d8536f90699f7ed571d59
2018-08-03Revert^2 "ARM/ARM64: Use introspection marking for JITted code." Vladimir Marko
This reverts commit 756e722c323c69a7c9891892602730e9c94b78f9. Fix the introspection code to avoid avoid macro instructions for unpoisoning references inside ExactAssemblyScope. Change-Id: I6effadb84de74aba0236ab84b52ca85770daf5be Test: m test-art-host-gtest Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing --jit Test: ART_HEAP_POISONING=true m test-art-target-gtest Test: ART_HEAP_POISONING=true testrunner.py --target --optimizing --jit Bug: 36141117
2018-08-03Merge "Do not save/restore regs in ClinitCheck slow path." Treehugger Robot
2018-08-03Merge "Fix braino in scheduler_arm.cc" Nicolas Geoffray
2018-08-03Do not save/restore regs in ClinitCheck slow path. Vladimir Marko
The entrypoint is kSaveEverything, so the only register that needs to be saved is the argument/return value register. The size of the aosp_taimen-userdebug prebuilts: - before: arm/boot*.oat: 16811692 arm64/boot*.oat: 19801032 oat/arm64/services.odex: 20232208 - after: arm/boot*.oat: 16798804 (-12.6KiB, -0.08%) arm64/boot*.oat: 19804392 (+3.3KiB, +0.02%) oat/arm64/services.odex: 20227784 (-4.3KiB, -0.02%) Note that though there is less code, the metadata for the arm64/boot*.oat outweighs the code size reduction because of the register map encoding as value+shift introduced in https://android-review.googlesource.com/695682 which it's ill-suited for kSaveEverything entrypoints. We should reconsider that encoding. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing Change-Id: I5cd1deb90332a3b88a0a59d87925c557d9bff1ab
2018-08-03Merge "Rewrite Class init entrypoint to take a Class arg." Vladimir Marko
2018-08-02Merge "Revert "ARM/ARM64: Use introspection marking for JITted code."" Treehugger Robot
2018-08-02Revert "ARM/ARM64: Use introspection marking for JITted code." Nicolas Geoffray
This reverts commit 450f1d0fa0c40198e63c3e016f02e40ac854b0cb. Reason for revert: breaks poisoning configuration Bug: 36141117 Change-Id: I198c20ca1db6d7d7602aa5318616e2b149de8772
2018-08-02Merge "Reuse arena memory for each block in scheduler." Vladimir Marko
2018-08-02Rewrite Class init entrypoint to take a Class arg. Vladimir Marko
Fixes invalid type index being passed to the entrypoint for class init check across dex files when the target type does not have a TypeId in the compilation unit's DexFile. The size of the aosp_taimen-userdebug prebuilts: - before: arm/boot*.oat: 16782748 arm64/boot*.oat: 19764400 oat/arm64/services.odex: 20162432 - after: arm/boot*.oat: 16811692 (+28.3KiB, +0.17%) arm64/boot*.oat: 19801032 (+35.8KiB, +0.19%) oat/arm64/services.odex: 20232208 (+68.1KiB, +0.35%) This increase comes from doing two runtime calls instead of one for HLoadClass/kBssEntry that MustGenerateClinitCheck(). Test: Additional test in 476-clinit-inline-static-invoke Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --jit Test: testrunner.py --jvm Bug: 111433619 Change-Id: I2fccd6944480ab4dac514f60d38e72c1014ae7b2
2018-08-02Fix braino in scheduler_arm.cc Nicolas Geoffray
bug: 112142186 Test: m Change-Id: Ibed41bf7de2a5d968839c40450e01f6f60394e49
2018-08-02Merge "Encode frame info using varints." David Srbecky
2018-08-02Reuse arena memory for each block in scheduler. Vladimir Marko
This reduces the peak memory used for large methods with multiple blocks to schedule. Compiling the aosp_taimen-userdebug boot image, the most memory hungry method BatteryStats.dumpLocked has the Scheduler memory allocations in ArenaStack hidden by the register allocator: - before: MEM: used: 8300224, allocated: 9175040, lost: 197360 Scheduler 8300224 - after: MEM: used: 5914296, allocated: 7864320, lost: 78200 SsaLiveness 5532840 RegAllocator 144968 RegAllocVldt 236488 The total arena memory used, including the ArenaAllocator not listed above, goes from 44333648 to 41950324 (-5.4%). (Measured with kArenaAllocatorCountAllocations=true, kArenaAllocatorPreciseTracking=false.) Also remove one unnecessary -Wframe-larger-than= workaround and add one workaround for large frame with the above arena alloc tracking flags. Test: m test-art-host-gtest Test: testrunner.py --host Bug: 34053922 Change-Id: I7fd8d90dcc13b184b1e5bd0bcac072388710a129
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-02Merge "ARM/ARM64: Use introspection marking for JITted code." Treehugger Robot
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-27Remove frame info from OatQuickMethodHeader. David Srbecky
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
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-25ARM/ARM64: Use introspection marking for JITted code. Vladimir Marko
Impact on Golem benchmarks is within noise. Test: m test-art-host-gtest Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --jit Bug: 36141117 Change-Id: Idf5177ee5cd34e2034d298a7907240b3e3e12d82