Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
17, 18
-
b05
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8306475 | 17.0.8 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
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.
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
- backported by
-
JDK-8306475 Remove is-queue-active check in inner loop of write_ref_array_pre_work
-
- Resolved
-
- relates to
-
JDK-8028337 Checkcast-arraycopy stub for G1 is very slow
-
- Open
-
- links to
-
Commit openjdk/jdk17u-dev/02efaf73
-
Commit openjdk/jdk/675a9520
-
Review openjdk/jdk17u-dev/905
-
Review openjdk/jdk/4669
(1 links to)