RFC: Refactoring SystemABI

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Nov 23 01:47:05 UTC 2018


On 22/11/2018 21:30, Jorn Vernee wrote:
> 3.) There is a shortcut being taken when native code gives us a 
> Pointer back to one of our upcall stubs, and we want to call it from 
> Java. In that case we don't really need to call into native, to call 
> our own upcall stub to then call back into Java to call our target 
> method. So I think the ABI should also have a method like `Object 
> getFunctorForStub(Pointer<?> ptr);` which takes the role of what 
> `UpcallHandler.getUpcallHandler` is doing right now; It retrieves the 
> UpcallHandler instance that's embedded in the stub, and asks it for 
> the functor object that it stores, or otherwise returns null. I think 
> for this last one to work all UpcallHandler implementations should 
> have a common super type to expose this receiver object. 

What you propose is analogous to what I proposed. Here you have a method 
(getFunctor) which gives you the receiver directly. In my proposed 
approach, the UpcallHandle interface has a getReceiver method. So you 
ask the handle to the ABI, and then you ask the receiver from the handle.

What is it that bothers you about this approach?

Maurizio





More information about the panama-dev mailing list