diff options
author | 2016-09-13 15:11:50 +0100 | |
---|---|---|
committer | 2016-09-15 15:35:01 +0100 | |
commit | 167bc0b5275038cbe86112e1df12c8988aa6612e (patch) | |
tree | fb2080cd9686de6b926f2e5e4157c551a0405b9b /compiler/utils/arm/assembler_thumb2.h | |
parent | 8fb627442ec7330939c920076714eb120363f95e (diff) |
ARM: Try to emit branches early to save memory.
Try to emit unexpanded branches when binding a Label to
reduce the memory needed for Fixup dependencies. We use
a simple heuristic to limit the time we spend trying
but this heuristic is enough to resolve all branches in
the emitted String.equals() intrinsic.
Test: Run ART test suite on host and Nexus 6.
Test: Manually check memory usage for a certain apk.
Bug: 28603175
Change-Id: I362e07c2c1285ff609cf8df0a00b6b420729b9ce
Diffstat (limited to 'compiler/utils/arm/assembler_thumb2.h')
-rw-r--r-- | compiler/utils/arm/assembler_thumb2.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/utils/arm/assembler_thumb2.h b/compiler/utils/arm/assembler_thumb2.h index 13f3becb6d..3a07a9c8e5 100644 --- a/compiler/utils/arm/assembler_thumb2.h +++ b/compiler/utils/arm/assembler_thumb2.h @@ -573,6 +573,10 @@ class Thumb2Assembler FINAL : public ArmAssembler { return location_; } + uint32_t GetTarget() const { + return target_; + } + uint32_t GetAdjustment() const { return adjustment_; } @@ -592,6 +596,11 @@ class Thumb2Assembler FINAL : public ArmAssembler { target_ = target; } + // Branches with bound targets that are in range can be emitted early. + // However, the caller still needs to check if the branch doesn't go over + // another Fixup that's not ready to be emitted. + bool IsCandidateForEmitEarly() const; + // Check if the current size is OK for current location_, target_ and adjustment_. // If not, increase the size. Return the size increase, 0 if unchanged. // If the target if after this Fixup, also add the difference to adjustment_, |