Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8251398: [lworld] TestCallingConvention::test36 spuriously fails due to incorrect field value #143

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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);
}