Update to description of JEP 193: Enhanced Volatiles
paul.sandoz at oracle.com
Fri Oct 31 15:18:06 UTC 2014
On Oct 31, 2014, at 2:57 PM, "MacGregor, Duncan (GE Energy Management)" <duncan.macgregor at ge.com> wrote:
> I like the overall idea but also think the string feels wrong, it suggests
> that both the class of the object and the field name could be dynamic and
> might change with every invocation, but I really doubt we¹d want that.
Pedantically: the concrete class of the receiver object could change (e.g. sub-classes of ForkJoinTask) but should always be an instance of the receiver class.
> we were to approach this from the callsite point of view then the type of
> the site should specify the class which owns the field and the type of
> that field, with the name specified by the String passed to the bsm, and
> the Java syntax would have to make it obvious that those are not
> dynamically changeable.
> How would we express operations on atomic fields with this scheme?
The initial version of the JEP could of expressed that (with a number of solutions for how such expressions could translate to byte code). It was a good attempt ("least-bad way at the time"), but we were not happy with it.
More information about the valhalla-dev