JSR 292 Goodness: Almost static final field
Rémi Forax
forax at univ-mlv.fr
Sat Dec 17 10:33:48 PST 2011
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
More information about the mlvm-dev
mailing list