Re: JavaMemoryModel: Final Means Different Things To VM and Java Language. Does That Impact JITs?

From: Dan Bornstein (danfuzz@milk.com)
Date: Thu Oct 02 2003 - 12:48:57 EDT


Jeremy Manson writes:
>> On Tue, 30 Sep 2003 1:23 pm, Bill Pugh wrote:
>> > The rules on final fields being set exactly once are part of the
>> > JVM/classfile specification.
>>
>> Actually, they're not. Per the VM spec, "final" fields are read-only to
>> most classes but read-write at any time to the defining class itself.
>
>The VM Spec has a little to say on this (Section 2.9.1):

I believe section 2 is meant to be informative about Java the language, and
not part of the VM spec per se.

However, I did make the error of mistakenly believing that the description
of the verification process, and verification as commonly (ubiquitously?)
implemented was is agreement with the rest of the spec. Section 4.5 does in
fact say of ACC_FINAL:

    Declared final; no further assignment after initialization

Sorry for the confusion.

-dan
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:51 EDT