Skip to content

Commit

Permalink
8311508: ZGC: RAII use of IntelJccErratumAlignment
Browse files Browse the repository at this point in the history
Reviewed-by: stefank, shade, tschatzl
  • Loading branch information
xmas92 committed Aug 10, 2023
1 parent 242a2e6 commit e080a0b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,6 @@ IntelJccErratumAlignment::~IntelJccErratumAlignment() {
return;
}

assert(pc() - _start_pc > 0, "No instruction aligned");
assert(!IntelJccErratum::is_crossing_or_ending_at_32_byte_boundary(_start_pc, pc()), "Invalid jcc_size estimate");
}
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static void emit_store_fast_path_check_c2(MacroAssembler* masm, Address ref_addr
// This is a JCC erratum mitigation wrapper for calling the inner check
int size = store_fast_path_check_size(masm, ref_addr, is_atomic, medium_path);
// Emit JCC erratum mitigation nops with the right size
IntelJccErratumAlignment(*masm, size);
IntelJccErratumAlignment intel_alignment(*masm, size);
// Emit the JCC erratum mitigation guarded code
emit_store_fast_path_check(masm, ref_addr, is_atomic, medium_path);
#endif
Expand Down
6 changes: 4 additions & 2 deletions src/hotspot/cpu/x86/gc/z/z_x86_64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ static void z_load_barrier(MacroAssembler& _masm, const MachNode* node, Address
return;
}
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref);
IntelJccErratumAlignment(_masm, 6);
__ jcc(Assembler::above, *stub->entry());
{
IntelJccErratumAlignment intel_alignment(_masm, 6);
__ jcc(Assembler::above, *stub->entry());
}
__ bind(*stub->continuation());
}

Expand Down

1 comment on commit e080a0b

@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.