summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2017-02-17 11:30:23 +0000
committer Vladimir Marko <vmarko@google.com> 2017-02-17 11:32:59 +0000
commit3c89d4234589816fb7dafb5215543f2cf023ce6c (patch)
treea9f6429ffd6625203bdba9c01520b6a5e64ac539
parent1fed1dc7b1ea75b0465c0b2b3457718aab5a0f34 (diff)
x86/string compression: Use TESTB instead of TESTL in String.charAt().
And fix disassembly of the now unused TESTL. Test: testrunner.py --host with string compression enabled. Test: Manual inspection of dump-oat output. Bug: 35433135 Bug: 31040547 Change-Id: I36c955bc1f2243954ecc315266a2f3fce5d87693
-rw-r--r--compiler/optimizing/code_generator_x86.cc2
-rw-r--r--compiler/optimizing/code_generator_x86_64.cc2
-rw-r--r--disassembler/disassembler_x86.cc2
3 files changed, 3 insertions, 3 deletions
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc
index 09612c8dbf..b779aed763 100644
--- a/compiler/optimizing/code_generator_x86.cc
+++ b/compiler/optimizing/code_generator_x86.cc
@@ -5262,7 +5262,7 @@ void InstructionCodeGeneratorX86::VisitArrayGet(HArrayGet* instruction) {
// Branch cases into compressed and uncompressed for each index's type.
uint32_t count_offset = mirror::String::CountOffset().Uint32Value();
NearLabel done, not_compressed;
- __ testl(Address(obj, count_offset), Immediate(1));
+ __ testb(Address(obj, count_offset), Immediate(1));
codegen_->MaybeRecordImplicitNullCheck(instruction);
static_assert(static_cast<uint32_t>(mirror::StringCompressionFlag::kCompressed) == 0u,
"Expecting 0=compressed, 1=uncompressed");
diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc
index 0879992e32..179bf6d3d1 100644
--- a/compiler/optimizing/code_generator_x86_64.cc
+++ b/compiler/optimizing/code_generator_x86_64.cc
@@ -4720,7 +4720,7 @@ void InstructionCodeGeneratorX86_64::VisitArrayGet(HArrayGet* instruction) {
// Branch cases into compressed and uncompressed for each index's type.
uint32_t count_offset = mirror::String::CountOffset().Uint32Value();
NearLabel done, not_compressed;
- __ testl(Address(obj, count_offset), Immediate(1));
+ __ testb(Address(obj, count_offset), Immediate(1));
codegen_->MaybeRecordImplicitNullCheck(instruction);
static_assert(static_cast<uint32_t>(mirror::StringCompressionFlag::kCompressed) == 0u,
"Expecting 0=compressed, 1=uncompressed");
diff --git a/disassembler/disassembler_x86.cc b/disassembler/disassembler_x86.cc
index ff05733345..a289433af5 100644
--- a/disassembler/disassembler_x86.cc
+++ b/disassembler/disassembler_x86.cc
@@ -1306,7 +1306,7 @@ DISASSEMBLER_ENTRY(cmp,
has_modrm = true;
reg_is_opcode = true;
store = true;
- immediate_bytes = ((instr[1] & 0x38) == 0) ? 1 : 0;
+ immediate_bytes = ((instr[1] & 0x38) == 0) ? (instr[0] == 0xF7 ? 4 : 1) : 0;
break;
case 0xFF:
{