From 0576575d075e97a227010b4adf74ad5c8a920bde Mon Sep 17 00:00:00 2001 From: jessicahandojo Date: Fri, 9 Sep 2016 19:01:32 -0700 Subject: String Compression for ARM and ARM64 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 --- compiler/optimizing/instruction_simplifier_arm.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'compiler/optimizing/instruction_simplifier_arm.cc') diff --git a/compiler/optimizing/instruction_simplifier_arm.cc b/compiler/optimizing/instruction_simplifier_arm.cc index 495f3fd232..56e4c7a9c2 100644 --- a/compiler/optimizing/instruction_simplifier_arm.cc +++ b/compiler/optimizing/instruction_simplifier_arm.cc @@ -44,6 +44,14 @@ void InstructionSimplifierArmVisitor::VisitArrayGet(HArrayGet* instruction) { size_t data_offset = CodeGenerator::GetArrayDataOffset(instruction); Primitive::Type type = instruction->GetType(); + // TODO: Implement reading (length + compression) for String compression feature from + // negative offset (count_offset - data_offset). Thumb2Assembler does not support T4 + // encoding of "LDR (immediate)" at the moment. + // Don't move array pointer if it is charAt because we need to take the count first. + if (mirror::kUseStringCompression && instruction->IsStringCharAt()) { + return; + } + if (type == Primitive::kPrimLong || type == Primitive::kPrimFloat || type == Primitive::kPrimDouble) { -- cgit v1.2.3-59-g8ed1b