John.Rose at Sun.COM
Thu Sep 18 15:54:33 PDT 2008
More comments on your review request:
Note that src/java/dyn/impl/package-info.java briefly describes the
It would be best to keep the use of sun.misc.Unsafe factored into the
impl package, so there is a minimum of platform-dependent code in the
main package. This can be done by putting setTarget in a mixin class
CS, or less intrusively by pushing the memory barrier into a static
method of DynCallSite.
On balance, I guess I like your idea making target volatile, and
making the fields private instead of protected is also OK, as long as
there is a callerObject() query to get the caller, in the case where
it is some class-like blob from the language runtime.
Making the target field volatile can't hurt, although it may set a
false expectation about JVM reference patterns from optimized code.
More information about the mlvm-dev