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

Encode SATBMarkQueue active flag in _index

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 14
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Subcomponent:
      gc

      Description

      SATBMarkQueue presently has a bool _active member for the active flag. The _index member is scaled to a byte index into the word-valued buffer, so the low LogBytesPerWord bits are always zero. We could also encode the (inverted) active state in _index, with a value of min_intx indicating inactive. This would allow a smaller and faster dispatch among (1) inactive, (2) active fast path, and (3) active slow path. Rather than the existing sequence of two load-test-branch and a later subtraction on the enqueue path, we could have something like (for x86 &etc, for example)

        mov rindex, index_offset(rthread)
        sub rindex, #BytesPerWord
        jo #inactive // branch on overflow (min_intx - BytesPerWord overflows)
        jl #slow_path // branch on negative (0 - BytesPerWord is negative)
        // fast path code
        // can use rindex directly, with no further adjustments needed.

      [Updated for JDK-8258255, which moved the active flag from PtrQueue to SATBMarkQueue.]

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kbarrett Kim Barrett
              Reporter:
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: