[jmm-dev] VarHandle.safepoint() methods

Andrew Haley aph at redhat.com
Fri Jan 6 09:56:34 UTC 2017


On 05/01/17 18:37, Paul Sandoz wrote:

> If we just consider an implementation specific solution i wonder if
> it’s possible to annotate the wrapped MappedByteBuffer methods with
> a hotspot specific annotation declaring they are “no check point
> boundaries" scoped. When a method is compiled/inlined the scope
> might be coarsened. That is likely easier to optimize than
> Runtime.callWithNoCheckpointBoundaries?

I have no problem at all doing this with a solution that is specific
to MappedByteBuffer.  Define a couple of Unsafe methods and I'm done.
(Well, it still requires surgery to the JIT, but that's OK.)

But my feeling is this: the problem has persisted so long (15 years)
because of what I consider to be a deficiency in the language.  It
ought to be possible to write this kind of thing in Pure Java, but
it's not.  There are other places in the library where this kind of
mechanism could be used.  So I'm willing to put in the effort to
get this standardized in a way that everyone is happy with.

Andrew.


More information about the jmm-dev mailing list