Skip to content

Commit e080a0b

Browse files
committedAug 10, 2023
8311508: ZGC: RAII use of IntelJccErratumAlignment
Reviewed-by: stefank, shade, tschatzl
1 parent 242a2e6 commit e080a0b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed
 

‎src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,6 @@ IntelJccErratumAlignment::~IntelJccErratumAlignment() {
146146
return;
147147
}
148148

149+
assert(pc() - _start_pc > 0, "No instruction aligned");
149150
assert(!IntelJccErratum::is_crossing_or_ending_at_32_byte_boundary(_start_pc, pc()), "Invalid jcc_size estimate");
150151
}

‎src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static void emit_store_fast_path_check_c2(MacroAssembler* masm, Address ref_addr
356356
// This is a JCC erratum mitigation wrapper for calling the inner check
357357
int size = store_fast_path_check_size(masm, ref_addr, is_atomic, medium_path);
358358
// Emit JCC erratum mitigation nops with the right size
359-
IntelJccErratumAlignment(*masm, size);
359+
IntelJccErratumAlignment intel_alignment(*masm, size);
360360
// Emit the JCC erratum mitigation guarded code
361361
emit_store_fast_path_check(masm, ref_addr, is_atomic, medium_path);
362362
#endif

‎src/hotspot/cpu/x86/gc/z/z_x86_64.ad

+4-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ static void z_load_barrier(MacroAssembler& _masm, const MachNode* node, Address
7474
return;
7575
}
7676
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref);
77-
IntelJccErratumAlignment(_masm, 6);
78-
__ jcc(Assembler::above, *stub->entry());
77+
{
78+
IntelJccErratumAlignment intel_alignment(_masm, 6);
79+
__ jcc(Assembler::above, *stub->entry());
80+
}
7981
__ bind(*stub->continuation());
8082
}
8183

0 commit comments

Comments
 (0)