-
Bug
-
Resolution: Fixed
-
P4
-
21, 22
-
b11
SonarCloud reports the potential bug in the code below:
Name this temporary "IntelJccErratumAlignment" object if you want to use it in for RAII.
```
static void emit_store_fast_path_check_c2(MacroAssembler* masm, Address ref_addr, bool is_atomic, Label& medium_path) {
#ifdef COMPILER2
// 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); // <----------- COMPLAINS HERE
// Emit the JCC erratum mitigation guarded code
emit_store_fast_path_check(masm, ref_addr, is_atomic, medium_path);
#endif
```
The comment seems to imply that `emit_store_fast_path_check` needs to be guarded by `IntelJccErratumAlignment`. I think it is innocuous at this point, as `~IntelJccErratumAlignment` only carries the assert. Is this use correct, though?
Name this temporary "IntelJccErratumAlignment" object if you want to use it in for RAII.
```
static void emit_store_fast_path_check_c2(MacroAssembler* masm, Address ref_addr, bool is_atomic, Label& medium_path) {
#ifdef COMPILER2
// 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); // <----------- COMPLAINS HERE
// Emit the JCC erratum mitigation guarded code
emit_store_fast_path_check(masm, ref_addr, is_atomic, medium_path);
#endif
```
The comment seems to imply that `emit_store_fast_path_check` needs to be guarded by `IntelJccErratumAlignment`. I think it is innocuous at this point, as `~IntelJccErratumAlignment` only carries the assert. Is this use correct, though?
- relates to
-
JDK-8307058 Implementation of Generational ZGC
- Resolved