[11u] RFR (S) 8221477: Inject os/cpu-specific constants into Unsafe from JVM

Andrew Dinn adinn at redhat.com
Wed Jan 20 14:42:10 UTC 2021


Hi Dmitry,

On 20/01/2021 14:10, Dmitry Chuyko wrote:
> Original RFE: https://bugs.openjdk.java.net/browse/JDK-8221477
> 
> Original patch mostly applies cleanly except 3 native method deletions 
> in Unsafe.java - they are repeated manually.
> 
> 11u webrev: http://cr.openjdk.java.net/~dchuyko/8221477/webrev.11u.00/
> 
> Testing: tier1, tier2.
Well, first off, the patch looks ok.

I am not sure your reason for backporting this fix is one the 
maintainers will agree with:

"Backporting this patch makes it easier to port changes in touched files 
(like thread.cpp and unsafe). Original change preceded JEP 352 but it is 
valuable in itself as it unifies fields initialization in Unsafe."

Regarding the first point: backporting every patch "makes it easier to 
port changes in touched files". So, clearly discretion needs to be applied.

The second point is true but still only a weak reason since the total 
number of fields is 4.

I accept that the effect of this change at the level of the JDK is 
tightly contained to Unsafe so the danger is fairly low in that regard. 
However, the implementation changes which VM symbols get defined and 
alters class initialization order. It includes an assert that performs a 
partial check that this has has not been done incorrectly (but we know 
we cannot implement any comprehensive test). The latter in particular is 
maybe a reason not to backport. Of course, it is up to the maintainers 
to make a final decision.

regards,


Andrew Dinn
-----------
Red Hat Distinguished Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill



More information about the jdk-updates-dev mailing list