On Tue, Mar 27, 2018 at 5:56 PM, David Holmes <david.hol...@oracle.com> wrote:
> >> @Stable final >> just means the VM can really truly assume the value will only ever change >> from the default value once. >> Like a per-field -XX:+TrustFinalNonStaticFields >> http://www.progdoc.de/papers/JET2015/How_final_is_final.pdf >> http://hg.openjdk.java.net/jdk/jdk/file/b6671a111395/src/jav >> a.base/share/classes/jdk/internal/vm/annotation/Stable.java >> > > Yep I grok the semantics, but am wondering about the actual runtime > impact. Is the Stable annotation class going to have to be loaded and > processed when Thread is initialized? Will this change the initialization > order? > I don't know. But given that the annotation only works with the bootstrap loader, we had better hope it is safe with Thread. At least the VM doesn't have to run any risky java code, and is also free to ignore the annotation if it's too early.