RFR: 8073093: AARCH64: C2 generates poor code for ByteBuffer accesses

John Rose john.r.rose at oracle.com
Tue Feb 17 18:42:00 UTC 2015

On Feb 17, 2015, at 6:22 AM, Andrew Haley <aph at redhat.com> wrote:
> Everything gets inlined nicely and the ByteBuffer is not created, but
> a store fence remains because of the final fields in HeapByteBuffer.

Wow, that got closer to the goal than I expected.  In general, the EA analysis can fail "at random" because of vagaries of inlining policy.

The remaining store fence is probably a bug.  A store fence for scalarized (lifted-out-of-memory) final fields should go away, since the fields are not actually stored in heap memory.

I filed JDK-8073358 to track.

BTW, we already elide synch. ops on scalarized (non-stored) objects.  Fence elision is a similar optimization.

— John

P.S.  Value types will come with scalarization "always-on", so even if a call goes out of line, the value's fields can be kept out of the heap.

One of the projected use cases of values is safe encapsulation for complex pointers (native or in-object).

More information about the hotspot-dev mailing list