[foreign] RFR 8217989: Consolidate BoundedPointer implementation

Henry Jen henry.jen at oracle.com
Wed Jan 30 18:51:41 UTC 2019


Changes looks good to me. One minor nit,

Pointer.java:215 can use a space after cast as line above.

Cheers,
Henry


> On Jan 30, 2019, at 8:23 AM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
> 
> Updated webrev
> 
> http://cr.openjdk.java.net/~mcimadamore/panama/8217989_v2/
> 
> Consolidated code in BoundedPointer and also cleaned up minor issues in Util (e.g. unused fields).
> 
> Cheers
> Maurizio
> 
> On 30/01/2019 12:19, Maurizio Cimadamore wrote:
>> 
>> On 30/01/2019 12:10, Jorn Vernee wrote:
>>> I agree that Scope and AccessMode belong on BoundedPointer as well.
>>> 
>>> The 3 new helper methods in Util are only being used by BoundedPointer, should the implementation of those 3 methods be moved to BoundedPointer? AFAICT that would also allow you to remove/make private the toUnsafeBase and toUnsafeOffset accessors.
>>> 
>>> Or at least; those 3 methods use BoundedPointer::toUnsafeBase and BoundedPointer::toUnsafeOffset, so imho they should also have 'unsafe' in their name since they don't add any safety. i.e.: Util::copyToUnafe, Util::getBitsUnsafe, and Util::putBitsUnsafe.
>> 
>> Yeah - that seems like a good suggestion; I was moving them back and forth and I ended up there because Util already had a grab of a UNSAFE object.
>> 
>> Maurizio
>> 
>>> 
>>> Cheers,
>>> Jorn
>>> 
>>> Maurizio Cimadamore schreef op 2019-01-29 15:38:
>>>> Hi,
>>>> in the light of recent discussions re. access modes, I decided to go
>>>> ahead and cleanup the split between BoundedPointer and
>>>> BoundedMemoryRegion, to avoid duplication of functionalities.
>>>> 
>>>> This patch does two things:
>>>> 
>>>> * moves Scope, AccessMode on BoundedPointer (where they belong, IMHO)
>>>> * reduce BoundedMemoryRegion to a simple helper class used to check
>>>> pointer bounds (and renames it to MemoryBoundInfo)
>>>> 
>>>> I also took care of minor cleanups, such as adding better
>>>> encapsulation for pointer/array implementation fields.
>>>> 
>>>> Webrev:
>>>> 
>>>> http://cr.openjdk.java.net/~mcimadamore/panama/8217989/
>>>> 
>>>> Maurizio



More information about the panama-dev mailing list