RFR (S) 8140483: Atomic*FieldUpdaters final fields should be trusted
john.r.rose at oracle.com
Wed Oct 28 21:19:20 UTC 2015
On Oct 27, 2015, at 4:19 AM, Aleksey Shipilev <aleksey.shipilev at oracle.com> wrote:
> I'd like to start a formal review for the change:
> The feedback was overwhelmingly positive so far. Some suggested we use
> compiler control and/or maintain the list of trusted classes. I still
> think it is an overkill for the fix at hand, and we should instead wait
> for the wholesale final field optimizations.
This is a good point-fix for a specific problem with a specific set of performance-sensitive classes.
I prefer class-based exceptions (b), as more accurate and less likely to be subverted by "surprising" package additions. (The check for Serializable, does, however, cut out the main "surprise" effect.)
P.S. Fixing finals is one of those slippery-slope problems, like fixing the class file format (or, for that matter, fixing our broken kitchen stove, which ended up with a much more expensive kitchen remodel, because we couldn't fix just the stove).
More information about the hotspot-compiler-dev