diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-24 18:10:46 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-25 12:23:40 +0100 |
commit | 3c04974a90b0e03f4b509010bff49f0b2a3da57f (patch) | |
tree | 52649104e3e80272c3774793350f4d9f260ae732 /compiler/utils | |
parent | c0d36abb12cdbb9469039c1dc153a586bd984015 (diff) | |
download | art-3c04974a90b0e03f4b509010bff49f0b2a3da57f.zip art-3c04974a90b0e03f4b509010bff49f0b2a3da57f.tar.gz art-3c04974a90b0e03f4b509010bff49f0b2a3da57f.tar.bz2 |
Optimize suspend checks in optimizing compiler.
- Remove the ones added during graph build (they were added
for the baseline code generator).
- Emit them at loop back edges after phi moves, so that the test
can directly jump to the loop header.
- Fix x86 and x86_64 suspend check by using cmpw instead of cmpl.
Change-Id: I6fad5795a55705d86c9e1cb85bf5d63dadfafa2a
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/x86/assembler_x86.cc | 8 | ||||
-rw-r--r-- | compiler/utils/x86/assembler_x86.h | 2 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64.cc | 8 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64.h | 2 |
4 files changed, 20 insertions, 0 deletions
diff --git a/compiler/utils/x86/assembler_x86.cc b/compiler/utils/x86/assembler_x86.cc index 2c9bc28..f888d46 100644 --- a/compiler/utils/x86/assembler_x86.cc +++ b/compiler/utils/x86/assembler_x86.cc @@ -746,6 +746,7 @@ void X86Assembler::xchgl(Register dst, Register src) { EmitRegisterOperand(dst, src); } + void X86Assembler::xchgl(Register reg, const Address& address) { AssemblerBuffer::EnsureCapacity ensured(&buffer_); EmitUint8(0x87); @@ -753,6 +754,13 @@ void X86Assembler::xchgl(Register reg, const Address& address) { } +void X86Assembler::cmpw(const Address& address, const Immediate& imm) { + AssemblerBuffer::EnsureCapacity ensured(&buffer_); + EmitUint8(0x66); + EmitComplex(7, address, imm); +} + + void X86Assembler::cmpl(Register reg, const Immediate& imm) { AssemblerBuffer::EnsureCapacity ensured(&buffer_); EmitComplex(7, Operand(reg), imm); diff --git a/compiler/utils/x86/assembler_x86.h b/compiler/utils/x86/assembler_x86.h index 5c4e34f..ec983d9 100644 --- a/compiler/utils/x86/assembler_x86.h +++ b/compiler/utils/x86/assembler_x86.h @@ -337,6 +337,8 @@ class X86Assembler FINAL : public Assembler { void xchgl(Register dst, Register src); void xchgl(Register reg, const Address& address); + void cmpw(const Address& address, const Immediate& imm); + void cmpl(Register reg, const Immediate& imm); void cmpl(Register reg0, Register reg1); void cmpl(Register reg, const Address& address); diff --git a/compiler/utils/x86_64/assembler_x86_64.cc b/compiler/utils/x86_64/assembler_x86_64.cc index 1e2884a..a47e968 100644 --- a/compiler/utils/x86_64/assembler_x86_64.cc +++ b/compiler/utils/x86_64/assembler_x86_64.cc @@ -839,6 +839,14 @@ void X86_64Assembler::xchgl(CpuRegister reg, const Address& address) { } +void X86_64Assembler::cmpw(const Address& address, const Immediate& imm) { + AssemblerBuffer::EnsureCapacity ensured(&buffer_); + EmitOptionalRex32(address); + EmitUint8(0x66); + EmitComplex(7, address, imm); +} + + void X86_64Assembler::cmpl(CpuRegister reg, const Immediate& imm) { AssemblerBuffer::EnsureCapacity ensured(&buffer_); EmitOptionalRex32(reg); diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h index 763dafe..1fd65c2 100644 --- a/compiler/utils/x86_64/assembler_x86_64.h +++ b/compiler/utils/x86_64/assembler_x86_64.h @@ -378,6 +378,8 @@ class X86_64Assembler FINAL : public Assembler { void xchgq(CpuRegister dst, CpuRegister src); void xchgl(CpuRegister reg, const Address& address); + void cmpw(const Address& address, const Immediate& imm); + void cmpl(CpuRegister reg, const Immediate& imm); void cmpl(CpuRegister reg0, CpuRegister reg1); void cmpl(CpuRegister reg, const Address& address); |