Skip to content
Permalink
Browse files
8251398: [lworld] TestCallingConvention::test36 spuriously fails due …
…to incorrect field value
  • Loading branch information
TobiHartmann committed Aug 11, 2020
1 parent f0a8efc commit 2455c8ede34224fc5b66be222c95e6cfafbd630c
Showing with 42 additions and 4 deletions.
  1. +42 −4 src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp
@@ -202,10 +202,18 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm,
__ jmp(done);

__ bind(runtime);
// FIXME
// Barriers might be emitted when converting between (scalarized) calling conventions for inline
// types. Save all registers until JDK-8232094 is fixed to avoid overwriting argument registers.
// types. Save all argument registers before calling into the runtime.
__ pusha();
__ subptr(rsp, 64);
__ movdbl(Address(rsp, 0), j_farg0);
__ movdbl(Address(rsp, 8), j_farg1);
__ movdbl(Address(rsp, 16), j_farg2);
__ movdbl(Address(rsp, 24), j_farg3);
__ movdbl(Address(rsp, 32), j_farg4);
__ movdbl(Address(rsp, 40), j_farg5);
__ movdbl(Address(rsp, 48), j_farg6);
__ movdbl(Address(rsp, 56), j_farg7);

// Calling the runtime using the regular call_VM_leaf mechanism generates
// code (generated by InterpreterMacroAssember::call_VM_leaf_base)
@@ -237,7 +245,18 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm,
__ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), pre_val, thread);
}

// Restore registers
__ movdbl(j_farg0, Address(rsp, 0));
__ movdbl(j_farg1, Address(rsp, 8));
__ movdbl(j_farg2, Address(rsp, 16));
__ movdbl(j_farg3, Address(rsp, 24));
__ movdbl(j_farg4, Address(rsp, 32));
__ movdbl(j_farg5, Address(rsp, 40));
__ movdbl(j_farg6, Address(rsp, 48));
__ movdbl(j_farg7, Address(rsp, 56));
__ addptr(rsp, 64);
__ popa();

__ bind(done);
}

@@ -312,10 +331,18 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
__ jmp(done);

__ bind(runtime);
// FIXME
// Barriers might be emitted when converting between (scalarized) calling conventions for inline
// types. Save all registers until JDK-8232094 is fixed to avoid overwriting argument registers.
// types. Save all argument registers before calling into the runtime.
__ pusha();
__ subptr(rsp, 64);
__ movdbl(Address(rsp, 0), j_farg0);
__ movdbl(Address(rsp, 8), j_farg1);
__ movdbl(Address(rsp, 16), j_farg2);
__ movdbl(Address(rsp, 24), j_farg3);
__ movdbl(Address(rsp, 32), j_farg4);
__ movdbl(Address(rsp, 40), j_farg5);
__ movdbl(Address(rsp, 48), j_farg6);
__ movdbl(Address(rsp, 56), j_farg7);

#ifdef _LP64
__ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), card_addr, r15_thread);
@@ -325,7 +352,18 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
__ pop(thread);
#endif

// Restore registers
__ movdbl(j_farg0, Address(rsp, 0));
__ movdbl(j_farg1, Address(rsp, 8));
__ movdbl(j_farg2, Address(rsp, 16));
__ movdbl(j_farg3, Address(rsp, 24));
__ movdbl(j_farg4, Address(rsp, 32));
__ movdbl(j_farg5, Address(rsp, 40));
__ movdbl(j_farg6, Address(rsp, 48));
__ movdbl(j_farg7, Address(rsp, 56));
__ addptr(rsp, 64);
__ popa();

__ bind(done);
}

0 comments on commit 2455c8e

Please sign in to comment.