[8u76] Request for approval: 8140587: Atomic*FieldUpdaters should use Class.isInstance instead of direct class check

Aleksey Shipilev aleksey.shipilev at oracle.com
Thu Dec 3 18:14:43 UTC 2015


This is yet another backport for improving Atomic*FieldUpdaters (A*FU)


The rationale for the change is simple: use the intrinsified
Class.isInstance instead of doing the direct class checks. This improves
C2 performance in some corner cases, and improves C1 performance across
most A*FU use cases (but only with C1 fix in JDK-8131782 applied, which
is backported separately).

Like other A*FU-related patches, thus provides a migration path with the
eventual demise of sun.misc.Unsafe. Therefore, I'd like us to consider
this in 8u76 to expose users to this improvement earlier than JDK 9 release.

I am not a 8u Committer, so if the change is approved, I'd need a sponsor.

JDK 9 Changeset:

JDK 9 Review:


This change was in jdk9/dev for a week. The patch DOES NOT apply cleanly
over 8u sources, because of the formatting changes present only in jdk9,
plus the sun.misc/jdk.internal.misc.Unsafe split, plus some
modifier/method shuffling.

JDK 9 patch contains a fair amount of formatting/modifier changes as
well, so I suggest to copy A*FU classes from jdk9, picking all the minor
changes, except for the Unsafe switch -- this would simplify future
backports as well:

Alternatively, we can backport the change separately:

With both options, jdk8u builds and runs fine at least on Linux x86_64,
and the performance improvement is the same as in JDK 9.


More information about the jdk8u-dev mailing list