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

Remove is-queue-active check in inner loop of write_ref_array_pre_work

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 18
    • Component/s: hotspot
    • Subcomponent:
      gc
    • Resolved In Build:
      b05

      Description

      G1BarrierSet::write_ref_array_pre_work roughly looks as follows:

      if marking active -> exit

      for all references in array:
        if array[i] != NULL
          enqueue(array[i])

      enqueue every time checks again whether marking is active. In reality, the generated assembly code seems to load Thread::current() and does the check for every loop iteration which is really unnecessary.

      Also some other code can be hoisted out of the loop which results in more compact generated code.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tschatzl Thomas Schatzl
              Reporter:
              tschatzl Thomas Schatzl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: