--- old/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2018-05-07 15:51:58.104279717 +0200 +++ new/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2018-05-07 15:51:57.836275178 +0200 @@ -3728,6 +3728,20 @@ } } +void MacroAssembler::test_oop_is_not_value(Register oop, Register temp, Label& is_not_value) { + const int mask = Universe::oop_metadata_valuetype_mask(); +#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); + jcc(Assembler::zero, is_not_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)