summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_mips.cc
AgeCommit message (Collapse)Author
2016-12-12Merge "Add kJitTableAddress for HLoadClass."Nicolas Geoffray
2016-12-12Add kJitTableAddress for HLoadClass.Nicolas Geoffray
This new kind loads classes from the root table associated with JIT compiled code. Also remove kDexCacheAddress, which is replaced by kJitTableAddress. test: ART_TEST_JIT=true test-art-host-jit test-art-target-jit Change-Id: Ia23029688d1a60c178bf2ffa7463927c5d5de4d0
2016-12-07Merge "MIPS32: Pass more arguments in registers."Vladimir Marko
2016-12-06MIPS32: Pass more arguments in registers.Alexey Frunze
Specifically, use A0-A3,T0-T1 for non-floats and F8-F19 for floats. Test: booted MIPS32R2 in QEMU Test: test-art-target-run-test-optimizing (MIPS32R2) on CI20 Test: test-art-target-gtest (MIPS32R2) on CI20 Test: booted MIPS64 (with 2nd arch MIPS32R6) in QEMU Test: test-art-target-run-test-optimizing (MIPS32R6) in QEMU Test: test-art-target-gtest (MIPS32R6) in QEMU Test: test-art-host-gtest Change-Id: Ib8b0310a109d9f3d70119c1e605e54b013e60728
2016-12-01Class Hierarchy Analysis (CHA)Mingyao Yang
The class linker now tracks whether a method has a single implementation and if so, the JIT compiler will try to devirtualize a virtual call for the method into a direct call. If the single-implementation assumption is violated due to additional class linking, compiled code that makes the assumption is invalidated. Deoptimization is triggered for compiled code live on stack. Instead of patching return pc's on stack, a CHA guard is added which checks a hidden should_deoptimize flag for deoptimization. This approach limits the number of deoptimization points. This CL does not devirtualize abstract/interface method invocation. Slides on CHA: https://docs.google.com/a/google.com/presentation/d/1Ax6cabP1vM44aLOaJU3B26n5fTE9w5YU-1CRevIDsBc/edit?usp=sharing Change-Id: I18bf716a601b6413b46312e925a6ad9e4008efa4 Test: ART_TEST_JIT=true m test-art-host/target-run-test test-art-host-gtest
2016-11-29ART: Add dex::StringIndexAndreas Gampe
Add abstraction for uint32_t string index. Test: m test-art-host Change-Id: I917c2881702fe3df112c713f06980f2278ced7ed
2016-11-21ART: Add dex::TypeIndexAndreas Gampe
Add abstraction for uint16_t type index. Test: m test-art-host Change-Id: I47708741c7c579cbbe59ab723c1e31c5fe71f83a
2016-11-18Revert "Revert "Revert "Revert "JIT root tables.""""Nicolas Geoffray
Test: 626-set-resolved-string, test-art-host, test-art-target Test: run-libcore-tests.sh Test: phone boots and runs This reverts commit 3395fbc20bcd20948bec8958db91b304c17cacd8. Change-Id: I104b73d093e3eb6a271d564cfdb9ab09c1c8cf24
2016-11-15Pass object instead of class to instanceof entrypointMathieu Chartier
Reduces code size. Also avoid read barrier for kArrayCheck case. Bug: 32577579 Test: test-art-host, test-art-target CC Change-Id: Ia890f656fe166b2d39c522b63a8a6469404134ae
2016-11-14Revert "Revert "Revert "JIT root tables."""Nicolas Geoffray
libcore failures: dalvikvm32 F 11-14 03:04:06 14870 14870 jit_code_cache.cc:310] Check failed: new_string != nullptr This reverts commit 75afcdd3503a8a8518e5b23d21b6e73306ce39ce. Change-Id: I5a6b6b48aa79a763d1ff1ba4d85d63811254787d
2016-11-11Revert "Revert "JIT root tables.""Nicolas Geoffray
Also contains Revert "Support kJitTableAddress in x86/arm/arm64." This reverts commit 4acd03638fcdb4e5d1666f8eec7eb3bf6d6be035. This reverts commit 997d1217830c0a18b70faeabd53c04700a87d7d9. Test: ART_USE_READ_BARRIER=true/false test-art-host test-art-target Change-Id: I77cb1e9bf8f1b4c58b72d3cf5ca31ced2aaa1ea3
2016-11-10MIPS32: Add missing swaps to codegenGoran Jakovljevic
Add swaps between fp registers and stack. Also added emit_swap_mips_test. Test: mma -j2 test-art-target-run-test on CI20 Test: mma test-art-host-gtest-emit_swap_mips_test Change-Id: I38e7be6a86d9ad36a82e9d4293e9a6971b6e016a
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-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-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-01MIPS32: Fix string loads that use kDexCacheViaMethod.Alexey Frunze
This fixes some string-related crashes, in particular, failures in test 563-checker-fakestring. The bug was introduced in commit aad75c6d5bfab2dc8e30fc99fafe8cd2dc8b74d8. Test: booted MIPS32R2 in QEMU Test: test-art-target-run-test-optimizing (MIPS32R2) on CI20 Change-Id: Ie7d9a5b2c572b0933756f6e95c567968f811342c
2016-10-20MIPS32: Implement HSelectAlexey Frunze
Test: booted MIPS32R2 in QEMU Test: test-art-target-run-test-optimizing (MIPS32R2) on CI20 Test: booted MIPS64 (with 2nd arch MIPS32R6) in QEMU Test: test-art-target-run-test-optimizing (MIPS32R6) in QEMU Test: test-art-host-gtest Change-Id: I8a8127d8d29cb5df84ed6f4fd4478f8d889e5cb7
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-14Merge "MIPS32: Improve integer comparison with constants."Nicolas Geoffray
2016-10-12MIPS32: Improve integer comparison with constants.Alexey Frunze
Test: booted MIPS32 in QEMU Test: test-art-target-run-test-optimizing on CI20 Test: test-art-target-gtest on CI20 Change-Id: Icbe74099fdebc29a38055ef70d7f14eed770b0a7
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-05Merge "MIPS32: Fix GenerateVirtualCall in the presence of intrinsics"Treehugger Robot
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-10-04MIPS32: Fix GenerateVirtualCall in the presence of intrinsicsGoran Jakovljevic
Fix GenerateVirtualCall like it is done in the I0ed88a48b313a8d28bc39fae40631123aadb13ef for all other architectures. Test: mma -j2 test-art-target-run-test-optimizing on CI20 Change-Id: Ie55c62701b20c4f40badc95563b2aef9e83807de
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-19Merge "Remove the `CanTriggerGC` side-effects on a few instructions."Roland Levillain
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-15MIPS32: Improve storing of constants in fields and array elementsAlexey Frunze
Test: booted MIPS32 in QEMU Test: test-art-target-run-test-optimizing on CI20 Test: test-art-host-gtest Change-Id: Ifcf8c1e215e3768711c391e8da6f663bba71f8d9
2016-09-14Merge "MIPS32: Implement table-based packed switch"Treehugger Robot
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-14MIPS32: Implement table-based packed switchAlexey Frunze
Test: booted MIPS32R2 in QEMU Test: test-art-target-run-test-optimizing (MIPS32R2) on CI20 Test: booted MIPS64 (with 2nd arch MIPS32R6) in QEMU Test: test-art-target-run-test-optimizing (MIPS32R6) in QEMU Test: test-art-host-gtest Change-Id: I2e1a65ff1ba9406b84351ba7998f853b1ce4aef9
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-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-09MIPS32: Implement branchless HCondition for floatsAlexey Frunze
Test: booted MIPS32R2 in QEMU Test: test-art-target-run-test-optimizing (MIPS32R2) on CI20 Test: booted MIPS64 (with 2nd arch MIPS32R6) in QEMU Test: test-art-target-run-test-optimizing (MIPS32R6) in QEMU Change-Id: Iec2f301c33bf9b9a2e16759633f8489a3e0bc46b
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
2016-09-06Merge "MIPS32: Ensure preservation of RA in leaf methods if it's clobbered"Treehugger Robot
2016-09-05Merge "Avoid excessive spill slots for slow paths."Treehugger Robot
2016-09-05Avoid excessive spill slots for slow paths.Vladimir Marko
Reducing the frame size makes stack maps smaller as we need fewer bits for stack masks and some dex register locations may use short location kind rather than long. On Nexus 9, AOSP ToT, the boot.oat size reduction is prebuilt multi-part boot image: - 32-bit boot.oat: -416KiB (-0.6%) - 64-bit boot.oat: -635KiB (-0.9%) prebuilt multi-part boot image with read barrier: - 32-bit boot.oat: -483KiB (-0.7%) - 64-bit boot.oat: -703KiB (-0.9%) on-device built single boot image: - 32-bit boot.oat: -380KiB (-0.6%) - 64-bit boot.oat: -632KiB (-0.9%) on-device built single boot image with read barrier: - 32-bit boot.oat: -448KiB (-0.6%) - 64-bit boot.oat: -692KiB (-0.9%) The other benefit is that at runtime, threads may need fewer pages for their stacks, reducing overall memory usage. We defer the calculation of the maximum spill size from the main register allocator (linear scan or graph coloring) to the RegisterAllocationResolver and do it based on the live registers at slow path safepoints. The old notion of an artificial slow path safepoint interval is removed as it is no longer needed. Test: Run ART test suite on host and Nexus 9. Bug: 30212852 Change-Id: I40b3d114e278e2c5807982904fa49bf6642c6275
2016-09-05Merge changes I3f825746,Ia4284ccd,I437ffd43Nicolas Geoffray
* changes: Extend the InvokeRuntime() changes to mips64. Extend the InvokeRuntime() changes to mips. Extend the InvokeRuntime() changes to x86 and x86_64.
2016-09-02Clean up some includes.Vladimir Marko
Remove some unnecessary includes from header files, replace others with forward references and add includes to source files as needed. Reduce dependency on stack.h by pulling StackReference<> out to its own file. Test: m test-art-host Change-Id: I0fb182145e328870cbd918b0ef6ae2950223c1b2
2016-09-01MIPS32: Ensure preservation of RA in leaf methods if it's clobberedAlexey Frunze
Test: booted MIPS32 in QEMU Test: test-art-host-gtest Test: test-art-target-gtest-codegen_test in QEMU Test: test-art-target-run-test-optimizing on CI20 Change-Id: Ia3da5902d967cd7af313f03ebf414320b0063619