--- old/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2018-05-21 11:52:00.155850486 +0200 +++ new/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2018-05-21 11:51:59.835844784 +0200 @@ -3728,6 +3728,26 @@ } } +void MacroAssembler::test_oop_is_value(Register oop, Register temp, Label* is_value, Label* is_not_value) { + const int mask = Universe::oop_metadata_valuetype_mask(); + assert((is_value != NULL) || (is_not_value != NULL), "Need a label to jump to"); + assert((is_value == NULL) ^ (is_not_value == NULL), "Need one label"); +#ifdef _LP64 + if (UseCompressedClassPointers) { + movl(temp, Address(oop, oopDesc::klass_offset_in_bytes())); + } else +#endif + movptr(temp, Address(oop, oopDesc::klass_offset_in_bytes())); + + andl(temp, mask); + testl(temp, temp); + if (is_not_value != NULL) { + jcc(Assembler::zero, *is_not_value); + } else { + jcc(Assembler::notZero, *is_value); + } +} + void MacroAssembler::os_breakpoint() { // instead of directly emitting a breakpoint, call os:breakpoint for better debugability // (e.g., MSVC can't call ps() otherwise)