[foreign] RFR 8217989: Consolidate BoundedPointer implementation

Jorn Vernee jbvernee at xs4all.nl
Wed Jan 30 12:10:47 UTC 2019


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.

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