-
Enhancement
-
Resolution: Unresolved
-
P4
-
14
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 forJDK-8258255, which moved the active flag from PtrQueue to SATBMarkQueue.]
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
- relates to
-
JDK-8258255 Move PtrQueue active flag to SATBMarkQueue
- Resolved
-
JDK-8256279 Encode SATBMarkQueue active flag via _buf == NULL
- Open
-
JDK-8312213 Remove unnecessary TEST instructions on x86 when flags reg will already be set
- Resolved
-
JDK-8226408 Refactor PtrQueue is_active
- Closed