diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index 0fc98a6ac10..99b49d360bf 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -6249,6 +6249,13 @@ void Assembler::subss(XMMRegister dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::btl(Register dst, int imm8) { + int encode = prefix_and_encode(dst->encoding()); + emit_int16(0x0F, (unsigned char)0xBA); + emit_int8(modrm_encoding(0x3, rsp->encoding() /* /4 */ , encode)); + emit_int8(imm8); +} + void Assembler::testb(Register dst, int imm8, bool use_ral) { NOT_LP64(assert(dst->has_byte_register(), "must have byte register")); if (dst == rax) { diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index c6083d844aa..6a67638c0b3 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -1730,6 +1730,7 @@ class Assembler : public AbstractAssembler { void btsq(Address dst, int imm8); void btrq(Address dst, int imm8); #endif + void btl(Register dst, int imm8); void orw(Register dst, Register src); diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index 8de61d4f4b1..58a502f3d43 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -3002,26 +3002,20 @@ void MacroAssembler::test_klass_is_empty_inline_type(Register klass, Register te void MacroAssembler::test_field_is_null_free_inline_type(Register flags, Register temp_reg, Label& is_null_free_inline_type) { movl(temp_reg, flags); - shrl(temp_reg, ResolvedFieldEntry::is_null_free_inline_type_shift); - andl(temp_reg, 0x1); - testl(temp_reg, temp_reg); - jcc(Assembler::notZero, is_null_free_inline_type); + btl(temp_reg, ResolvedFieldEntry::is_null_free_inline_type_shift); + jcc(Assembler::carrySet, is_null_free_inline_type); } void MacroAssembler::test_field_is_not_null_free_inline_type(Register flags, Register temp_reg, Label& not_null_free_inline_type) { movl(temp_reg, flags); - shrl(temp_reg, ResolvedFieldEntry::is_null_free_inline_type_shift); - andl(temp_reg, 0x1); - testl(temp_reg, temp_reg); - jcc(Assembler::zero, not_null_free_inline_type); + btl(temp_reg, ResolvedFieldEntry::is_null_free_inline_type_shift); + jcc(Assembler::carryClear, not_null_free_inline_type); } void MacroAssembler::test_field_is_flat(Register flags, Register temp_reg, Label& is_flat) { movl(temp_reg, flags); - shrl(temp_reg, ResolvedFieldEntry::is_flat_shift); - andl(temp_reg, 0x1); - testl(temp_reg, temp_reg); - jcc(Assembler::notZero, is_flat); + btl(temp_reg, ResolvedFieldEntry::is_flat_shift); + jcc(Assembler::carrySet, is_flat); } void MacroAssembler::test_oop_prototype_bit(Register oop, Register temp_reg, int32_t test_bit, bool jmp_set, Label& jmp_label) {