JDK-8244601: Cleanup support for upcall handles #154
This patch removes the SystemABI::freeUpcallStub routine and, in its place, allows SystemABI::upcallHandle to return a stub segment which can be explicitly closed by the user.
I think having one less method in SystemABI is cleaner - but I'm not 100% sure that using a segment as the return type is the way to go; I found myself split between returning MemoryAddress and MemorySegment while writing this patch. I ultimately went for MemorySegment because I think it makes idiomatic code a tad cleaner (look at StdLibTest).
When writing this I also wondered if we couldn't benefit from a separate abstraction for callbacks - something like:
And then teach SystemABI about this carrier (the translation into a raw address should be relatively painless). But then we'd still need to support cases where the function pointer is obtained through another native call (in which case the carrier will just be MemoryAddress). So I'm not sure in the end having this additional abstraction will change things significantly compared to just having a segment and have the user calling
That said, I'm open to suggestions if people feel strongly one way or another.
@mcimadamore This change now passes all automated pre-integration checks, type
There are currently no new commits on the