Skip to content

Commit

Permalink
8287433: [PPC64] g1_write_barrier_pre needs extension for Loom
Browse files Browse the repository at this point in the history
Reviewed-by: rrich, stuefe
  • Loading branch information
TheRealMDoerr committed May 30, 2022
1 parent d833173 commit eb8d067
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,22 +193,38 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator

// Determine necessary runtime invocation preservation measures
const bool needs_frame = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR;
assert(preservation_level <= MacroAssembler::PRESERVATION_FRAME_LR,
"g1_write_barrier_pre doesn't support preservation levels higher than PRESERVATION_FRAME_LR");
const bool preserve_gp_registers = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR_GP_REGS;
const bool preserve_fp_registers = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR_GP_FP_REGS;
int nbytes_save = 0;

// May need to preserve LR. Also needed if current frame is not compatible with C calling convention.
if (needs_frame) {
if (preserve_gp_registers) {
nbytes_save = (MacroAssembler::num_volatile_gp_regs
+ (preserve_fp_registers ? MacroAssembler::num_volatile_fp_regs : 0)
) * BytesPerWord;
__ save_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers);
}

__ save_LR_CR(tmp1);
__ push_frame_reg_args(0, tmp2);
__ push_frame_reg_args(nbytes_save, tmp2);
}

if (pre_val->is_volatile() && preloaded) { __ mr(nv_save, pre_val); } // Save pre_val across C call if it was preloaded.
if (pre_val->is_volatile() && preloaded && !preserve_gp_registers) {
__ mr(nv_save, pre_val); // Save pre_val across C call if it was preloaded.
}
__ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), pre_val, R16_thread);
if (pre_val->is_volatile() && preloaded) { __ mr(pre_val, nv_save); } // restore
if (pre_val->is_volatile() && preloaded && !preserve_gp_registers) {
__ mr(pre_val, nv_save); // restore
}

if (needs_frame) {
__ pop_frame();
__ restore_LR_CR(tmp1);

if (preserve_gp_registers) {
__ restore_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers);
}
}

__ bind(filtered);
Expand Down

1 comment on commit eb8d067

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.