[11u] RFR (S) 8218879: Keep track of memory accesses originated from Unsafe
Severin Gehwolf
sgehwolf at redhat.com
Wed Aug 21 08:54:05 UTC 2019
On Fri, 2019-08-16 at 14:41 +0200, Aleksey Shipilev wrote:
> On 8/7/19 12:16 PM, Aleksey Shipilev wrote:
> > > 11u webrev:
> > > https://cr.openjdk.java.net/~shade/8218879/webrev.11u.01/
>
> Ha, no wait, there is the odd conflict here:
>
> 37 // Use the C1_UNSAFE_ACCESS decorator to mark unsafe accesses.
> 38 const DecoratorSet C1_UNSAFE_ACCESS = DECORATOR_LAST << 3;
> 39 // The C1_WRITE_ACCESS decorator is used to mark writing accesses.
> 40 const DecoratorSet C1_WRITE_ACCESS = DECORATOR_LAST << 3;
>
> Notice C1_UNSAFE_ACCESS and C1_WRITE_ACCESS would be mapped to the same constant! This does not
> happen in jdk/jdk, because JDK-8209801 have removed (READ|WRITE) accessors. JDK-8209801 does not
> look backportable, because it drags in significant part of Access API.
Nice catch!
> So, the alternative is to push C1_UNSAFE_ACCESS to other index:
> http://cr.openjdk.java.net/~shade/8218879/webrev.11u.02/
41 // Use the C1_UNSAFE_ACCESS decorator to mark unsafe accesses.
42 const DecoratorSet C1_UNSAFE_ACCESS = DECORATOR_LAST << 5;
Consider adding a comment saying that "Should JDK-8209801 ever get
backported this will need adjustment".
Up to you. I don't need to see another webrev for this.
Thanks,
Severin
More information about the jdk-updates-dev
mailing list