[foreign-jextract] RFR: MemorySegmentPool + Allocator [v8]

Radoslaw Smogura github.com+7535718+rsmogura at openjdk.java.net
Thu Apr 22 22:24:33 UTC 2021


On Thu, 22 Apr 2021 21:13:01 GMT, Radoslaw Smogura <github.com+7535718+rsmogura at openjdk.org> wrote:

>> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegmentPool.java line 199:
>> 
>>> 197:     });
>>> 198: 
>>> 199:     return segmentEntry.memoryAddress.asSegment(1L << bitBound, resourceScope);
>> 
>> I wouldn't be surprised if this was the issue - the segment is created with a size that is determined by a long shift. If this segment gets scalarized, I wonder if the VM is able to see that the segment size is actually an int and not a long. Worth a shot.
>
> I checked it, and I get same results. I'll shortly send an updated version

Catched! It's not int, I use calculate leading zeros, I guess this a barrier for VM. Replacing size by size with align makes it fast.

But  it's about size value

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/509


More information about the panama-dev mailing list