summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_arm.cc
AgeCommit message (Collapse)Author
2016-11-09Avoid read barriers for inlined check castMathieu Chartier
Avoiding read barriers improves speed and reduces code size. Doing this can never result in false positives, only false negatives. These false negatives are handled correcly by rechecking in the entrypoint. Ritzperf code size for CC: arm32: 13439400->13300136 (-1.04%) arm64: 16405120->16253568 (-0.92%) Perf: TODO Bug: 29516974 Bug: 12687968 Test: test-art-host, run ritzperf both with CC Change-Id: Ie024e0b1e8ee415781fb73e8029e87e8a5318f86
2016-11-09Merge "Add interface check cast fast path to arm, arm64, x86"Mathieu Chartier
2016-11-09Add interface check cast fast path to arm, arm64, x86Mathieu Chartier
Bug: 12687968 Bug: 32577579 Test: test-art-host, test-art-target CC Change-Id: Ia57099d499fa704803cc5f0135f0f53fefe39826
2016-11-09Merge "Revert "JIT root tables.""Nicolas Geoffray
2016-11-09Revert "JIT root tables."Nicolas Geoffray
May be the offender for jit-gcstress failure of 902. This reverts commit ac3ebc3150760425ed00abd56da48f9a6e0666bc. Change-Id: I9ea6c9236fd1729fed7d1868dd8a111172932308
2016-11-09Merge "Revert "Support kJitTableAddress in x86/arm/arm64.""Nicolas Geoffray
2016-11-09Revert "Support kJitTableAddress in x86/arm/arm64."Nicolas Geoffray
Revert this in order to revert https://android-review.googlesource.com/#/c/285781/ This reverts commit 997d1217830c0a18b70faeabd53c04700a87d7d9. Change-Id: I1888fba1c6f712cae4aec4ea4719b74a46da156c
2016-11-09Merge "Support kJitTableAddress in x86/arm/arm64."Nicolas Geoffray
2016-11-09Support kJitTableAddress in x86/arm/arm64.Nicolas Geoffray
test: test-art-host test-art-target, angler boots and runs. Change-Id: I3654ae2809d4d759db76ee1ada1c17f3a9c3b392
2016-11-09Fix 552-checker-sharpening for PIC test.Vladimir Marko
And remove obsolete HLoadString::LoadKind::kDexCacheAddress. Test: m ART_TEST_PIC_TEST=true test-art-host Change-Id: I3e7a1a98c2c7eba5ea10954d7efcf743a807c300
2016-11-09Change string compression encoding.Vladimir Marko
Encode the string compression flag as the least significant bit of the "count" field, with 0 meaning compressed and 1 meaning uncompressed. The main vdex file is a tiny bit larger (+28B for prebuilt boot images, +32 for on-device built images) and the oat file sizes change. Measured on Nexus 9, AOSP ToT, these changes are insignificant when string compression is disabled (-200B for the 32-bit boot*.oat for prebuilt boot image, -4KiB when built on the device attributable to rounding, -16B for 64-bit boot*.oat for prebuilt boot image, no change when built on device) but with string compression enabled we get significant differences: prebuilt multi-part boot image: - 32-bit boot*.oat: -28KiB - 64-bit boot*.oat: -24KiB on-device built single boot image: - 32-bit boot.oat: -32KiB - 64-bit boot.oat: -28KiB The boot image oat file overhead for string compression: prebuilt multi-part boot image: - 32-bit boot*.oat: before: ~80KiB after: ~52KiB - 64-bit boot*.oat: before: ~116KiB after: ~92KiB on-device built single boot image: - 32-bit boot.oat: before: 92KiB after: 60KiB - 64-bit boot.oat: before: 116KiB after: 92KiB The differences in the SplitStringBenchmark seem to be lost in the noise. Test: Run ART test suite on host and Nexus 9 with Optimizing. Test: Run ART test suite on host and Nexus 9 with interpreter. Test: All of the above with string compression enabled. Bug: 31040547 Change-Id: I7570c2b700f1a31004a2d3c18b1cc30046d35a74
2016-11-09Merge "JIT root tables."Nicolas Geoffray
2016-11-08Change check cast entrypoint to check instance ofMathieu Chartier
Reduces code size since we do not need to reload class before calling slow path. TODO: Delete read barriers in the check cast code since the slow path will retry with the proper read barriers if the check fails. Bug: 12687968 Bug: 29516974 Test: test-art-host + test-art-target with CC Change-Id: Ia4eb9bbe3fe2d2016e44523cf0451210828d7b88
2016-11-08JIT root tables.Nicolas Geoffray
Implement root tables for the JIT. Each JIT compiled method gets a table allocated before the stack maps. The table gets visited through Runtime::SweepSystemWeaks. Implement String roots for x86_64 as an example. Test: test-art-host test-art-target Change-Id: Id3d5bc67479e08b52dd4b253e970201203a0f0d2
2016-11-04Revert "Revert "Enable IntermediateAddress for primitive arrays with read ↵Roland Levillain
barriers."" This reverts commit 4a3aa578eff94eb10450fae1772deb7cb8ddc6a6. The failing assertion (see b/30762467): 08-09 11:32:46.767 1654 1656 F dex2oatd: art/compiler/optimizing/register_allocation_resolver.cc:325] Check failed: interval->GetDefinedBy()->IsActualObject() IntermediateAddress@InstanceFieldGet that motivated the initial revert has been removed by a previous CL (commit 70e97462116a47ef2e582ea29a037847debcc029, https://android-review.googlesource.com/#/c/254920/). Test: ART host and target (ARM, ARM64) tests with `ART_USE_READ_BARRIER=true`. Bug: 26601270 Bug: 12687968 Change-Id: I09cae0c6c38ca403924153e9f0eb0cc3ff4540e7
2016-11-02Clean up the runtime read barrier and fix fake address dependency.Hiroshi Yamauchi
- Rename GetReadBarrierPointer to GetReadBarrierState. - Change its return type to uint32_t. - Fix the runtime fake address dependency for arm/arm64 using inline asm. - Drop ReadBarrier::black_ptr_ and some brooks code. Bug: 12687968 Test: test-art with CC, Ritz EAAC, libartd boot on N9. Change-Id: I595970db825db5be2e98ee1fcbd7696d5501af55
2016-10-28Merge "Remove default argument values in GenerateGcRootFieldLoad."Roland Levillain
2016-10-27Remove default argument values in GenerateGcRootFieldLoad.Roland Levillain
These values were never or rarely used. Test: mmma art (with and without `ART_USE_READ_BARRIER=true`) Bug: 12687968 Bug: 29516974 Change-Id: I5d15140ce501bf50d7a87871b1e492cee54913db
2016-10-27Use CLREX in ARM/ARM64 CAS intrinsic Baker read barrier slow paths.Roland Levillain
Follow clang's implementation, which uses CLREX in compare-and-exchange operations on the failure path, i.e. when the value read by the LDREX (ARM) or LDXR (ARM64) instruction is not the expected value, in order to release the monitor. The previous implementation was perfectly correct, but this one may improve performance on some micro-architectures. This change only affects the art::arm::ReadBarrierMarkAndUpdateFieldSlowPathARM and art::arm64::ReadBarrierMarkAndUpdateFieldSlowPathARM64 slow paths. Test: make test-art-target-run-test-004-UnsafeTest Bug: 29516905 Bug: 12687968 Change-Id: I99edd1ae6489dcec4a0089bfef52736114c6cd48
2016-10-26Add support for Baker read barriers in UnsafeCASObject intrinsics.Roland Levillain
Prior to doing the compare-and-swap operation, ensure the expected reference stored in the holding object's field is in the to-space by loading it, emitting a read barrier and updating that field with a strong compare-and-set operation with relaxed memory synchronization ordering (if needed). Test: ART host and target tests and Nexus 5X boot test with Baker read barriers. Bug: 29516905 Bug: 12687968 Change-Id: I480f6a9b59547f11d0a04777406b9bfeb905bfd2
2016-10-20Merge "ARM: VIXL32: Pass initial ART tests with new code generator."Roland Levillain
2016-10-20Merge "Change pResolveString entrypoint to kSaveEverything."Vladimir Marko
2016-10-19Change pResolveString entrypoint to kSaveEverything.Vladimir Marko
Test: Run ART test suite including gcstress on host and Nexus 9. Test: Run ART test suite including gcstress with baker CC on host and Nexus 9. Bug: 20323084 Change-Id: I63c21a7d3be8ff7a5765b5003c85b5317635efe6
2016-10-18Delete unused blocked_register_pairs_ in code generatorsMathieu Chartier
Legacy code for compatibility with quick? Test: test-art-host CC Change-Id: I9de261daea67dfd9bd3df89826ba9d10f135e29e
2016-10-17ARM: VIXL32: Pass initial ART tests with new code generator.Scott Wakeling
- Implement enough codegen to pass ~70 art/tests. - When ART_USE_VIXL_ARM_BACKEND is defined: - Blacklist known-to-fail target tests - interpret-only everything except the tests themselves - Set a flag to use the VIXL based ARM backend Test: export ART_USE_VIXL_ARM_BACKEND=true && mma test-art-target && mma test-art-host Change-Id: Ic8bc095e8449f10f97fa0511284790f36c20e276
2016-10-12Update HInstruction::NeedsCurrentMethod.Nicolas Geoffray
HLoadString and HLoadClass when sharpened may not need it anymore. Instead just rely on the HCurrentMethod being the SSA dependency of those instructions. Also save storing the current method in the stack if the graph actually doesn't need it. test: m test-art-host test-art-target Change-Id: I235d8275230637cbbd38fc0d2f9b822f6d2a9c1e
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-09-30Merge "String Compression for ARM and ARM64"Jeff Hao
2016-09-30String Compression for ARM and ARM64jessicahandojo
Changes on intrinsics and Code Generation on ARM and ARM64 for string compression feature. Currently the feature is off. The size of boot.oat and boot.art for ARM before and after the changes (feature OFF) are still. When the feature ON, boot.oat increased by 0.60% and boot.art decreased by 9.38%. Meanwhile for ARM64, size of boot.oat and boot.art before and after changes (feature OFF) are still. When the feature ON, boot.oat increased by 0.48% and boot.art decreased by 6.58%. Turn feature on: runtime/mirror/string.h (kUseStringCompression = true) runtime/asm_support.h (STRING_COMPRESSION_FEATURE 1) Test: m -j31 test-art-target All tests passed both when the mirror::kUseStringCompression is ON and OFF. Bug: 31040547 Change-Id: I24e86b99391df33ba27df747779b648c5a820649
2016-09-30Revert "Store resolved Strings for AOT code in .bss."Vladimir Marko
There are some issues with oat_test64 on host and aosp_mips-eng. Also reverts "compiler_driver: Fix build." Bug: 20323084 Bug: 30627598 This reverts commit 63dccbbefef3014c99c22748d18befcc7bcb3b41. This reverts commit 04a44135ace10123f059373691594ae0f270a8a4. Change-Id: I568ba3e58cf103987fdd63c8a21521010a9f27c4
2016-09-29Store resolved Strings for AOT code in .bss.Vladimir Marko
And do some related refactorings. Bug: 20323084 Bug: 30627598 Test: Run ART test suite including gcstress on host and Nexus 9. Test: Run ART test suite including gcstress with baker CC on host and Nexus 9. Test: Build aosp_mips64-eng. Change-Id: I1b12c1570fee8e5da490b47f231050142afcbd1e
2016-09-27Cleanup String.<init> handling.Nicolas Geoffray
Move everything to one place (currently well_known_classes.cc, but no strong preference) and define a macro to easily handle the list of affected methods. test: m test-art-host test: m test-art-target Change-Id: Ib8372d130d5458516a1f1ae31014afc76037fc34
2016-09-23Clean-up sharpening and compiler driver.Nicolas Geoffray
Remove dependency on compiler driver for sharpening and dex2dex (the methods called on the compiler driver were doing unnecessary work), and remove the now unused methods in compiler driver. Also remove test that is now invalid, as sharpening always succeeds. test: m test-art-host m test-art-target Change-Id: I54e91c6839bd5b0b86182f2f43ba5d2c112ef908
2016-09-20Change remaining slow path throw entrypoints to save everything.Vladimir Marko
Change DivZeroCheck, BoundsCheck and explicit NullCheck slow path entrypoints to conform to kSaveEverything. On Nexus 9, AOSP ToT, the boot.oat size reduction is prebuilt multi-part boot image: - 32-bit boot.oat: -12KiB (-0.04%) - 64-bit boot.oat: -24KiB (-0.06%) on-device built single boot image: - 32-bit boot.oat: -8KiB (-0.03%) - 64-bit boot.oat: -16KiB (-0.04%) Test: Run ART test suite including gcstress on host and Nexus 9. Test: Manually disable implicit null checks and test as above. Change-Id: If82a8082ea9ae571c5d03b5e545e67fcefafb163
2016-09-20ARM: Use vstm/vldm for live floating point registers save/restore in ↵Artem Serov
SlowPathCode. Test: m test-art-target; m test-art-host Change-Id: Id22271c572bb698728444bef90d5c7487ab84b1a
2016-09-20Merge "ARM: Use stm/ldm for live registers save/restore in SlowPathCode."Treehugger Robot
2016-09-19ARM: Use stm/ldm for live registers save/restore in SlowPathCode.Artem Serov
In case when there is more than 4 register to save/restore in the SlowPathCode stm/ldm can save some code size. Test: m test-art-target; m test-art-host Change-Id: I2d5b44bab58b67207105302cd7d8ee3300b9040a
2016-09-19Remove the `CanTriggerGC` side-effects on a few instructions.Alexandre Rames
The side-effect was specified for these instructions as they call runtime. We now have a list of entrypoints that we know cannot trigger GC. We can avoid requiring the side-effect for those. Test: Run ART test suite on Nexus 5X and host. Change-Id: I0e0e6a4d701ce6c75aff486cb0d1bc7fe2e8dda4
2016-09-14Revert "Revert "Use implicit null checks inside try blocks.""Vladimir Marko
Fix implicit checks in try blocks to emit stack maps. Fix arm64 null expection from signal entrypoint to call the runtime handler instead or simply jumping there. On Nexus 9, AOSP ToT, the boot.oat size reduction is prebuilt multi-part boot image: - 32-bit boot.oat: -448KiB (-1.3%) - 64-bit boot.oat: -528KiB (-1.2%) on-device built single boot image: - 32-bit boot.oat: -448KiB (-1.4%) - 64-bit boot.oat: -528KiB (-1.3%) Note that the oat files no longer contain dex files which have been moved to vdex, so the percentages are not directly comparable with the those reported in the original commit. Test: Run ART test suite including gc-stress on host and Nexus 9. Bug: 30212852 Bug: 31468464 This reverts commit 0719b5b9b458cb3eb9f0823f0dacdfe1a71214dd. Change-Id: If8a9da8c11adf2aad203e93b6684ce16ed776285
2016-09-12Merge "Revert "Use implicit null checks inside try blocks.""Nicolas Geoffray
2016-09-12Revert "Use implicit null checks inside try blocks."Nicolas Geoffray
Fails gcstress tests. This reverts commit 7aa7560683626c7893011271c241b3265ded1dc3. Change-Id: I4f5c89048b9ffddbafa02f3001e329ff87058ca2
2016-09-12Remove custom CheckCast slow path caller saves for Baker CC.Vladimir Marko
For Baker CC, CheckCast has both a read-barrier marking slow path and a pCheckCast slow path. When the latter is known to leave the method, i.e. known to throw outside a try-block, we do not need to save live registers for retrieval for the exception delivery and since the read-barrier marking does not need to save any registers either we were setting the custom slow path caller saves to empty to avoid reserving unnecessary spill space. Hovewer, this also leads to marking live references in caller-save registers in the register mask and while the read-barrier marking entrypoint doesn't care, it causes a stack walk for the pCheckCast to try and retrieve an unsaved register. For the time being, revert to the default caller saves. This is a partial revert of https://android-review.googlesource.com/254920 Test: Run ART test suite on host and Nexus 9. Bug: 29231980 Bug: 30212852 Change-Id: I4e22125f3d8903c97506aa2e6e66bea8e8e6baef
2016-09-12Merge "Use implicit null checks inside try blocks."Treehugger Robot
2016-09-12Use implicit null checks inside try blocks.Vladimir Marko
Make implicit null check entrypoint save all registers, use platform-specific approach to still pass the fault address. Allow implicit null checks in try blocks. On Nexus 9, AOSP ToT, the boot.oat size reduction is prebuilt multi-part boot image: - 32-bit boot.oat: -452KiB (-0.7%) - 64-bit boot.oat: -482KiB (-0.7%) on-device built single boot image: - 32-bit boot.oat: -444KiB (-0.7%) - 64-bit boot.oat: -488KiB (-0.7%) Test: Run ART test suite on host and Nexus 9. Test: Build aosp_mips64-eng. Change-Id: I279f3ab57e2e2f338131c5cac45c51b673bdca19
2016-09-09Re-enable boot image direct string loads for read barriersMathieu Chartier
Boot.oat code size with CC baker: ARM32: 70775656 -> 69817028 (-1.35%) ARM64: 80819424 -> 79417072 (-1.74%) X86 unmeasured. X86_64 unmeasured. Performance unmeasured, should be faster. Bug: 29516974 Test: test-art-host CC baker, N6P booting CC baker Change-Id: I219faaca9ed17af81d2815fb5e124120f307af83
2016-09-08Merge "Do type checks in ArraySet without read barriers."Roland Levillain
2016-09-07ART: Generate path to entrypoints in VisitLoadString for armChristina Wadsworth
ARM32 boot.oat with CC: 72534816 -> 71888864 (-0.9%) Move code that branches to entrypoints from GenerateSlowPaths to VisitLoadString. Since we're doing this every time, we shouldn't have it at the end with all of the slow paths. Test: N6P booting with CC, test-art-target32 on shamu Change-Id: I9c3307629015c9f6460506519339d4f275abe5a9
2016-09-07Avoid read barrier for image HLoadClassMathieu Chartier
Concurrent copying baker: X86_64 core-optimizing-pic.oat: 28583112 -> 27906824 (2.4% smaller) Around 0.4% of 2.4% is from re-enabling kBootImageLinkTimeAddress, kBootImageLinkTimePcRelative, and kBootImageAddress. N6P boot.oat 32: 73042140 -> 71891956 (1.57% smaller) N6P boot.oat 64: 83831608 -> 82531456 (1.55% smaller) EAAC: 1252 -> 1245 (32 samples) Bug: 29516974 Test: test-art-host CC baker, N6P booting Change-Id: I9a196cf0157058836981c43c93872e9f0c4919aa
2016-09-07Do type checks in ArraySet without read barriers.Roland Levillain
This approach is valid in the case of Baker and non-Baker read barriers. Benchmarks (ARM64) score variations on Nexus 5X with CPU cores clamped at 960000 Hz (aosp_bullhead-userdebug build, medians of 10 runs for each suite): - Ritzperf - average (lower is better): -0.44% (virtually unchanged) - CaffeineMark - average (higher is better): -0.20% (virtually unchanged) - DeltaBlue (lower is better): -4.08% (slightly better) - Richards - average (lower is better): -0.57% (virtually unchanged) - SciMark2 - average (higher is better): -0.52% (virtually unchanged) Details about Ritzperf benchmarks with meaningful variations (lower is better): - GenericCalcActions.MemAllocTest: +3.02% (slightly worse) Details about Richards benchmarks with meaningful variations (lower is better): - gibbons -5.01% (better) Boot image code size variation on Nexus 5X (aosp_bullhead-userdebug build): - total ARM64 framework Oat files size change: 83127840 bytes -> 83082656 bytes (-45184 bytes, -0.05%) - total ARM framework Oat files size change: 72571872 bytes -> 72522796 bytes (-49076 bytes, -0.07%) Test: ART_USE_READ_BARRIER=true ART_HEAP_POISONING=true m test-art-host Test: ART_USE_READ_BARRIER=true ART_HEAP_POISONING=true m test-art-target Bug: 29516974 Bug: 12687968 Change-Id: I8fe130156ace87dd2e4a15d9f8b4111287e735b3
2016-09-06Change deoptimize entrypoint to save everything.Vladimir Marko
And implement FPU register retrieval from stack on x86. On Nexus 9, AOSP ToT, the boot.oat size reduction is prebuilt multi-part boot image: - 32-bit boot.oat: -20KiB (-0.03%) - 64-bit boot.oat: -45KiB (-0.06%) on-device built single boot image: - 32-bit boot.oat: -24KiB (-0.04%) - 64-bit boot.oat: -36KiB (-0.05%) Test: Run ART test suite on host and Nexus 9. Bug: 30212852 Change-Id: I5d98e2a24363136d73dfec6100ab02f8eb101911