RFR(M): 8181211: C2: Use profiling data to optimize on/off heap unsafe accesses

Paul Sandoz paul.sandoz at oracle.com
Wed May 31 16:42:43 UTC 2017

> On 31 May 2017, at 01:54, Roland Westrelin <rwestrel at redhat.com> wrote:
> Hi Paul,
>> A further clean up of the ByteBuffer code is to unify heap and direct
>> implementations to consistently use the double addressing mode, where
>> for the latter a null from a field is read and passed for the heap
>> object. We conservatively held off doing that due to performance
>> concerns. Do you think your patch will help here too?
> It would help if the application either only uses on heap accesses or
> off heap accesses. A mix of the two would cause profile pollution and
> a performance drop.
> MethodHandles.byteBufferViewVarHandle() shares one implementation for
> both off and on heap accesses, right? AFAICT, it is subject to that
> problem.

Yes, it avoided the profile pollution induced by virtual calls to multiple buffer implementations by accessing common state, but at the cost of taking a hit on uniformly reading the heap object value from a field. So i suspect your patch might be marginally improve things in certain cases?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20170531/df5254c5/signature.asc>

More information about the hotspot-compiler-dev mailing list