Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8311508

ZGC: RAII use of IntelJccErratumAlignment

    XMLWordPrintable

Details

    • gc
    • b11

    Description

      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?

      Attachments

        Issue Links

          Activity

            People

              aboldtch Axel Boldt-Christmas
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: