I've written a blog entry about how to write a static volatile final
variable, i.e. a variable which is considered as constant
by the compiler (the JIT) and if the variable changes, the JITed code is
deoptimized and
jump back in interpreter mode to eventually optimize it again later.
http://weblogs.java.net/blog/forax/archive/2011/12/17/jsr-292-goodness-almost-static-final-field
The code is a little bit more convoluted than it should because there is
no invokedynamic
in Java but you can emulate it.
Rémi
--
You received this message because you are subscribed to the Google Groups "JVM
Languages" group.
To post to this group, send email to jvm-languages@googlegroups.com.
To unsubscribe from this group, send email to
jvm-languages+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/jvm-languages?hl=en.