[foreign-memaccess] RFR 8224993: Add Unsafe support for MemoryAddress (again)

Jorn Vernee jbvernee at xs4all.nl
Thu May 30 16:09:48 UTC 2019


Looks good to me.

I wanted to ask about the addition of the APIs to sun.misc.Unsafe last 
time, but got side-tracked by the test build error and then forgot :/. I 
had assumed sun.misc.Unsafe would not be updated going forward? What's 
the policy on this?

Thanks,
Jorn

Maurizio Cimadamore schreef op 2019-05-30 16:59:
> Hi,
> small followup to yesterday's push.
> 
> As I was benchmarking bulk copy performances, I realized that there's
> a bug in the methods which I added yesterday on sun.misc.Unsafe -
> which delegate to the wrong Unsafe (itself), resulting in SO.
> 
> I also cleaned up uses of Unsafe internally - and added a @ForceInline
> on MemoryAddressImpl::copy which basically makes it as fast as a raw
> unsafe call to Unsafe::copyMemory. We're still investigating as to why
> exactly the annotation is needed to get good inlining.
> 
> I've also added a shortcircuit in AbstractMemoryScopeImpl::checkAlive,
> which avoids a call to 'isAlive' if the scope is pinned. This was
> causing some profile pollution (although performances were still good
> - probably because of the bi-morphic inline cache).
> 
> Webrev:
> http://cr.openjdk.java.net/~mcimadamore/panama/8224993_followup/
> 
> Maurizio


More information about the panama-dev mailing list