RFR (S) 8031818: Experimental VM flag for enforcing safe object construction
john.r.rose at oracle.com
Mon Feb 3 14:15:42 PST 2014
On Feb 1, 2014, at 8:53 AM, Doug Lea <dl at cs.oswego.edu> wrote:
> On 01/31/2014 07:10 PM, John Rose wrote:
>> Yes, that is right. I think of @Stable as a postponed (post-constructor) final,
>> but making that real will require a write barrier.
> I think it is safe to say that revised JMM9 rules will be simple and clear
> about how and when to do this...
>> Currently, @Stable is only about "sticky" reads. I.e., if you read a non-null
>> value, you can stick with it, as long as you like.
> ... but may say very little about this part. The JMM per se cannot tell
> you if/when a final write occurs, either for "final" or @Stable (or
> for any other variable for that matter). When you can somehow tell
> by other means, you don't need much from the JMM to know that you
> can suppress reloads, etc.
Good point. Some day the JVM might enforce rules to prevent threads from changing stable data, throwing exceptions, etc.
The JMM might have to provide primitives that would allow the JVM to test for the conditions it cares about.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev