diff -r 0d7877278adf -r bc0648405d67 src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp Wed Sep 18 20:56:19 2019 +0200 +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp Wed Sep 18 20:56:20 2019 +0200 @@ -715,8 +715,10 @@ Register obj = stub->obj()->as_register(); Register res = stub->result()->as_register(); + Register addr = stub->addr()->as_register(); Register tmp1 = stub->tmp1()->as_register(); Register tmp2 = stub->tmp2()->as_register(); + assert_different_registers(obj, res, addr, tmp1, tmp2); Label slow_path; @@ -745,29 +747,9 @@ #endif __ jcc(Assembler::zero, *stub->continuation()); - // Test if object is resolved. - __ movptr(tmp1, Address(res, oopDesc::mark_offset_in_bytes())); - // Test if both lowest bits are set. We trick it by negating the bits - // then test for both bits clear. - __ notptr(tmp1); -#ifdef _LP64 - __ testb(tmp1, markWord::marked_value); -#else - // On x86_32, C1 register allocator can give us the register without 8-bit support. - // Do the full-register access and test to avoid compilation failures. - __ testptr(tmp1, markWord::marked_value); -#endif - __ jccb(Assembler::notZero, slow_path); - // Clear both lower bits. It's still inverted, so set them, and then invert back. - __ orptr(tmp1, markWord::marked_value); - __ notptr(tmp1); - // At this point, tmp1 contains the decoded forwarding pointer. - __ mov(res, tmp1); - - __ jmp(*stub->continuation()); - __ bind(slow_path); ce->store_parameter(res, 0); + ce->store_parameter(addr, 1); __ call(RuntimeAddress(bs->load_reference_barrier_rt_code_blob()->code_begin())); __ jmp(*stub->continuation()); @@ -838,8 +820,21 @@ // arg0 : object to be resolved __ save_live_registers_no_oop_map(true); - __ load_parameter(0, LP64_ONLY(c_rarg0) NOT_LP64(rax)); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier), LP64_ONLY(c_rarg0) NOT_LP64(rax)); + +#ifdef _LP64 + __ load_parameter(0, c_rarg0); + __ load_parameter(1, c_rarg1); + if (UseCompressedOops) { + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_fixup_narrow), c_rarg0, c_rarg1); + } else { + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_fixup), c_rarg0, c_rarg1); + } +#else + __ load_parameter(0, rax); + __ load_parameter(1, rbx); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_fixup), rax, rbx); +#endif + __ restore_live_registers_except_rax(true); __ epilogue();