[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


Hi,

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

Bug:
  https://bugs.openjdk.java.net/browse/JDK-8140587

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:
  http://hg.openjdk.java.net/jdk9/dev/jdk/rev/e1a21828acc1

JDK 9 Review:

http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2015-July/018473.html

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:
  http://cr.openjdk.java.net/~shade/8140587/webrev.jdk8u-a.01/

Alternatively, we can backport the change separately:
  http://cr.openjdk.java.net/~shade/8140587/webrev.jdk8u-b.01/

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.

Thanks,
-Aleksey




More information about the jdk8u-dev mailing list