--- old/src/hotspot/cpu/arm/macroAssembler_arm.cpp 2018-06-14 15:22:34.456663048 +0300 +++ new/src/hotspot/cpu/arm/macroAssembler_arm.cpp 2018-06-14 15:22:34.044660972 +0300 @@ -3014,8 +3014,8 @@ mov(Rscratch, SP); sub(Rscratch, Rmark, Rscratch); ands(Rscratch, Rscratch, imm); - b(done, ne); // exit with failure - str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes())); // set to zero + // set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8153107) + str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes())); b(done); #else @@ -3025,7 +3025,8 @@ sub(Rscratch, Rmark, SP, eq); movs(Rscratch, AsmOperand(Rscratch, lsr, exact_log2(os::vm_page_size())), eq); // If still 'eq' then recursive locking OK - str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()), eq); // set to zero + // set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8153107) + str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes())); b(done); #endif