RFR JDK-8207259: [lworld] Ensure VarHandle compare and set/exchange work for inline types

Mandy Chung mandy.chung at oracle.com
Wed Jun 19 18:26:46 UTC 2019


This patch is an interim fix to get VarHandle CAS and CAE to work
for inline types and use substitutability test instead of equals.

Unsafe::compareAndSetReference and compareAndExchangeReference
(along with its weakXXX variants) do pointer-comparison. A reference
can be an instance of an inline class (indirect or non-flattened)
or of an indirect class.  CAS/CAE on two inlineable reference instances
should do substitutability test.  I add a couple Unsafe APIs for CAS/CAE
to take the field type and revisit this in LW10 w.r.t atomicity.

Webrev at:
http://cr.openjdk.java.net/~mchung/valhalla/webrevs/8207259/webrev.02/index.html

Mandy



More information about the valhalla-dev mailing list